diff --git a/CHANGELOG.md b/CHANGELOG.md index cc53e6ae01add33df1aab0faecd3af4998373f7e..4174dd3eed5bcbdcd5004c59e3e674a3930ca5b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,11 +22,8 @@ Der Aufbau & Umfang von Destination-Objekten hat sich geändert: - Das Attribut `publicOrganization` entfällt, weil - nur Kontaktinformationen für den Fall von technischen Problemen erfasst und hierbei so wenig Informationen wie möglich gespeichert werden sollen. - - Der Name der Organisation ist als Attribut für eine bessere Zuordnung zu `contact` gewandert. -- Das Attribut `technicalContact` wird umbenannt zu `contact` -- Das Attribut `contact` wurde angepasst, weil - - nur Kontaktinformationen für den Fall von technischen Problemen erfasst - - und hierbei so wenig Informationen wie möglich gespeichert werden sollen. + - Der Name der Organisation ist als Attribut für eine bessere Zuordnung zu `contactInformation` unter `legalName` gewandert. +- Das Attribut `technicalContact` wird umbenannt zu `contactInformation` und inhaltlich wie im Beispiel unten geändert - Die Attribute `callback` und `callbackURI` wurden zusammengeführt, - um die Struktur flacher zu gestalten, - und weil neben `callbackURI` keine anderen Attribute angeordnet sind. @@ -43,11 +40,12 @@ Der Aufbau & Umfang von Destination-Objekten hat sich geändert: ```json { - "contact": { - "firstName": "Max", - "lastName": "Mustermann", + "contactInformation": { + "legalName": "Max", + "address": "Mustermann", + "phone": "+49170123456789", "email": "max@mustermann.not", - "organizationName": "Musterorganisation" + "unit": "Musterabteilung XYZ" }, "schemas": [ { @@ -102,8 +100,8 @@ sauber routen kann, liefert er jetzt `{}` anstatt `{ "result": "success" }` zur - Beim Anlegen eines Antrags muss nun die Id der Destination (Zustellpunktes) mit angegeben werden, da sie nur bei der Anlage des Antrags notwendig ist und nicht bei den weiteren Aufrufen. -- Struktur um eine Application anzulegen ist nun nur noch `{ destinationId: …, announcedAttachments: … }`, da sich die - Gesamtstruktur geändert hat. In `announcedAttachments` wird angegeben ob Fachdaten für diesen Antrag hochgeladen +- Struktur um eine Application anzulegen ist nun nur noch `{ destinationId: …, announcedContentStructure: … }`, da sich die + Gesamtstruktur geändert hat. In `announcedContentStructure` wird angegeben ob Fachdaten für diesen Antrag hochgeladen werden als auch eine Liste an UUIDs die für diesen Antrag hochgeladen werden. Die Erstellung der UUIDs ist dem Client überlassen. diff --git a/bundle.sh b/bundle.sh index c4bdea481e4a2efd47982bbe520d5cfd776fe678..d7279daecaef3d5fb3c55773ab4023bb72d8848a 100755 --- a/bundle.sh +++ b/bundle.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh -YML_IN="spec/combined.yml" -YML_OUT="spec/combined-bundled.yml" +YML_IN="spec/zustelldienst.yml" +YML_OUT="spec/zustelldienst-bundled.yml" docker run --rm -v "$(pwd):/work" jeanberu/swagger-cli \ swagger-cli bundle -t yaml -o "/work/$YML_OUT" "/work/$YML_IN" diff --git a/spec/endpoints/applications/uuid.yml b/spec/endpoints/applications/uuid.yml index e7a9629ed40a6aa58605e5c5e9d015d5378eb203..c9bf8a42652bbef527df0fe5889378f5c531495a 100644 --- a/spec/endpoints/applications/uuid.yml +++ b/spec/endpoints/applications/uuid.yml @@ -4,7 +4,6 @@ parameters: get: operationId: get-application summary: Antrag abrufen - description: Ruft einen Antrag ab tags: - Application Retrieval security: @@ -57,7 +56,7 @@ post: requestBody: required: true content: - application/jose: + application/json: schema: $ref: '../../schemas/submit-application.yml' responses: diff --git a/spec/endpoints/attachments/uuid.yml b/spec/endpoints/attachments/uuid.yml index 303d890a10a6ca3bda6fb44f9ccf093d1cc708b9..7040347b83b903f7446ae2b44c13daea4b6df487 100644 --- a/spec/endpoints/attachments/uuid.yml +++ b/spec/endpoints/attachments/uuid.yml @@ -50,7 +50,7 @@ get: put: operationId: add-application-attachment summary: Anhang hinzufügen - description: Fügt einem Antrag einen verschlüsselten und base64-kodierten Anhang hinzu. + description: Upload des in announcedContentStructure angekündigten Anhangs als JSON Web Encryption unter der mitgeteilten UUID. tags: - Application Transfer security: @@ -67,7 +67,7 @@ put: $ref: '../../examples/encrypted-message.yml' responses: '201': - description: Created + description: Anhang erfolgreich hinzugefügt content: application/json: schema: diff --git a/spec/endpoints/destinations/index.yml b/spec/endpoints/destinations/index.yml index 3240260dbc46f552960e23b59ce7b927d4c032b2..3b7977003f1f88dd8906b05f689511b5575880e1 100644 --- a/spec/endpoints/destinations/index.yml +++ b/spec/endpoints/destinations/index.yml @@ -1,7 +1,7 @@ get: - operationId: get-all-destinations - summary: Zustellpunkte auflisten - description: Auflistung aller verfügbaren Zustellpunkte + operationId: get-my-destinations + summary: Selbst angelegte Zustellpunkte auflisten + description: Mit diesem Request können alle selbst angelegten Zustellpunkte sowie deren Konfigurationen abgerufen werden. tags: - Destination Management security: @@ -43,7 +43,7 @@ get: post: operationId: create-destination summary: Zustellpunkt anlegen - description: Erstellung eines neuen Zustellpunktes mit unterstüzten Antragsschemata. + description: Erstellung eines neuen Zustellpunktes mit Konfiguration zum Empfang von Anträgen tags: - Destination Management security: diff --git a/spec/endpoints/destinations/uuid.yml b/spec/endpoints/destinations/uuid.yml index 01a5a3cd27a8e787f144f068a9604ba01b9378f7..37af03f44b7ba1ed882f4585fa5f697b03309656 100644 --- a/spec/endpoints/destinations/uuid.yml +++ b/spec/endpoints/destinations/uuid.yml @@ -9,7 +9,6 @@ get: - Destination Management security: - OAuth20: - - 'destination:manage' - 'destination:subscribe' - 'destination:send' responses: @@ -47,7 +46,6 @@ get: put: operationId: update-destination summary: Zustellpunkt aktualisieren - description: Aktualisiert einen Zustellpunkt. tags: - Destination Management security: @@ -111,7 +109,7 @@ delete: - 'destination:manage' responses: '200': - description: OK + description: Zustellpunkt erfolgreich gelöscht. content: application/json: schema: diff --git a/spec/examples/application.yml b/spec/examples/application.yml index 009dc259402a6c9c8370ae0cea1886ce494a5dab..31f0dde7fc7c32d7e3a3da841765d3e10d7b1af4 100644 --- a/spec/examples/application.yml +++ b/spec/examples/application.yml @@ -11,3 +11,8 @@ value: - sourceState: incomplete targetState: queued timestamp: '2021-01-30T08:30:00Z' + announcedContentStructure: + data: true + attachments: + - 879ee109-a690-4db8-ab32-424284184d7d + - 2046f9f1-dc89-4440-9c24-c76a8f40d668 diff --git a/spec/examples/create-application.yml b/spec/examples/create-application.yml index 7d8b8f074aec201e9b0c84dda4944c58bd58c81f..b5c75938e6554c4c1613c55eaf21e74fccba9907 100644 --- a/spec/examples/create-application.yml +++ b/spec/examples/create-application.yml @@ -1,6 +1,6 @@ value: destinationId: 879ee109-a690-4db8-ab32-424284184d7d - announcedAttachments: + announcedContentStructure: data: true attachments: - 123ee109-a690-4db8-ab32-424284184d7d diff --git a/spec/examples/create-destination.yml b/spec/examples/create-destination.yml index f79e8e5b607d4b0ff9335bf1da9d64286a7e8d0e..5cfbbb5957b596ac831a10dfea992d5e6d621660 100644 --- a/spec/examples/create-destination.yml +++ b/spec/examples/create-destination.yml @@ -1,14 +1,15 @@ value: - contact: - firstName: Max - lastName: Mustermann + contactInformation: + legalName: Max + address: Musterstr. 31, 10000 Berlin, Deutschland + phone: "+49170123456789" email: max@mustermann.not - organizationName: Musterorganisation + unit: Department XYZ schemas: - schemaURI: urn:fitko:schema-x callback: 'http://127.0.0.1:4010/voluptas' encryptionKid: my-key-id-0xfff - keys: + publicKeys: keys: - kty: RSA kid: my-key-id-0xfff diff --git a/spec/examples/destination-list.yml b/spec/examples/destination-list.yml index fe8624f87ea275230287ef2f6ed3a40c8b087b5e..cbfc66622a5d011ae70988e78eb01f6489d90159 100644 --- a/spec/examples/destination-list.yml +++ b/spec/examples/destination-list.yml @@ -4,17 +4,31 @@ value: schemas: - schemaURI: urn:fitko:schema-x encryptionKid: my-key-id-0xfff - keys: + publicKeys: keys: - kty: RSA kid: my-key-id-0xfff + contactInformation: + legalName: Max + address: Musterstr. 31, 10000 Berlin, Deutschland + phone: "+49170123456789" + email: max@mustermann.not + unit: Department XYZ + callback: 'http://127.0.0.1:4010/voluptas' - destinationId: 2f59b8c6-3206-4734-aa21-a7b2a4d92f7a schemas: - schemaURI: urn:fitko:schema-x - schemaURI: urn:fitko:schema-y mimeType: application/xml encryptionKid: my-key-id-0xeee - keys: + publicKeys: keys: - kty: RSA kid: my-key-id-0xeee + contactInformation: + legalName: Max + address: Musterstr. 31, 10000 Berlin, Deutschland + phone: "+49170123456789" + email: max@mustermann.not + unit: Department XYZ + callback: 'http://127.0.0.1:4010/voluptas' diff --git a/spec/examples/destination.yml b/spec/examples/destination.yml index 9b78123d206941672d4cba3985531eff39fcd271..a18d51730e02239e5eebab604c14c0f73137ad40 100644 --- a/spec/examples/destination.yml +++ b/spec/examples/destination.yml @@ -3,7 +3,14 @@ value: schemas: - schemaURI: urn:fitko:schema-x encryptionKid: my-key-id-0xfff - keys: + publicKeys: keys: - kty: RSA kid: my-key-id-0xfff + contactInformation: + legalName: Max + address: Musterstr. 31, 10000 Berlin, Deutschland + phone: "+49170123456789" + email: max@mustermann.not + unit: Department XYZ + callback: 'http://127.0.0.1:4010/voluptas' diff --git a/spec/examples/update-destination.yml b/spec/examples/update-destination.yml index f79e8e5b607d4b0ff9335bf1da9d64286a7e8d0e..5cfbbb5957b596ac831a10dfea992d5e6d621660 100644 --- a/spec/examples/update-destination.yml +++ b/spec/examples/update-destination.yml @@ -1,14 +1,15 @@ value: - contact: - firstName: Max - lastName: Mustermann + contactInformation: + legalName: Max + address: Musterstr. 31, 10000 Berlin, Deutschland + phone: "+49170123456789" email: max@mustermann.not - organizationName: Musterorganisation + unit: Department XYZ schemas: - schemaURI: urn:fitko:schema-x callback: 'http://127.0.0.1:4010/voluptas' encryptionKid: my-key-id-0xfff - keys: + publicKeys: keys: - kty: RSA kid: my-key-id-0xfff diff --git a/spec/schemas/application.yml b/spec/schemas/application.yml index 38fe4c4f30fcf01204782e13b3afac2beaeb4178..3fabe1e60a8a1127c6c78d7dda96c43354493eda 100644 --- a/spec/schemas/application.yml +++ b/spec/schemas/application.yml @@ -41,7 +41,7 @@ properties: type: array items: $ref: './state-transition.yml' - announcedAttachments: + announcedContentStructure: type: object required: - data diff --git a/spec/schemas/attachment.yml b/spec/schemas/attachment.yml index ced3829e01b9245e16a9bd7bb64b911fa34927eb..7ebc7a2c359a85559f3d479ec0b7f52ba7e58f1e 100644 --- a/spec/schemas/attachment.yml +++ b/spec/schemas/attachment.yml @@ -1,4 +1,4 @@ title: Anhang -description: 'Repräsentation eines Anhangs, der mit einem Antrag verknüpft ist.' +description: Verschlüsselter Anhang im Format JSON Web Encryption (JWE) laut RFC7516 type: string pattern: '^[a-zA-Z0-9-_=.]+$' diff --git a/spec/schemas/contact-information.yml b/spec/schemas/contact-information.yml new file mode 100644 index 0000000000000000000000000000000000000000..0b3a10c0f947ec058f43acc1d631e5de3f62a580 --- /dev/null +++ b/spec/schemas/contact-information.yml @@ -0,0 +1,25 @@ +title: Kontakt +description: Angaben zum Ansprechpartner des Zustellpunktes +type: object +additionalProperties: false +required: + - legalName + - address + - phone + - email +properties: + legalName: + type: string + description: Juristischer Name der verantwortlichen Organisation + address: + type: string + description: Adresse der verantwortlichen Organisation + phone: + type: string + description: Telefonnummer der verantwortlichen Stelle + email: + type: string + description: Funktionspostfachadresse der verantwortlichen Stelle. Falls nicht vorhanden, kann auch eine personalisierte Adresse des Supportverantwortlichen eingetragen werden. + unit: + type: string + description: Verantwortliche Untereinheit (Abteilung, Referat, etc.) der Organisation. Kann zur Vereinfachung von Klärungsfragen angegeben werden. diff --git a/spec/schemas/contact.yml b/spec/schemas/contact.yml deleted file mode 100644 index 849c385da429999a4da7c85705605323adb2ad26..0000000000000000000000000000000000000000 --- a/spec/schemas/contact.yml +++ /dev/null @@ -1,22 +0,0 @@ -title: Kontakt -description: Angaben zum Ansprechpartner des Zustellpunktes -type: object -additionalProperties: false -required: - - firstName - - lastName - - email - - organizationName -properties: - firstName: - type: string - description: Vorname des Ansprechpartners - lastName: - type: string - description: Nachname des Ansprechpartners - email: - type: string - description: E-Mail des Ansprechpartners - organizationName: - type: string - description: Name des Unternehmens des Ansprechpartners diff --git a/spec/schemas/create-application.yml b/spec/schemas/create-application.yml index 70187c576434cb93c2bac722c8cb868cbcc466c6..be0340f2f9f6929ed089c800ff58bde43f2780a0 100644 --- a/spec/schemas/create-application.yml +++ b/spec/schemas/create-application.yml @@ -4,14 +4,14 @@ type: object additionalProperties: false required: - destinationId - - announcedAttachments + - announcedContentStructure properties: destinationId: type: string format: uuid minLength: 32 maxLength: 36 - announcedAttachments: + announcedContentStructure: type: object required: - data diff --git a/spec/schemas/create-destination.yml b/spec/schemas/create-destination.yml index 6a7bde6d9ddf58067a81e7d53a74edba9979aa8c..94a11dd98bade859967ba4b604ba49b8e068ff81 100644 --- a/spec/schemas/create-destination.yml +++ b/spec/schemas/create-destination.yml @@ -3,14 +3,14 @@ description: 'Notwendige Struktur, um einen Zustellpunkt zu hinterlegen.' type: object additionalProperties: false required: - - contact + - contactInformation - schemas - callback - encryptionKid - - keys + - publicKeys properties: - contact: - $ref: './contact.yml' + contactInformation: + $ref: './contact-information.yml' schemas: uniqueItems: true minItems: 1 @@ -22,11 +22,11 @@ properties: type: string minLength: 1 format: uri - description: 'Öffentliche URL des Zustellpunktes, an den Anträge geliefert werden sollen.' + description: 'Öffentlich erreichbare Callbackadresse, um Benachrichtigungen beim Vorliegen neuer Anträge zu empfangen.' encryptionKid: type: string maxLength: 64 - description: 'Öffentlicher Teil des Verschlüsselungsschlüssels der Destination. Ist im Attribut `keys` abrufbar.' + description: 'Öffentlicher Teil des Verschlüsselungsschlüssels der Destination. Ist im Attribut `publicKeys` abrufbar.' # signingKid ist nicht nötig, da diese in einer signierten Nachricht enthalten ist. - keys: + publicKeys: $ref: './jwks.yml' diff --git a/spec/schemas/destination-list.yml b/spec/schemas/destination-list.yml index b13a5764b6c7cabc9d0b02f9ba1c33eda17af487..421c20d7a1a0e34f0905da85f9502d0a61bb488a 100644 --- a/spec/schemas/destination-list.yml +++ b/spec/schemas/destination-list.yml @@ -1,4 +1,4 @@ -title: Liste von Zustellpunkten +title: Liste selbst angelegter Zustellpunkte type: object required: - destinations @@ -8,4 +8,4 @@ properties: minItems: 0 items: $ref: './destination.yml' - description: Eine Auflistung von Zustellpunkten mit ihren öffentlichen Informationen. + description: Eine Auflistung aller selbst angelegten Zustellpunkte diff --git a/spec/schemas/destination.yml b/spec/schemas/destination.yml index 4ba1d9367c5c0948f27b15057af79801db6fa0a2..085a425c57c42da6e992ab9981429eae583fffc0 100644 --- a/spec/schemas/destination.yml +++ b/spec/schemas/destination.yml @@ -5,7 +5,9 @@ required: - destinationId - schemas - encryptionKid - - keys + - publicKeys + - contactInformation + - callback properties: destinationId: type: string @@ -23,7 +25,14 @@ properties: encryptionKid: type: string maxLength: 64 - description: 'Öffentlicher Teil des Verschlüsselungsschlüssels der Destination. Ist im Attribut `keys` abrufbar.' + description: 'Öffentlicher Teil des Verschlüsselungsschlüssels der Destination. Ist im Attribut `publicKeys` abrufbar.' # signingKid ist nicht nötig, da diese in einer signierten Nachricht enthalten ist. - keys: + publicKeys: $ref: './jwks.yml' + contactInformation: + $ref: './contact-information.yml' + callback: + type: string + minLength: 1 + format: uri + description: 'Öffentlich erreichbare Callbackadresse, um Benachrichtigungen beim Vorliegen neuer Anträge zu empfangen.' diff --git a/spec/schemas/submit-application.yml b/spec/schemas/submit-application.yml index b406924aca0a7a800e0789107828de6798b07281..6c45554adfc08a42873d6dec01c5d4d1560977ea 100644 --- a/spec/schemas/submit-application.yml +++ b/spec/schemas/submit-application.yml @@ -1,12 +1,14 @@ title: Antrag absenden -description: Die mit Hilfe von JWE verschlüsselten Metadaten des Antrags. +description: Datenstruktur für den Abschluss eines Antrags. type: object required: - encryptedMetadata properties: encryptedMetadata: + description: Verschlüsselte Antragsmetadaten im Format JSON Web Encryption (JWE) laut RFC7516 type: string pattern: '^[a-zA-Z0-9-_=.]+$' encryptedData: + description: Verschlüsselte Antragsdaten im Format JSON Web Encryption (JWE) laut RFC7516 type: string pattern: '^[a-zA-Z0-9-_=.]+$' diff --git a/spec/schemas/update-destination.yml b/spec/schemas/update-destination.yml index be72a84288ab85c4c97b3dcc2efa38c359a110d4..194a6bd1699cce39d978705e6f982e9b0d4dc3e2 100644 --- a/spec/schemas/update-destination.yml +++ b/spec/schemas/update-destination.yml @@ -3,14 +3,14 @@ description: 'Struktur mit Attributen, die aktualisiert werden sollen.' type: object additionalProperties: false required: - - contact + - contactInformation - schemas - callback - encryptionKid - - keys + - publicKeys properties: - contact: - $ref: './contact.yml' + contactInformation: + $ref: './contact-information.yml' schemas: uniqueItems: true minItems: 1 @@ -22,11 +22,11 @@ properties: type: string minLength: 1 format: uri - description: 'Öffentliche URL des Zustellpunktes, an den Anträge geliefert werden sollen.' + description: 'Öffentlich erreichbare Callbackadresse, um Benachrichtigungen beim Vorliegen neuer Anträge zu empfangen.' encryptionKid: type: string maxLength: 64 - description: 'Öffentlicher Teil des Verschlüsselungsschlüssels der Destination. Ist im Attribut `keys` abrufbar.' + description: 'Öffentlicher Teil des Verschlüsselungsschlüssels der Destination. Ist im Attribut `publicKeys` abrufbar.' # signingKid ist nicht nötig, da diese in einer signierten Nachricht enthalten ist. - keys: + publicKeys: $ref: './jwks.yml' diff --git a/spec/zustelldienst.yml b/spec/zustelldienst.yml index 6c6d228ab585780587af46279311e480c2b785f7..48e1644d67724f7723a45b18200eaa4d19265eac 100644 --- a/spec/zustelldienst.yml +++ b/spec/zustelldienst.yml @@ -64,8 +64,8 @@ components: $ref: './schemas/application-state.yml' Attachment: $ref: './schemas/attachment.yml' - Contact: - $ref: './schemas/contact.yml' + ContactInformation: + $ref: './schemas/contact-information.yml' CreateApplication: $ref: './schemas/create-application.yml' CreateAttachment: diff --git a/validate.sh b/validate.sh new file mode 100755 index 0000000000000000000000000000000000000000..38a3cb2588651246995a0b0a962b0183cc739459 --- /dev/null +++ b/validate.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +./bundle.sh + +YML_IN="spec/zustelldienst-bundled.yml" + +docker run --rm -v "$(pwd):/work" jeanberu/swagger-cli \ + swagger-cli validate "/work/$YML_IN" +