Skip to content

Commit

Permalink
[server] Remove dead code: WorkspacePortAuthenticationService
Browse files Browse the repository at this point in the history
  • Loading branch information
geropl authored and roboquat committed Jul 27, 2021
1 parent 6099449 commit 311936b
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 377 deletions.
3 changes: 0 additions & 3 deletions components/server/src/container-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import { ImageSourceProvider } from './workspace/image-source-provider';
import { WorkspaceGarbageCollector } from './workspace/garbage-collector';
import { TokenGarbageCollector } from './user/token-garbage-collector';
import { WorkspaceDownloadService } from './workspace/workspace-download-service';
import { WorkspacePortAuthorizationService } from './user/workspace-port-auth-service';
import { WebsocketConnectionManager } from './websocket-connection-manager';
import { OneTimeSecretServer } from './one-time-secret-server';
import { GitpodServer, GitpodClient } from '@gitpod/gitpod-protocol';
Expand Down Expand Up @@ -175,8 +174,6 @@ export const productionContainerModule = new ContainerModule((bind, unbind, isBo
bind(WorkspaceGarbageCollector).toSelf().inSingletonScope();
bind(WorkspaceDownloadService).toSelf().inSingletonScope();

bind(WorkspacePortAuthorizationService).toSelf().inSingletonScope();

bind(OneTimeSecretServer).toSelf().inSingletonScope();

bind(AuthProviderService).toSelf().inSingletonScope();
Expand Down
7 changes: 0 additions & 7 deletions components/server/src/user/user-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { GitpodCookie } from "../auth/gitpod-cookie";
import { AuthorizationService } from "./authorization-service";
import { Permission } from "@gitpod/gitpod-protocol/lib/permission";
import { UserService } from "./user-service";
import { WorkspacePortAuthorizationService } from "./workspace-port-auth-service";
import { parseWorkspaceIdFromHostname } from "@gitpod/gitpod-protocol/lib/util/parse-workspace-id";
import { SessionHandlerProvider } from "../session-handler";
import { URL } from 'url';
Expand All @@ -42,7 +41,6 @@ export class UserController {
@inject(TosCookie) protected readonly tosCookie: TosCookie;
@inject(AuthorizationService) protected readonly authService: AuthorizationService;
@inject(UserService) protected readonly userService: UserService;
@inject(WorkspacePortAuthorizationService) protected readonly workspacePortAuthService: WorkspacePortAuthorizationService;
@inject(HostContextProvider) protected readonly hostContextProvider: HostContextProvider;
@inject(IAnalyticsWriter) protected readonly analytics: IAnalyticsWriter;
@inject(SessionHandlerProvider) protected readonly sessionHandlerProvider: SessionHandlerProvider;
Expand Down Expand Up @@ -292,11 +290,6 @@ export class UserController {

res.sendStatus(200);
});
router.get("/auth/workspace-port/:port", async (req: express.Request, res: express.Response, next: express.NextFunction) => {
const authenticatedUser = req.isAuthenticated() && User.is(req.user) && req.user || undefined;
const access = await this.workspacePortAuthService.authorizeWorkspacePortAccess(req.params.port, req.hostname, authenticatedUser, req.header("x-gitpod-port-auth"));
res.sendStatus(access ? 200 : 403);
});
router.get("/auth/monitor", async (req: express.Request, res: express.Response, next: express.NextFunction) => {
if (!req.isAuthenticated() || !User.is(req.user)) {
// Pretend there's nothing to see
Expand Down
176 changes: 0 additions & 176 deletions components/server/src/user/workspace-port-auth-service.spec.ts

This file was deleted.

Loading

0 comments on commit 311936b

Please sign in to comment.