Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds support for access rules and containers (#240)
- Loading branch information
Showing
4 changed files
with
72 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,41 @@ | ||
import type { Auditable } from './shared'; | ||
|
||
const APPLICATION_TYPES = ['private', 'public', 'management'] as const; | ||
const TRANSFORM_TYPES = ['mask', 'redact', 'reveal'] as const; | ||
|
||
type ApplicationType = typeof APPLICATION_TYPES[number]; | ||
type TransformType = typeof TRANSFORM_TYPES[number]; | ||
|
||
interface Application extends Auditable { | ||
id: string; | ||
tenantId: string; | ||
name: string; | ||
key?: string; | ||
type: ApplicationType; | ||
permissions?: string[]; | ||
rules?: AccessRule[]; | ||
} | ||
|
||
interface AccessRule { | ||
description: string; | ||
priority: number; | ||
container: string; | ||
transform: TransformType; | ||
permissions: string[]; | ||
} | ||
|
||
type CreateApplication = Pick<Application, 'name' | 'type'> & | ||
Partial<Pick<Application, 'permissions'>>; | ||
Partial<Pick<Application, 'permissions' | 'rules'>>; | ||
|
||
type UpdateApplication = Partial<Pick<Application, 'name' | 'permissions'>>; | ||
type UpdateApplication = Partial< | ||
Pick<Application, 'name' | 'permissions' | 'rules'> | ||
>; | ||
|
||
export type { | ||
ApplicationType, | ||
Application, | ||
CreateApplication, | ||
TransformType, | ||
UpdateApplication, | ||
}; | ||
export { APPLICATION_TYPES }; | ||
export { APPLICATION_TYPES, TRANSFORM_TYPES }; |
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