-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: credentials supported to configurations
Signed-off-by: Timo Glastra <[email protected]>
- Loading branch information
1 parent
14141a5
commit 0bcd792
Showing
8 changed files
with
178 additions
and
6 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
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
131 changes: 131 additions & 0 deletions
131
packages/oid4vci/src/metadata/credential-issuer/__tests__/credential-configurations.test.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,131 @@ | ||
import { describe, expect, test } from 'vitest' | ||
import { credentialsSupportedToCredentialConfigurationsSupported } from '../credential-configurations' | ||
|
||
describe('Credential Configurations', () => { | ||
test('credentials supported to credential configurations supported', () => { | ||
expect( | ||
credentialsSupportedToCredentialConfigurationsSupported([ | ||
{ | ||
id: 'd2662472-891c-413d-b3c6-e2f0109001c5', | ||
format: 'ldp_vc', | ||
'@context': [], | ||
types: ['VerifiableCredential', 'OpenBadgeCredential'], | ||
cryptographic_binding_methods_supported: ['did:key'], | ||
cryptographic_suites_supported: ['Ed25519Signature2018'], | ||
display: [ | ||
{ | ||
name: 'Example University Degree', | ||
description: 'JFF Plugfest 3 OpenBadge Credential', | ||
background_color: '#464c49', | ||
logo: {}, | ||
}, | ||
], | ||
}, | ||
{ | ||
id: '613ecbbb-0a4c-4041-bb78-c64943139d5f', | ||
format: 'jwt_vc_json', | ||
types: ['VerifiableCredential', 'OpenBadgeCredential'], | ||
cryptographic_binding_methods_supported: ['did:key'], | ||
cryptographic_suites_supported: ['EdDSA'], | ||
display: [ | ||
{ | ||
name: 'Example University Degree', | ||
description: 'JFF Plugfest 3 OpenBadge Credential', | ||
background_color: '#464c49', | ||
logo: {}, | ||
}, | ||
], | ||
}, | ||
{ | ||
id: '904afaa1-f319-4a12-9c3c-0a6081c3feb0', | ||
format: 'mso_mdoc', | ||
doctype: 'some-doc-type', | ||
cryptographic_binding_methods_supported: ['did:key'], | ||
cryptographic_suites_supported: ['EdDSA'], | ||
display: [ | ||
{ | ||
name: 'Passport', | ||
description: 'Passport of the Kingdom of Kākāpō', | ||
background_color: '#171717', | ||
logo: {}, | ||
}, | ||
], | ||
}, | ||
{ | ||
id: 'c3db5513-ae2b-46e9-8a0d-fbfd0ce52b6a', | ||
format: 'vc+sd-jwt', | ||
vct: 'something', | ||
cryptographic_binding_methods_supported: ['did:key'], | ||
cryptographic_suites_supported: ['EdDSA'], | ||
display: [ | ||
{ | ||
name: 'Passport', | ||
description: 'Passport of the Kingdom of Kākāpō', | ||
background_color: '#171717', | ||
logo: { url: 'https://static.mattr.global/credential-assets/government-of-kakapo/web/logo.svg' }, | ||
}, | ||
], | ||
}, | ||
]) | ||
).toEqual({ | ||
'd2662472-891c-413d-b3c6-e2f0109001c5': { | ||
format: 'ldp_vc', | ||
credential_definition: { | ||
'@context': [], | ||
type: ['VerifiableCredential', 'OpenBadgeCredential'], | ||
}, | ||
cryptographic_binding_methods_supported: ['did:key'], | ||
credential_signing_alg_values_supported: ['Ed25519Signature2018'], | ||
display: [ | ||
{ | ||
name: 'Example University Degree', | ||
description: 'JFF Plugfest 3 OpenBadge Credential', | ||
background_color: '#464c49', | ||
}, | ||
], | ||
}, | ||
'613ecbbb-0a4c-4041-bb78-c64943139d5f': { | ||
format: 'jwt_vc_json', | ||
credential_definition: { | ||
type: ['VerifiableCredential', 'OpenBadgeCredential'], | ||
}, | ||
cryptographic_binding_methods_supported: ['did:key'], | ||
credential_signing_alg_values_supported: ['EdDSA'], | ||
display: [ | ||
{ | ||
name: 'Example University Degree', | ||
description: 'JFF Plugfest 3 OpenBadge Credential', | ||
background_color: '#464c49', | ||
}, | ||
], | ||
}, | ||
'904afaa1-f319-4a12-9c3c-0a6081c3feb0': { | ||
format: 'mso_mdoc', | ||
doctype: 'some-doc-type', | ||
cryptographic_binding_methods_supported: ['did:key'], | ||
credential_signing_alg_values_supported: ['EdDSA'], | ||
display: [ | ||
{ | ||
name: 'Passport', | ||
description: 'Passport of the Kingdom of Kākāpō', | ||
background_color: '#171717', | ||
}, | ||
], | ||
}, | ||
'c3db5513-ae2b-46e9-8a0d-fbfd0ce52b6a': { | ||
format: 'vc+sd-jwt', | ||
vct: 'something', | ||
cryptographic_binding_methods_supported: ['did:key'], | ||
credential_signing_alg_values_supported: ['EdDSA'], | ||
display: [ | ||
{ | ||
name: 'Passport', | ||
description: 'Passport of the Kingdom of Kākāpō', | ||
background_color: '#171717', | ||
logo: { uri: 'https://static.mattr.global/credential-assets/government-of-kakapo/web/logo.svg' }, | ||
}, | ||
], | ||
}, | ||
}) | ||
}) | ||
}) |
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