-
Notifications
You must be signed in to change notification settings - Fork 0
Credential presentation notice #87
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ | |
| |[ShareDocumentsRequestSharingStopped](#sharedocumentsrequestsharingstopped)|Stop sharing of documents for ShareDocumentsRequest| | ||
| |[SignedDocument](#signeddocument)|Details about a signed document| | ||
| |[VerifiableCredentialNotice](#verifiablecredentialnotice)|Represents a legal document (Certificate, Licence, Permit, etc.) issued to a single person.| | ||
| |[VerifiablePresentationNotice](#verifiablepresentationnotice)|A request for a verifiable presentation. The request must include a credentials query of either dcql_query og simple_query.| | ||
|
|
||
| ## Appointment | ||
|
|
||
|
|
@@ -455,24 +456,57 @@ Payment information for an invoice | |
| </invoice-payment> | ||
| ``` | ||
|
|
||
| ## OpeningReceipt | ||
|
|
||
| To open the document the user must accept to send an opening receipt | ||
|
|
||
| ### Fields | ||
|
|
||
| |Name|Type|Required|Description| | ||
| |----|----|--------|-----------| | ||
| |group|String|yes|This is the group identifier for the opening receipt| | ||
|
|
||
| ### XML | ||
|
|
||
| ```xml | ||
| <opening-receipt xmlns="http://api.digipost.no/schema/datatypes"> | ||
| <group>aarsoppgave-bedriftAS-2025</group> | ||
| </opening-receipt> | ||
| ``` | ||
|
|
||
| ## OpeningReceiptAccepted | ||
|
|
||
| The document has been opened, and the opening receipt has been accepted and sent. | ||
|
|
||
| ### Fields | ||
|
|
||
| |Name|Type|Required|Description| | ||
| |----|----|--------|-----------| | ||
|
|
||
|
|
||
| ### XML | ||
|
|
||
| ```xml | ||
| <opening-receipt-accepted xmlns="http://api.digipost.no/schema/datatypes"/> | ||
| ``` | ||
|
|
||
|
Comment on lines
+459
to
+492
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Samme innspill her om autmoatisk omrokkering. Flytt tilbake.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Samme kommentar som over. Generatoren legger de automatisk i alfabetisk rekkefølge, så denne rekkefølgen er riktig |
||
| ## Payslip | ||
|
|
||
| For treating documents as Payslips. | ||
|
|
||
| ### Fields | ||
|
|
||
| | Name | Type | Required | Description | | ||
| |-------------|------------|----------|----------------------------------------| | ||
| | paymentDate | LocalDate | no | The date when the salary is paid out | | ||
| | netAmount | BigDecimal | no | Net salary, the actual amount paid out | | ||
|
|
||
| |Name|Type|Required|Description| | ||
| |----|----|--------|-----------| | ||
| |paymentDate|LocalDate|no|The date when the salary is paid out| | ||
| |netAmount|BigDecimal|no|Net salary, the actual amount received| | ||
|
|
||
| ### XML | ||
|
|
||
| ```xml | ||
| <payslip xmlns="http://api.digipost.no/schema/datatypes"> | ||
| <payment-date>2020-09-21</payment-date> | ||
| <net-amount>5000</net-amount> | ||
| <payment-date>2025-01-01</payment-date> | ||
| <net-amount>42000.00</net-amount> | ||
| </payslip> | ||
| ``` | ||
|
|
||
|
|
@@ -1151,44 +1185,6 @@ Stop sharing of documents for ShareDocumentsRequest | |
| ```xml | ||
| <share-documents-request-sharing-stopped xmlns="http://api.digipost.no/schema/datatypes"/> | ||
| ``` | ||
| ``` | ||
|
|
||
| ## OpeningReceipt | ||
|
|
||
| To open the document the user must accept to send an opening receipt | ||
|
|
||
| ### Complemented by: | ||
| [OpeningReceiptAccepted](#openingreceiptaccepted) | ||
|
|
||
| ### Fields | ||
|
|
||
| |Name|Type|Required|Description| | ||
| |----|----|--------|-----------| | ||
| |group|String|yes|This is the group identifier for the opening receipt| | ||
|
|
||
| ### XML | ||
|
|
||
| ```xml | ||
| <opening-receipt xmlns="http://api.digipost.no/schema/datatypes"> | ||
| <group>aarsoppgave-bedriftAS-2025</group> | ||
| </opening-receipt> | ||
| ``` | ||
|
|
||
| ## OpeningReceiptAccepted | ||
|
|
||
| The document has been opened, and the opening receipt has been accepted and sent. | ||
|
|
||
| ### Fields | ||
|
|
||
| |Name|Type|Required|Description| | ||
| |----|----|--------|-----------| | ||
|
|
||
|
|
||
| ### XML | ||
|
|
||
| ```xml | ||
| <opening-receipt-accepted xmlns="http://api.digipost.no/schema/datatypes"/> | ||
| ``` | ||
|
|
||
| ## SignedDocument | ||
|
|
||
|
|
@@ -1233,7 +1229,55 @@ Represents a legal document (Certificate, Licence, Permit, etc.) issued to a sin | |
| <credential-id>DL-1234567890</credential-id> | ||
| <valid-from>2025-01-01T10:00:00+02:00</valid-from> | ||
| <valid-until>2030-01-01T10:00:00+02:00</valid-until> | ||
| <title>Drivers Licence</title> | ||
| <description>This document confirms that the holder has a license to drive vehicles under the specified categories.</description> | ||
| <title>Drivers Licence</title> | ||
| <description>This document confirms that the holder has a license to drive vehicles under the specified categories.</description> | ||
| </verifiable-credential-notice> | ||
| ``` | ||
|
|
||
| ## VerifiablePresentationNotice | ||
|
|
||
| A request for a verifiable presentation. The request must include a credentials query of either dcql_query og simple_query. | ||
|
|
||
| ### Fields | ||
|
|
||
| |Name|Type|Required|Description| | ||
| |----|----|--------|-----------| | ||
| |title|String|yes|The title of the presentation request| | ||
| |description|String|yes|A detailed explanation of the presentation request.| | ||
| |simpleQuery|[SimpleQuery](#verifiablepresentationnoticesimplequery)|no|A simplified credential query format| | ||
| |dcqlQuery|[DcqlQuery](#verifiablepresentationnoticedcqlquery)|no|A credentials query following the Digital Credentials Query Language (DCQL) specification.| | ||
|
|
||
| ### VerifiablePresentationNotice.SimpleQuery | ||
|
|
||
| |Name|Type|Required|Description| | ||
| |----|----|--------|-----------| | ||
| |type|String|no|| | ||
| |format|[Format](#verifiablepresentationnoticeformat)|no|| | ||
|
|
||
| ### VerifiablePresentationNotice.Format | ||
|
|
||
| Valid values: | ||
|
|
||
| * JWT_VC_JSON | ||
| * MSO_MDOC | ||
| * SD_JWT | ||
|
|
||
| ### VerifiablePresentationNotice.DcqlQuery | ||
|
|
||
| |Name|Type|Required|Description| | ||
| |----|----|--------|-----------| | ||
| |credentials|List|yes|List of credential queries as per DCQL.| | ||
| |credentialSets|List|no|Optional credential sets for advanced DCQL queries.| | ||
|
|
||
| ### XML | ||
|
|
||
| ```xml | ||
| <verifiable-presentation-notice xmlns="http://api.digipost.no/schema/datatypes"> | ||
| <title>Driver’s License</title> | ||
| <description>We would like to verify your driver’s license.</description> | ||
| <simpleQuery> | ||
| <type>driversLicence</type> | ||
| <format>JWT_VC_JSON</format> | ||
| </simpleQuery> | ||
| </verifiable-presentation-notice> | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| package no.digipost.api.datatypes.types.verifiableCredential; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import jakarta.xml.bind.annotation.XmlElement; | ||
| import jakarta.xml.bind.annotation.XmlElementWrapper; | ||
| import lombok.*; | ||
| import no.digipost.api.datatypes.documentation.Description; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import static no.digipost.api.datatypes.types.verifiableCredential.Format.*; | ||
|
|
||
| @Value | ||
| @AllArgsConstructor | ||
| @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) | ||
| @With | ||
| public class DcqlQuery { | ||
|
|
||
| @XmlElementWrapper(name = "credentials") | ||
| @XmlElement(name = "credential") | ||
| @JsonProperty("credentials") | ||
| @Description("List of credential queries as per DCQL.") | ||
| @NotNull | ||
| List<Credential> credentials; | ||
|
|
||
| @XmlElementWrapper(name = "credential_sets") | ||
| @XmlElement(name = "credential_set") | ||
| @JsonProperty("credential_sets") | ||
| @Description("Optional credential sets for advanced DCQL queries.") | ||
| List<CredentialSet> credentialSets; | ||
|
|
||
|
|
||
| @Value | ||
| @AllArgsConstructor | ||
| @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) | ||
| @With | ||
| public static class Credential { | ||
| @XmlElement(name = "id") | ||
| String id; | ||
|
|
||
| @XmlElement(name = "format") | ||
| Format format; | ||
|
|
||
| @XmlElement(name = "meta") | ||
| Meta meta; | ||
|
|
||
| @XmlElementWrapper(name = "claims") | ||
| @XmlElement(name = "claim") | ||
| List<Claim> claims; | ||
|
|
||
| @XmlElementWrapper(name = "claim_sets") | ||
| @XmlElement(name = "claim_set") | ||
| @JsonProperty("claim_sets") | ||
| List<ClaimSet> claimSets; | ||
|
|
||
| public static Credential jwtVc(String id, List<String> typeValues) { | ||
| return new Credential(id, JWT_VC_JSON, new Meta(typeValues, null, null), null, null); | ||
| } | ||
|
|
||
| public static Credential mdoc(String id, String doctypeValue) { | ||
| return new Credential(id, MSO_MDOC, new Meta(null, doctypeValue, null), null, null); | ||
| } | ||
|
|
||
| public static Credential sdJwt(String id, List<String> vctValues) { | ||
| return new Credential(id, SD_JWT, new Meta(null, null, vctValues), null, null); | ||
| } | ||
| } | ||
|
|
||
| @Value | ||
| @AllArgsConstructor | ||
| @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) | ||
| @With | ||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| public static class Meta { | ||
| @XmlElement(name = "type_values") | ||
| @JsonProperty("type_values") | ||
| @Description("Must be specified when format is JWT_VC_JSON") | ||
| List<String> typeValues; | ||
|
|
||
| @XmlElement(name = "doctype_value") | ||
| @JsonProperty("doctype_value") | ||
| @Description("Must be specified when format is MSO_MDOC") | ||
| String doctypeValue; | ||
|
|
||
| @XmlElementWrapper(name = "vct_values") | ||
| @XmlElement(name = "vct_value") | ||
| @JsonProperty("vct_values") | ||
| @Description("Must be specified when format is SD_JWT") | ||
| List<String> vctValues; | ||
| } | ||
|
|
||
| @Value | ||
| @AllArgsConstructor | ||
| @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) | ||
| @With | ||
| public static class Claim { | ||
| @XmlElementWrapper(name = "path") | ||
| @XmlElement(name = "path_element") | ||
| List<String> path; | ||
|
|
||
| @XmlElement(name = "id") | ||
| String id; | ||
|
|
||
| @XmlElementWrapper(name = "values") | ||
| @XmlElement(name = "value") | ||
| List<String> values; | ||
| } | ||
|
|
||
| @Value | ||
| @AllArgsConstructor | ||
| @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) | ||
| @With | ||
| public static class ClaimSet { | ||
| @XmlElementWrapper(name = "claims") | ||
| @XmlElement(name = "claim_id") | ||
| List<String> claims; | ||
| } | ||
|
|
||
| @Value | ||
| @AllArgsConstructor | ||
| @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) | ||
| @With | ||
| public static class CredentialSet { | ||
| @XmlElementWrapper(name = "options") | ||
| @XmlElement(name = "option") | ||
| List<VerifiablePresentationNotice.Option> options; | ||
|
|
||
| @XmlElement(name = "required") | ||
| Boolean required; | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.