Skip to content

Commit

Permalink
Add UserGroupGateway interface
Browse files Browse the repository at this point in the history
Jira ticket: CAMS-283
  • Loading branch information
btposey committed Sep 16, 2024
1 parent e7c5093 commit c8b7c24
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 10 additions & 1 deletion backend/functions/lib/adapters/types/authorization.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CamsUser } from '../../../../../common/src/cams/users';
import { CamsUser, CamsUserGroup, CamsUserReference } from '../../../../../common/src/cams/users';
import { CamsJwt } from '../../../../../common/src/cams/jwt';
import { ApplicationContext } from './basic';

export type AuthorizationConfig = {
provider: string | null;
Expand All @@ -12,3 +13,11 @@ export interface OpenIdConnectGateway {
verifyToken: (accessToken: string) => Promise<CamsJwt>;
getUser: (accessToken: string) => Promise<CamsUser>;
}

export interface UserGroupGateway {
getUserGroups: (context: ApplicationContext) => Promise<CamsUserGroup[]>;
getUserGroupUsers(
context: ApplicationContext,
group: CamsUserGroup,
): Promise<CamsUserReference[]>;
}
6 changes: 6 additions & 0 deletions common/src/cams/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ export type CamsUser = CamsUserReference & {
export type AttorneyUser = CamsUser & {
caseLoad?: number;
};

export type CamsUserGroup = {
id: string;
name: string;
users?: CamsUser[];
};

0 comments on commit c8b7c24

Please sign in to comment.