Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/sphereon 1176 #106

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@
"did-jwt": "6.11.6",
"did-jwt-vc": "3.1.3",
"ethr-did": "2.3.9",
"@sphereon/ssi-types": "0.23.5-unstable.87",
"@sphereon/ssi-sdk.core": "0.23.5-unstable.87",
"@sphereon/ssi-sdk.data-store": "0.23.5-unstable.87",
"@sphereon/ssi-sdk.pd-manager": "0.23.5-unstable.87",
"@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth": "0.23.5-unstable.87",
"@sphereon/ssi-sdk.presentation-exchange": "0.23.5-unstable.87",
"@sphereon/oid4vci-client": "0.10.4-unstable.61",
"@sphereon/oid4vci-common": "0.10.4-unstable.61",
"@sphereon/oid4vci-issuer": "0.10.4-unstable.61",
"@sphereon/oid4vci-issuer-server": "0.10.4-unstable.61",
"@sphereon/ui-components.core": "0.2.1-unstable.2",
"@sphereon/ui-components.ssi-react": "0.2.1-unstable.2",
"@sphereon/ssi-types": "0.26.1-unstable.12",
"@sphereon/ssi-sdk.core": "0.26.1-unstable.12",
"@sphereon/ssi-sdk.data-store": "0.26.1-unstable.12",
"@sphereon/ssi-sdk.pd-manager": "0.26.1-unstable.12",
"@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth": "0.26.1-unstable.12",
"@sphereon/ssi-sdk.presentation-exchange": "0.26.1-unstable.12",
"@sphereon/oid4vci-client": "0.12.1-next.23",
"@sphereon/oid4vci-common": "0.12.1-next.23",
"@sphereon/oid4vci-issuer": "0.12.1-next.23",
"@sphereon/oid4vci-issuer-server": "0.12.1-next.23",
"@sphereon/ui-components.core": "0.2.1-next.46",
"@sphereon/ui-components.ssi-react": "0.2.1-next.46",
"@sphereon/pex": "3.3.2",
"@sphereon/pex-models": "2.2.4",
"@sphereon/did-auth-siop": "0.6.4",
"@sphereon/ssi-express-support": "0.23.5-unstable.87",
"@sphereon/ssi-express-support": "0.26.1-unstable.12",
"@sphereon/did-uni-client": "0.6.3-unstable.1",
"@veramo/core": "4.2.0",
"@veramo/credential-w3c": "4.2.0",
Expand Down
12 changes: 12 additions & 0 deletions packages/agent/conf/demos/abn/dids/jwk-es256.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"privateKeyHex": "357dd2e90677e15547d40375673b8d0fd0d230c6702c6c71334ba764883ef6bf",
"did": "did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4IjoiRmF4NzJBSEhsR3Blbm1yNTBKVUZqd0dTMUpxaklJQW42WUpQbGdpSG1mTSIsInkiOiJybDlwSVNhT1RVN29DVTJfTVBhZFZxbGd5bE5QbmRQZklRaXZDNllFalZnIn0",
"createArgs": {
"provider": "did:jwk",
"options": {
"kid": "did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4IjoiRmF4NzJBSEhsR3Blbm1yNTBKVUZqd0dTMUpxaklJQW42WUpQbGdpSG1mTSIsInkiOiJybDlwSVNhT1RVN29DVTJfTVBhZFZxbGd5bE5QbmRQZklRaXZDNllFalZnIn0#0",
"type": "Secp256r1",
"keyType": "Secp256r1"
}
}
}
153 changes: 153 additions & 0 deletions packages/agent/conf/demos/abn/oid4vci_metadata/abn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
{
"correlationId": "https://agent.abn.demo.sphereon.com",
"overwriteExisting": true,
"metadata": {
"credential_issuer": "https://agent.abn.demo.sphereon.com",
"credential_endpoint": "https://agent.abn.demo.sphereon.com/credentials",
"display": [
{
"name": "ABN AMRO",
"description": "ABN Issuer"
}
],
"credential_configurations_supported": {
"IBANLegalPerson": {
"display": [
{
"name": "IBAN legal person",
"description": "IBAN legal person",
"text_color": "#FBFBFB",
"logo": {
"url": "https://i.ibb.co/ZdVm5Bg/abn-logo.png",
"alt_text": "ABN Amro logo"
},
"background_image": {
"url": "https://i.ibb.co/kcb9XQ4/abncard-iban-lp.png",
"alt_text": "ABN Amro Card"
}
},
{
"locale": "en-US",
"name": "IBAN legal person",
"description": "IBAN legal person",
"text_color": "#FBFBFB",
"logo": {
"url": "https://i.ibb.co/ZdVm5Bg/abn-logo.png",
"alt_text": "ABN Amro logo"
},
"background_image": {
"url": "https://i.ibb.co/kcb9XQ4/abncard-iban-lp.png",
"alt_text": "ABN Amro Card"
}
},
{
"locale": "nl-NL",
"name": "IBAN legal person",
"description": "IBAN legal person",
"text_color": "#FBFBFB",
"logo": {
"url": "https://i.ibb.co/ZdVm5Bg/abn-logo.png",
"alt_text": "ABN Amro logo"
},
"background_image": {
"url": "https://i.ibb.co/kcb9XQ4/abncard-iban-lp.png",
"alt_text": "ABN Amro Card"
}
}
],
"id": "IBANLegalPerson",
"credential_definition": {
"type": [
"VerifiableCredential",
"IBANLegalPerson"
],
"credentialSubject": {
"bankName": {
"display": [
{
"name": "Bank name",
"locale": "en-US"
},
{
"name": "Bank naam",
"locale": "nl-NL"
}
]
},
"leiCodeBank": {
"display": [
{
"name": "LEI code",
"locale": "en-US"
},
{
"name": "LEI code",
"locale": "nl-NL"
}
]
},
"swiftNumber": {
"display": [
{
"name": "SWIFT code",
"locale": "en-US"
},
{
"name": "SWIFT code",
"locale": "nl-NL"
}
]
},
"iban": {
"display": [
{
"name": "IBAN",
"locale": "en-US"
},
{
"name": "IBAN",
"locale": "nl-NL"
}
]
},
"accountHolder": {
"display": [
{
"name": "Account Holder",
"locale": "en-US"
},
{
"name": "Rekeninghouder",
"locale": "nl-NL"
}
]
}
}
},
"types": [
"VerifiableCredential",
"IBANLegalPerson"
],
"format": "jwt_vc_json",
"cryptographic_binding_methods_supported": [
"did:jwk"
],
"cryptographic_suites_supported": [
"ES256"
]
}
},
"credential_supplier_config": {
"templates_base_dir": "templates",
"template_mappings": [
{
"credential_types": [
"IBANLegalPerson"
],
"template_path": "ibanLegalPerson.hbs",
"format": "jwt_vc_json"
}
]
}
}
}
9 changes: 9 additions & 0 deletions packages/agent/conf/demos/abn/oid4vci_options/abn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"definitionId": "abn",
"correlationId": "https://agent.abn.demo.sphereon.com",
"issuerOpts": {
"didOpts": {
"checkLinkedDomains": "if_present"
}
}
}
23 changes: 23 additions & 0 deletions packages/agent/conf/demos/abn/templates/ibanLegalPerson.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"@context": [
"https://raw.githubusercontent.com/Sphereon-Opensource/vc-contexts/master/abn-amro/iban-legalperson.schema.json",
"https://www.w3.org/2018/credentials/v1", {
"description": {
"@id": "http://schema.org/description",
"@container": "@language"
}
}
],
"type": [
"VerifiableCredential",
"IBANLegalPerson"
],
"expirationDate": "{{{ dateTimeAfterMonths 12 }}}",
"credentialSubject": {
"bankName": "{{bankName}}",
"leiCodeBank": "{{leiCodeBank}}",
"swiftNumber": "{{swiftNumber}}",
"iban": "{{iban}}",
"accountHolder": "{{accountHolder}}"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@
}
],
"id": "Woonplaatsverklaring",
"credential_definition": {
"type": [
"VerifiableCredential",
"Woonplaatsverklaring"
]
},
"types": [
"VerifiableCredential",
"Woonplaatsverklaring"
Expand Down Expand Up @@ -119,6 +125,12 @@
}
],
"id": "Omzetbelasting",
"credential_definition": {
"type": [
"VerifiableCredential",
"Woonplaatsverklaring"
]
},
"types": [
"VerifiableCredential",
"Omzetbelasting"
Expand Down
50 changes: 25 additions & 25 deletions packages/agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,31 @@
"@sphereon/pex": "^3.3.2",
"@sphereon/pex-models": "^2.2.4",
"@sphereon/react-native-argon2": "^2.0.9",
"@sphereon/ssi-express-support": "0.23.5-unstable.87",
"@sphereon/ssi-sdk-ext.did-provider-jwk": "0.18.2",
"@sphereon/ssi-sdk-ext.did-provider-web": "0.18.2",
"@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.18.2",
"@sphereon/ssi-sdk-ext.did-utils": "0.18.2",
"@sphereon/ssi-sdk-ext.key-manager": "0.18.2",
"@sphereon/ssi-sdk-ext.key-utils": "0.18.2",
"@sphereon/ssi-sdk-ext.kms-local": "0.18.2",
"@sphereon/ssi-sdk.core": "0.23.5-unstable.87",
"@sphereon/ssi-sdk.data-store": "0.23.5-unstable.87",
"@sphereon/ssi-sdk.kv-store-temp": "0.23.5-unstable.87",
"@sphereon/ssi-sdk.oid4vci-issuer": "0.23.5-unstable.87",
"@sphereon/ssi-sdk.oid4vci-issuer-rest-api": "0.23.5-unstable.87",
"@sphereon/ssi-sdk.oid4vci-issuer-store": "0.23.5-unstable.87",
"@sphereon/ssi-sdk.pd-manager": "0.23.5-unstable.87",
"@sphereon/ssi-sdk.presentation-exchange": "0.23.5-unstable.87",
"@sphereon/ssi-sdk.remote-server-rest-api": "0.23.5-unstable.87",
"@sphereon/ssi-sdk.siopv2-oid4vp-common": "0.23.5-unstable.87",
"@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth": "0.23.5-unstable.87",
"@sphereon/ssi-sdk.siopv2-oid4vp-rp-rest-api": "0.23.5-unstable.87",
"@sphereon/ssi-sdk.vc-handler-ld-local": "0.23.5-unstable.87",
"@sphereon/ssi-types": "0.23.5-unstable.87",
"@sphereon/oid4vci-common": "0.10.3",
"@sphereon/oid4vci-issuer": "0.10.3",
"@sphereon/oid4vci-issuer-server": "0.10.3",
"@sphereon/ssi-express-support": "0.26.1-unstable.12",
"@sphereon/ssi-sdk-ext.did-provider-jwk": "0.21.1-next.13",
"@sphereon/ssi-sdk-ext.did-provider-web": "0.21.1-next.13",
"@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.21.1-next.13",
"@sphereon/ssi-sdk-ext.did-utils": "0.21.1-next.13",
"@sphereon/ssi-sdk-ext.key-manager": "0.21.1-next.13",
"@sphereon/ssi-sdk-ext.key-utils": "0.21.1-next.13",
"@sphereon/ssi-sdk-ext.kms-local": "0.21.1-next.13",
"@sphereon/ssi-sdk.core": "0.26.1-unstable.12",
"@sphereon/ssi-sdk.data-store": "0.26.1-unstable.12",
"@sphereon/ssi-sdk.kv-store-temp": "0.26.1-unstable.12",
"@sphereon/ssi-sdk.oid4vci-issuer": "0.26.1-unstable.12",
"@sphereon/ssi-sdk.oid4vci-issuer-rest-api": "0.26.1-unstable.12",
"@sphereon/ssi-sdk.oid4vci-issuer-store": "0.26.1-unstable.12",
"@sphereon/ssi-sdk.pd-manager": "0.26.1-unstable.12",
"@sphereon/ssi-sdk.presentation-exchange": "0.26.1-unstable.12",
"@sphereon/ssi-sdk.remote-server-rest-api": "0.26.1-unstable.12",
"@sphereon/ssi-sdk.siopv2-oid4vp-common": "0.26.1-unstable.12",
"@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth": "0.26.1-unstable.12",
"@sphereon/ssi-sdk.siopv2-oid4vp-rp-rest-api": "0.26.1-unstable.12",
"@sphereon/ssi-sdk.vc-handler-ld-local": "0.26.1-unstable.12",
"@sphereon/ssi-types": "0.26.1-unstable.12",
"@sphereon/oid4vci-common": "0.12.1-next.28",
"@sphereon/oid4vci-issuer": "0.12.1-next.28",
"@sphereon/oid4vci-issuer-server": "0.12.1-next.28",
"@sphereon/wellknown-dids-client": "^0.1.3",
"@transmute/lds-ecdsa-secp256k1-recovery2020": "^0.0.7",
"@veramo/core": "4.2.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/agent/src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const plugins: IAgentPlugin[] = [
new DIDResolverPlugin({
resolver,
}),
new PresentationExchange({pdStore}),
new PresentationExchange(),
new CredentialPlugin(),
new CredentialHandlerLDLocal({
contextMaps: [LdDefaultContexts],
Expand All @@ -122,7 +122,7 @@ const plugins: IAgentPlugin[] = [
}),
new PDManager({store: pdStore})
]
const oid4vpRP = IS_OID4VP_ENABLED ? await createOID4VPRP({resolver, pdStore}) : undefined;
const oid4vpRP = IS_OID4VP_ENABLED ? await createOID4VPRP({resolver}) : undefined;
if (oid4vpRP) {
plugins.push(oid4vpRP)
}
Expand Down Expand Up @@ -282,6 +282,6 @@ const definitionsToImport: Array<IPresentationDefinition> = syncDefinitionsOpts.
if (definitionsToImport.length > 0) {
agent.siopImportDefinitions({
definitions: definitionsToImport,
versionControlMode: 'AutoIncrementMajor' // This is the default, but just to indicate here it exists
versionControlMode: 'AutoIncrement' // This is the default, but just to indicate here it exists
})
}
4 changes: 2 additions & 2 deletions packages/agent/src/database/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Entities as VeramoDataStoreEntities, migrations as VeramoDataStoreMigra
import {
DataStoreContactEntities,
DataStoreMigrations,
DataStorePresentationDefinitionItemEntities
DataStorePresentationDefinitionEntities
} from '@sphereon/ssi-sdk.data-store'
import { SqliteConnectionOptions } from 'typeorm/driver/sqlite/SqliteConnectionOptions'
import { KeyValueStoreEntity, kvStoreMigrations } from '@sphereon/ssi-sdk.kv-store-temp'
Expand All @@ -18,7 +18,7 @@ const sqliteConfig: SqliteConnectionOptions = {
entities: [
...VeramoDataStoreEntities,
...DataStoreContactEntities,
...DataStorePresentationDefinitionItemEntities,
...DataStorePresentationDefinitionEntities,
KeyValueStoreEntity
],
migrations: [
Expand Down
7 changes: 5 additions & 2 deletions packages/agent/src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import {

dotenvConfig()

const toBoolean = (value?: string): boolean => value === undefined || value === 'true';


export const DB_CONNECTION_NAME = process.env.DB_CONNECTION_NAME ?? 'default'
export const DB_SQLITE_FILE = process.env.DB_SQLITE_FILE ?? 'database/agent_default.sqlite'

Expand All @@ -36,8 +39,8 @@ export const oid4vciInstanceOpts = loadJsonFiles<IIssuerOptsImportArgs>({path: O
export const oid4vciMetadataOpts = loadJsonFiles<IMetadataImportArgs>({path: OID4VCI_ISSUER_METADATA_PATH})
export const syncDefinitionsOpts = loadJsonFiles<IPresentationDefinition>({path: OID4VP_PRESENTATION_DEFINITION_PATH})
export const didOptConfigs = loadJsonFiles<IDIDOpts>({path: DID_OPTIONS_PATH})
export const IS_OID4VP_ENABLED = process.env.OID4VP_ENABLED === undefined || process.env.OID4VP_ENABLED
export const IS_OID4VCI_ENABLED = process.env.OID4VCI_ENABLED === undefined || process.env.OID4VCI_ENABLED
export const IS_OID4VP_ENABLED = toBoolean(process.env.OID4VP_ENABLED)
export const IS_OID4VCI_ENABLED = toBoolean(process.env.OID4VCI_ENABLED )

export * from './types'
export * from './utils'
Expand Down
4 changes: 2 additions & 2 deletions packages/agent/src/utils/environment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ declare global {
PORT?: string
INTERNAL_HOSTNAME_OR_IP?: string
EXTERNAL_HOSTNAME?: string
OID4VP_ENABLED?: boolean
OID4VP_WEBAPP_BASE_URI?: string
OID4VP_AGENT_BASE_URI?: string
OID4VP_DEFINITIONS?: string
OID4VCI_ENABLED?: boolean
OID4VP_ENABLED?: string
OID4VCI_ENABLED?: string
OID4VCI_DEFAULTS_USER_PIN_REQUIRED?: string
COOKIE_SIGNING_KEY?: string
DEFAULT_DID?: string
Expand Down
Loading