diff --git a/src/types/models/applications.ts b/src/types/models/applications.ts index 628c0723..34839ada 100644 --- a/src/types/models/applications.ts +++ b/src/types/models/applications.ts @@ -14,21 +14,30 @@ type TransformType = typeof TRANSFORM_TYPES[number]; interface Application extends Auditable { id: string; tenantId: string; - name: string; + name?: string; key?: string; type: ApplicationType; permissions?: string[]; rules?: AccessRule[]; + canCreateExpiringApplications?: boolean; + expiresAt?: string; } interface AccessRule { description: string; priority: number; - container: string; + container?: string; transform: TransformType; permissions: string[]; + conditions?: Condition[]; } +type Condition = { + attribute: string; + operator: string; + value: string; +}; + type CreateApplication = Pick & Partial>; diff --git a/src/types/models/tokens.ts b/src/types/models/tokens.ts index f2fff00a..b5eb62e3 100644 --- a/src/types/models/tokens.ts +++ b/src/types/models/tokens.ts @@ -82,6 +82,7 @@ type UpdateToken = Partial< | 'searchIndexes' | 'fingerprintExpression' | 'mask' + | 'expiresAt' > & { privacy: Omit; deduplicateToken: boolean; diff --git a/test/applications.test.ts b/test/applications.test.ts index 0a7ee7d1..99eb9957 100644 --- a/test/applications.test.ts +++ b/test/applications.test.ts @@ -37,6 +37,8 @@ describe('Applications', () => { name: chance.string(), type: chance.string() as ApplicationType, permissions: [chance.string()], + canCreateExpiringApplications: chance.bool(), + expiresAt: chance.date().toString(), }, updatePayload: { name: chance.string(), @@ -63,8 +65,17 @@ describe('Applications', () => { 'reveal', ]), permissions: [chance.string()], + conditions: [ + { + attribute: chance.string(), + operator: chance.string(), + value: chance.string(), + }, + ], }, ], + canCreateExpiringApplications: chance.bool(), + expiresAt: chance.date().toString(), }, updatePayload: { name: chance.string(), @@ -79,6 +90,7 @@ describe('Applications', () => { 'reveal', ]), permissions: [chance.string()], + conditions: [], }, ], }, diff --git a/test/tokens.test.ts b/test/tokens.test.ts index 96d3114b..323c5420 100644 --- a/test/tokens.test.ts +++ b/test/tokens.test.ts @@ -646,6 +646,7 @@ describe('Tokens', () => { alg: _chance.string(), }, }, + expiresAt: _chance.date().toString(), metadata: { camelCaseParameter: _chance.string(), snake_case_parameter: _chance.string(), @@ -709,6 +710,7 @@ describe('Tokens', () => { }, searchIndexes: [_chance.string(), _chance.string()], fingerprintExpression: _chance.string(), + expiresAt: _chance.date().toString(), }; /* eslint-enable camelcase */