-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BC-3991 - Exchange AuthorizationReferenceService with AuthorizationCl…
…ientAdapter (#5154)
- Loading branch information
1 parent
736c083
commit 4925cd3
Showing
30 changed files
with
399 additions
and
362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 25 additions & 6 deletions
31
apps/server/src/infra/authorization-client/authorization-client.adapter.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export { Action, AuthorizationBodyParamsReferenceType, AuthorizationContextParams } from './authorization-api-client'; | ||
export { AuthorizationClientAdapter } from './authorization-client.adapter'; | ||
export { AuthorizationClientModule } from './authorization-client.module'; | ||
export { AuthorizationClientConfig, AuthorizationClientModule } from './authorization-client.module'; | ||
export { AuthorizationContextBuilder } from './mapper'; |
23 changes: 23 additions & 0 deletions
23
apps/server/src/infra/authorization-client/mapper/authorization-context.builder.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Permission } from '@shared/domain/interface'; | ||
import { Action, AuthorizationContextParams } from '../authorization-api-client'; | ||
|
||
export class AuthorizationContextBuilder { | ||
static build(requiredPermissions: Array<Permission>, action: Action): AuthorizationContextParams { | ||
return { | ||
action, | ||
requiredPermissions, | ||
}; | ||
} | ||
|
||
static write(requiredPermissions: Permission[]): AuthorizationContextParams { | ||
const context = this.build(requiredPermissions, Action.WRITE); | ||
|
||
return context; | ||
} | ||
|
||
static read(requiredPermissions: Permission[]): AuthorizationContextParams { | ||
const context = this.build(requiredPermissions, Action.READ); | ||
|
||
return context; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './authorization-context.builder'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.