From 689d19da7ef43cb7b808f961e5c3992bc620dbbf Mon Sep 17 00:00:00 2001 From: "A.G.J. Cate" Date: Tue, 29 Oct 2024 12:13:04 +0100 Subject: [PATCH] feature: added Federation Operator credential role for parties --- .../src/__tests__/contact.store.test.ts | 22 +++++++++++++++++-- .../digitalCredential/digitalCredential.ts | 1 + 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/packages/data-store/src/__tests__/contact.store.test.ts b/packages/data-store/src/__tests__/contact.store.test.ts index 3d82417b7..6fe3474d2 100644 --- a/packages/data-store/src/__tests__/contact.store.test.ts +++ b/packages/data-store/src/__tests__/contact.store.test.ts @@ -367,6 +367,15 @@ describe('Contact store tests', (): void => { correlationId: 'example_did3', }, }, + { + alias: 'test_alias4', + origin: IdentityOrigin.EXTERNAL, + roles: [CredentialRole.FEDERATION_OPERATOR], + identifier: { + type: CorrelationIdentifierType.DID, + correlationId: 'example_did4', + }, + }, ], electronicAddresses: [ { @@ -391,7 +400,7 @@ describe('Contact store tests', (): void => { } const result: Array = await contactStore.getParties(args) - expect(result[0].identities.length).toEqual(3) + expect(result[0].identities.length).toEqual(4) expect(result[0].electronicAddresses.length).toEqual(1) }) @@ -1208,6 +1217,15 @@ describe('Contact store tests', (): void => { correlationId: 'example_did3', }, }, + { + alias: 'test_alias4', + origin: IdentityOrigin.EXTERNAL, + roles: [CredentialRole.FEDERATION_OPERATOR], + identifier: { + type: CorrelationIdentifierType.DID, + correlationId: 'example_did4', + }, + }, ], } @@ -1216,7 +1234,7 @@ describe('Contact store tests', (): void => { expect(result.roles).toBeDefined() expect(result.roles.length).toEqual(3) - expect(result.roles).toEqual([CredentialRole.VERIFIER, CredentialRole.ISSUER, CredentialRole.HOLDER]) + expect(result.roles).toEqual([CredentialRole.VERIFIER, CredentialRole.ISSUER, CredentialRole.HOLDER, CredentialRole.FEDERATION_OPERATOR]) }) it('should add relationship', async (): Promise => { diff --git a/packages/data-store/src/types/digitalCredential/digitalCredential.ts b/packages/data-store/src/types/digitalCredential/digitalCredential.ts index 982b7e3c9..587a49bad 100644 --- a/packages/data-store/src/types/digitalCredential/digitalCredential.ts +++ b/packages/data-store/src/types/digitalCredential/digitalCredential.ts @@ -93,6 +93,7 @@ export enum CredentialRole { ISSUER = 'ISSUER', VERIFIER = 'VERIFIER', HOLDER = 'HOLDER', + FEDERATION_OPERATOR = 'FEDERATION OPERATOR' } export enum CredentialStateType {