From 6bcc8849a4eba348c29ccfaf9fb8190dc91036c1 Mon Sep 17 00:00:00 2001 From: Rein Krul Date: Fri, 18 Oct 2024 14:51:17 +0200 Subject: [PATCH] Discovery: allow registration parameters to be passed --- deploy/discovery/dev_eOverdracht2023.json | 52 ++++++++- docker-compose.yaml | 1 + web/src/admin/ActivateDiscoveryService.vue | 123 +++++++++++++++++++++ web/src/admin/IdentityDetails.vue | 17 +-- web/src/index.js | 12 +- 5 files changed, 185 insertions(+), 20 deletions(-) create mode 100644 web/src/admin/ActivateDiscoveryService.vue diff --git a/deploy/discovery/dev_eOverdracht2023.json b/deploy/discovery/dev_eOverdracht2023.json index e93aae2..1cc3ae7 100644 --- a/deploy/discovery/dev_eOverdracht2023.json +++ b/deploy/discovery/dev_eOverdracht2023.json @@ -10,8 +10,20 @@ "JsonWebSignature2020" ] }, + "jwt_vc": { + "alg": [ + "ES256" + ] + }, + "ldp_vp": { + "proof_type": [ + "JsonWebSignature2020" + ] + }, "jwt_vp": { - "alg": ["ES256"] + "alg": [ + "ES256" + ] } }, "input_descriptors": [ @@ -48,6 +60,44 @@ } ] } + }, + { + "id": "id_registration_parameters_credential", + "name": "Registration parameters", + "purpose": "Finding endpoints registered by the care organization.", + "constraints": { + "fields": [ + { + "path": [ + "$.type" + ], + "filter": { + "type": "string", + "const": "DiscoveryRegistrationCredential" + } + }, + { + "id": "authorization_server_url", + "purpose": "Used by clients to request OAuth2 access tokens.", + "path": [ + "$.credentialSubject.authServerURL" + ], + "filter": { + "type": "string" + } + }, + { + "id": "fhir_notification_url", + "purpose": "FHIR subscription REST channel endpoint, issued by SCP-nodes notify about FHIR resources.", + "path": [ + "$.credentialSubject.fhirNotificationURL" + ], + "filter": { + "type": "string" + } + } + ] + } } ] } diff --git a/docker-compose.yaml b/docker-compose.yaml index 68a0079..9a88f76 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -14,6 +14,7 @@ services: NUTS_STRICTMODE: false NUTS_DISCOVERY_DEFINITIONS_DIRECTORY: /opt/nuts/discovery NUTS_POLICY_DIRECTORY: /opt/nuts/policy + NUTS_AUTH_CONTRACTVALIDATORS: dummy # nuts-admin: # build: # context: . diff --git a/web/src/admin/ActivateDiscoveryService.vue b/web/src/admin/ActivateDiscoveryService.vue new file mode 100644 index 0000000..1270413 --- /dev/null +++ b/web/src/admin/ActivateDiscoveryService.vue @@ -0,0 +1,123 @@ + + + diff --git a/web/src/admin/IdentityDetails.vue b/web/src/admin/IdentityDetails.vue index add82bd..b1310b9 100644 --- a/web/src/admin/IdentityDetails.vue +++ b/web/src/admin/IdentityDetails.vue @@ -61,7 +61,7 @@ - @@ -146,21 +146,6 @@ export default { showDIDDocument(id) { this.shownDIDDocument = this.shownDIDDocument === id ? undefined : id }, - activateService(id) { - this.fetchError = undefined - this.$api.post(`api/proxy/internal/discovery/v1/${id}/${this.details.subject}`) - .then(data => { - if (data.reason) { - this.fetchError = data.reason - } - }) - .catch(response => { - this.fetchError = response - }) - .finally(() => { - this.fetchData() - }) - }, deactivateService(id) { this.fetchError = undefined this.$api.delete(`api/proxy/internal/discovery/v1/${id}/${this.details.subject}`) diff --git a/web/src/index.js b/web/src/index.js index 33cc8d1..c26850e 100644 --- a/web/src/index.js +++ b/web/src/index.js @@ -12,6 +12,7 @@ import IssuedCredentials from './admin/IssuedCredentials.vue' import Api from './plugins/api' import IdentityDetails from "./admin/IdentityDetails.vue"; import IssueCredential from "./admin/IssueCredential.vue"; +import ActivateDiscoveryService from "./admin/ActivateDiscoveryService.vue"; const routes = [ { @@ -37,15 +38,20 @@ const routes = [ modal: NewIdentity } }, - ] + ], }, { path: 'id/:subjectID', name: 'admin.identityDetails', - component: IdentityDetails + component: IdentityDetails, }, { - path: 'vc/issue/:credentialType?/:subjectDID?', + path: 'id/:subjectID/discovery/:discoveryServiceID/activate', + name: 'admin.activateDiscoveryService', + component: ActivateDiscoveryService + }, + { + path: 'vc/issue/:credentialType?/:subjectDID', name: 'admin.issueCredential', component: IssueCredential },