Skip to content

Commit

Permalink
chore: Removed unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
worgho2 committed May 26, 2024
1 parent 99c2973 commit 95e7874
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions packages/api/infrastructure/auth/in-memory-auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { APIGatewayProxyEventV2WithJWTAuthorizer } from 'aws-lambda';
import { Auth } from '../../application/auth';
import { Principal } from '../../domain/dtos/principal';
import { Role } from '../../domain/dtos/role';
Expand All @@ -14,19 +13,11 @@ export class InMemoryAuth extends Auth {
});
}

static extractPrincipal(event: APIGatewayProxyEventV2WithJWTAuthorizer): Principal {
return {
claims: event.requestContext.authorizer.jwt.claims,
};
}

static readonly createTestUserPrincipal = (
data: {
username?: string;
role?: Role;
userId?: string;
} = {},
): Principal => ({
static readonly createTestUserPrincipal = (data: {
username?: string;
role?: Role;
userId?: string;
}): Principal => ({
claims: {
username: data.username ?? randomUUID(),
role: data.role ?? 'NONE',
Expand Down

0 comments on commit 95e7874

Please sign in to comment.