Skip to content

Commit

Permalink
Remove routes from gateway (#2531)
Browse files Browse the repository at this point in the history
Remove routes and unnecessary code from Gateway to finish #2362
  • Loading branch information
SamBroner authored Jun 16, 2020
1 parent d8ad001 commit 0faad86
Show file tree
Hide file tree
Showing 20 changed files with 35 additions and 1,207 deletions.
6 changes: 6 additions & 0 deletions server/gateway/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @microsoft/fluid-server-gateway

## What is Gateway?
Gateway is an example host. It's a simple service that deploys a controller with a Fluid Framework loader and the necessary drivers to connect to
Routerlicious.

Historically, Gateway was used internally to test the Fluid Framework.

## Testing changes under gateway

To begin you'll need to connect to the Fluid private npm repository. Instructions can be found [here](../routerlicious/README.md#authorizing-to-private-npm-feed)
Expand Down
57 changes: 0 additions & 57 deletions server/gateway/src/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,61 +113,4 @@ export class AccountManager {
const db = await this.mongoManager.getDatabase();
return db.collection<IAccount>(this.accountsCollectionName);
}

// public async refreshTokens(account: IAccount): Promise<ITokens> {
// const udpatedAccountP = new Promise((resolve, reject) => {
// // TODO should consolidate the account specific behavior behind an interface
// if (account.provider === "microsoft") {
// const microsoftConfiguration = nconf.get("login:microsoft");
// request.post("https://login.microsoftonline.com/common/oauth2/v2.0/token", {
// form: {
// client_id: microsoftConfiguration.clientId,
// client_secret: microsoftConfiguration.secret,
// grant_type: "refresh_token",
// refresh_token: account.refreshToken,
// },
// json: true,
// }, (error, response, body) => {
// if (error) {
// reject(error);
// } else {
// account.accessToken = body.access_token;
// account.expiration = getTokenExpiration(body.expires_in);
// resolve(account);
// }
// });
// } else if (account.provider === "google") {
// const googleConfig = nconf.get("login:google");
// const oauth2Client = new google.auth.OAuth2(
// googleConfig.clientId, googleConfig.secret, "/auth/google");

// // Retrieve tokens via token exchange explained above or set them:
// oauth2Client.setCredentials(
// { access_token: account.accessToken, refresh_token: account.refreshToken });
// oauth2Client.refreshAccessToken((error, tokens) => {
// if (error) {
// reject(error);
// } else {
// account.accessToken = tokens.access_token;
// account.expiration = moment(tokens.expiry_date).utc().toISOString();
// account.refreshToken = tokens.refresh_token;
// resolve(account);
// }
// });
// } else {
// throw { error: "Unknown Provider" };
// }
// });

// // Get the updated account information and then use it to update the DB and then return the tokens back
// return udpatedAccountP.then((updatedAccount: IAccount) => {
// return this.updateAccount(updatedAccount).then(() => {
// return {
// access: updatedAccount.accessToken,
// expiration: updatedAccount.expiration,
// refresh: updatedAccount.refreshToken ,
// };
// });
// });
// }
}
5 changes: 0 additions & 5 deletions server/gateway/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,15 +327,10 @@ export function create(
});

app.use(routes.api);
app.use("/templates", routes.templates);
app.use("/loader", routes.loader);
app.use("/loaderFramed", routes.loaderFramed);
app.use("/frontpage", routes.frontpage);
app.use("/waterpark", routes.waterpark);
app.use("/fastloader", routes.fastLoader);
app.use("/democreator", routes.demoCreator);
app.use("/versions", routes.versions);
app.use("/fork", routes.fork);
app.use("/token", routes.token);
app.use(routes.home);

Expand Down
114 changes: 0 additions & 114 deletions server/gateway/src/routes/democreator.ts

This file was deleted.

173 changes: 0 additions & 173 deletions server/gateway/src/routes/fastLoader.ts

This file was deleted.

Loading

0 comments on commit 0faad86

Please sign in to comment.