Skip to content

Commit

Permalink
Merge branch 'master' into vdr/produce-didweb
Browse files Browse the repository at this point in the history
  • Loading branch information
woutslakhorst authored Dec 5, 2023
2 parents fa9d503 + 9913b5a commit d90181a
Show file tree
Hide file tree
Showing 31 changed files with 285 additions and 224 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ COPY . .
RUN CGO_ENABLED=1 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags="-w -s -X 'github.com/nuts-foundation/nuts-node/core.GitCommit=${GIT_COMMIT}' -X 'github.com/nuts-foundation/nuts-node/core.GitBranch=${GIT_BRANCH}' -X 'github.com/nuts-foundation/nuts-node/core.GitVersion=${GIT_VERSION}'" -o /opt/nuts/nuts

# alpine
FROM alpine:3.18.4
FROM alpine:3.18.5
RUN apk update \
&& apk add --no-cache \
tzdata \
Expand Down
3 changes: 2 additions & 1 deletion api/ssi_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,15 @@ func Test_DIDDocumentMetadata(t *testing.T) {
}

func createVerifiableCredential() vcr.VerifiableCredential {
issuanceDate := time.Now()
return vcr.VerifiableCredential{
Context: []ssi.URI{ssi.MustParseURI("https://www.w3.org/2018/credentials/v1")},
Type: []ssi.URI{
ssi.MustParseURI("NutsOrganizationCredential"),
ssi.MustParseURI("VerifiableCredential"),
},
Issuer: ssi.MustParseURI("did:nuts:CuE3qeFGGLhEAS3gKzhMCeqd1dGa9at5JCbmCfyMU2Ey"),
IssuanceDate: time.Now(),
IssuanceDate: &issuanceDate,
CredentialSubject: []interface{}{"subject"},
Proof: []interface{}{"because"},
}
Expand Down
3 changes: 2 additions & 1 deletion auth/api/auth/v1/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,13 +489,14 @@ func TestWrapper_RequestAccessToken(t *testing.T) {
t.Run("happy_path", func(t *testing.T) {
ctx := createContext(t)

issuanceDate := time.Now()
credentials := []vc.VerifiableCredential{
{
Context: []ssi.URI{vc.VCContextV1URI(), credential.NutsV1ContextURI},
ID: &ssi.URI{},
Type: []ssi.URI{*credential.NutsAuthorizationCredentialTypeURI, vc.VerifiableCredentialTypeV1URI()},
Issuer: vdr.TestDIDA.URI(),
IssuanceDate: time.Now(),
IssuanceDate: &issuanceDate,
CredentialSubject: []interface{}{credential.NutsAuthorizationCredentialSubject{
ID: vdr.TestDIDB.String(),
PurposeOfUse: "eTransfer",
Expand Down
2 changes: 1 addition & 1 deletion auth/api/iam/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func TestWrapper_GetWebDID(t *testing.T) {
ID: webDID,
}
// remarshal expectedWebDIDDoc to make sure in-memory format is the same as the one returned by the API
data, _ := expectedWebDIDDoc.MarshalJSON()
data, _ := json.Marshal(expectedWebDIDDoc)
_ = expectedWebDIDDoc.UnmarshalJSON(data)

t.Run("ok", func(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions auth/services/oauth/relying_party_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func TestRelyingParty_RequestRFC021AccessToken(t *testing.T) {
})
t.Run("error - no matching credentials", func(t *testing.T) {
ctx := createOAuthRPContext(t)
ctx.wallet.EXPECT().List(gomock.Any(), walletDID).Return([]vcr.VerifiableCredential{}, nil)
ctx.wallet.EXPECT().List(gomock.Any(), walletDID).Return([]vc.VerifiableCredential{}, nil)

_, err := ctx.relyingParty.RequestRFC021AccessToken(context.Background(), walletDID, ctx.verifierDID, scopes)

Expand Down Expand Up @@ -257,12 +257,13 @@ func TestService_CreateJwtBearerToken(t *testing.T) {

id := vdr.TestDIDA.URI()
id.Fragment = "1"
issuanceDate := time.Now()
validCredential := vc.VerifiableCredential{
Context: []ssi.URI{vc.VCContextV1URI(), credential.NutsV1ContextURI},
ID: &id,
Type: []ssi.URI{*credential.NutsAuthorizationCredentialTypeURI, vc.VerifiableCredentialTypeV1URI()},
Issuer: vdr.TestDIDA.URI(),
IssuanceDate: time.Now(),
IssuanceDate: &issuanceDate,
CredentialSubject: []interface{}{credential.NutsAuthorizationCredentialSubject{
ID: vdr.TestDIDB.String(),
PurposeOfUse: "eTransfer",
Expand Down
2 changes: 1 addition & 1 deletion auth/services/selfsigned/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (v *signer) createVP(ctx context.Context, s types.Session, issuanceDate tim
Context: []ssi.URI{credential.NutsV1ContextURI},
Type: []ssi.URI{ssi.MustParseURI(credentialType)},
Issuer: issuerID.URI(),
IssuanceDate: issuanceDate,
IssuanceDate: &issuanceDate,
ExpirationDate: &expirationData,
CredentialSubject: s.CredentialSubject(),
}
Expand Down
5 changes: 5 additions & 0 deletions didman/didman.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,11 @@ func (d *didman) updateService(ctx context.Context, id did.DID, serviceType stri

func generateIDForService(id did.DID, service did.Service) ssi.URI {
bytes, _ := json.Marshal(service)
// go-did earlier unmarshaled/marshaled the service endpoint to a map[string]interface{} ("NormalizeDocument()"), which changes the order of the keys.
// To retain the same hash given as before go-did v0.10.0, we need to mimic this behavior.
var raw map[string]interface{}
_ = json.Unmarshal(bytes, &raw)
bytes, _ = json.Marshal(raw)
shaBytes := sha256.Sum256(bytes)
d := id.URI()
d.Fragment = base58.EncodeAlphabet(shaBytes[:], base58.BTCAlphabet)
Expand Down
5 changes: 3 additions & 2 deletions discovery/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ func createCredential(issuerDID did.DID, subjectDID did.DID, credentialSubject m
vcID := did.DIDURL{DID: issuerDID}
vcID.Fragment = uuid.NewString()
vcIDURI := vcID.URI()
expirationDate := time.Now().Add(time.Hour * 24)
issuanceDate := time.Now()
expirationDate := issuanceDate.Add(time.Hour * 24)
if credentialSubject == nil {
credentialSubject = make(map[string]interface{})
}
Expand All @@ -138,7 +139,7 @@ func createCredential(issuerDID did.DID, subjectDID did.DID, credentialSubject m
ID: &vcIDURI,
Type: []ssi.URI{ssi.MustParseURI("VerifiableCredential"), ssi.MustParseURI("TestCredential")},
Issuer: issuerDID.URI(),
IssuanceDate: time.Now(),
IssuanceDate: &issuanceDate,
ExpirationDate: &expirationDate,
CredentialSubject: []interface{}{credentialSubject},
}, func(ctx context.Context, claims map[string]interface{}, headers map[string]interface{}) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion docs/_static/vcr/vcr_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ paths:
post:
summary: Load a VerifiableCredential into the holders wallet.
description: |
If a VerifiableCredential is obtained in another way or when it's created without publishing, this API allows to add it to a wallet.
If a VerifiableCredential is not directly issued to the wallet through e.g. OpenID4VCI, this API allows to add it to a wallet.
The DID of the holder has to be provided in the path.
It's assumed that the credentialSubject.id equals the holder DID.
Expand Down
53 changes: 33 additions & 20 deletions docs/_static/vdr/v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,23 @@ paths:
post:
summary: Creates a new Web DID
description: |
A new web DID is created. Only the DID is returned. The DID document can be retrieved using the DID resolution endpoint.
A new web DID and DID Document are created.
A single key pair is generated and added to the DID document. The key pair is used for all verificationMethods.
No services are added. The PublicURL needs to be configured.
No services are added. If no ID is given, a random UUID is generated.
error returns:
* 412 - PublicURL is not configured
* 400 - Returned in case of malformed DID in the request body
* 500 - An error occurred while processing the request
operationId: "createDID"
tags:
- DID
requestBody:
description: Options for the DID creation.
required: false
content:
application/json:
schema:
$ref: '#/components/schemas/CreateDIDOptions'
responses:
"200":
description: "New DID has been created successfully. Returns the DID document."
Expand Down Expand Up @@ -62,7 +69,7 @@ paths:
default:
$ref: '../common/error_response.yaml'
delete:
summary: Deleted the web DID Document.
summary: Deletes a locally managed Document.
description: |
error returns:
Expand All @@ -89,28 +96,29 @@ paths:
post:
summary: Adds a service to the DID document.
description: |
It adds the given service to the DID Document. The ID will be generated and replaced.
It adds the given service to the DID Document. The ID will be generated when not given.
error returns:
* 400 - Returned in case of malformed DID or service
* 404 - Corresponding DID document could not be found
* 500 - An error occurred while processing the request
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Service'
parameters:
- name: service
in: body
description: Service to be added to the DID document.
required: true
schema:
$ref: '#/components/schemas/Service'
operationId: addService
tags:
- DID
responses:
"200":
description: "New verification method has been created and added successfully. Returns the verification method."
description: "New service has been added successfully. Returns the service."
content:
application/json:
schema:
$ref: '#/components/schemas/Service'
$ref: '#/components/schemas/VerificationMethod'
default:
$ref: '../common/error_response.yaml'
/internal/vdr/v2/did/{did}/service/{id}:
Expand Down Expand Up @@ -143,13 +151,13 @@ paths:
operationId: deleteService
responses:
"204":
description: Verification Method was successfully deleted
description: The service was successfully deleted
default:
$ref: '../common/error_response.yaml'
put:
summary: Updates a service in the DID document.
description: |
It updates the given service in the DID Document. The ID will remain the same.
It updates the given service in the DID Document.
error returns:
* 400 - Returned in case of malformed DID or service
Expand Down Expand Up @@ -204,7 +212,7 @@ paths:
$ref: '#/components/schemas/VerificationMethod'
default:
$ref: '../common/error_response.yaml'
/internal/vdr/v2/did/{did}/verificationmethod/{kid}:
/internal/vdr/v2/did/{did}/verificationmethod/{id}:
parameters:
- name: did
in: path
Expand All @@ -213,9 +221,9 @@ paths:
example: did:web:example.com:iam:013c6fda-73e8-45ee-9220-48652dba854b
schema:
type: string
- name: kid
- name: id
in: path
description: URL encoded kid identifying the verification method.
description: URL encoded ID identifying the verification method.
required: true
example: "did:web:example.com:iam:013c6fda-73e8-45ee-9220-48652dba854b#3106f751-59e3-440f-b57b-39a96a2da6c6"
schema:
Expand All @@ -224,8 +232,6 @@ paths:
summary: Delete a specific verification method
description: |
Removes the verification method from the DID Document.
Revokes the public key with the corresponding key-id.
Note: Other verification methods with different key-ids with the same private key will still be valid.
error returns:
* 404 - Corresponding DID document or verification method could not be found
Expand All @@ -240,6 +246,13 @@ paths:
$ref: '../common/error_response.yaml'
components:
schemas:
CreateDIDOptions:
type: object
properties:
id:
type: string
description: The ID of the DID document. If not given, a random UUID is generated.
example: "did:web:example.com:iam:013c6fda-73e8-45ee-9220-48652dba854b"
DIDDocument:
$ref: '../common/ssi_types.yaml#/components/schemas/DIDDocument'
DIDDocumentMetadata:
Expand Down
9 changes: 4 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ require (
github.com/jinzhu/now v1.1.5 // indirect
github.com/knadh/koanf v1.5.0
github.com/labstack/echo/v4 v4.11.3
github.com/lestrrat-go/jwx/v2 v2.0.17
github.com/lestrrat-go/jwx/v2 v2.0.18
github.com/magiconair/properties v1.8.7
github.com/mdp/qrterminal/v3 v3.2.0
github.com/mr-tron/base58 v1.2.0
github.com/multiformats/go-multicodec v0.9.0
github.com/nats-io/nats-server/v2 v2.10.5
github.com/nats-io/nats-server/v2 v2.10.6
github.com/nats-io/nats.go v1.31.0
github.com/nuts-foundation/crypto-ecies v0.0.0-20211207143025-5b84f9efce2b
github.com/nuts-foundation/go-did v0.9.0
github.com/nuts-foundation/go-did v0.11.0
github.com/nuts-foundation/go-leia/v4 v4.0.1
github.com/nuts-foundation/go-stoabs v1.9.0
// check the oapi-codegen tool version in the makefile when upgrading the runtime
Expand Down Expand Up @@ -106,9 +106,8 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jinzhu/gorm v1.9.16 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.17.2 // indirect
github.com/klauspost/compress v1.17.3 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/labstack/gommon v0.4.0 // indirect
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
Expand Down
19 changes: 8 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4=
github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA=
github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs=
github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
Expand Down Expand Up @@ -349,8 +349,8 @@ github.com/lestrrat-go/httprc v1.0.4 h1:bAZymwoZQb+Oq8MEbyipag7iSq6YIga8Wj6GOiJG
github.com/lestrrat-go/httprc v1.0.4/go.mod h1:mwwz3JMTPBjHUkkDv/IGJ39aALInZLrhBp0X7KGUZlo=
github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI=
github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4=
github.com/lestrrat-go/jwx/v2 v2.0.17 h1:+WavkdKVWO90ECnIzUetOnjY+kcqqw4WXEUmil7sMCE=
github.com/lestrrat-go/jwx/v2 v2.0.17/go.mod h1:G8randPHLGAqhcNCqtt6/V/7E6fvJRl3Sf9z777eTQ0=
github.com/lestrrat-go/jwx/v2 v2.0.18 h1:HHZkYS5wWDDyAiNBwztEtDoX07WDhGEdixm8G06R50o=
github.com/lestrrat-go/jwx/v2 v2.0.18/go.mod h1:fAJ+k5eTgKdDqanzCuK6DAt3W7n3cs2/FX7JhQdk83U=
github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNBEYU=
github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
Expand Down Expand Up @@ -435,8 +435,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nats-io/jwt/v2 v2.5.3 h1:/9SWvzc6hTfamcgXJ3uYRpgj+QuY2aLNqRiqrKcrpEo=
github.com/nats-io/jwt/v2 v2.5.3/go.mod h1:iysuPemFcc7p4IoYots3IuELSI4EDe9Y0bQMe+I3Bf4=
github.com/nats-io/nats-server/v2 v2.10.5 h1:hhWt6m9ja/mNnm6ixc85jCthDaiUFPaeJI79K/MD980=
github.com/nats-io/nats-server/v2 v2.10.5/go.mod h1:xUMTU4kS//SDkJCSvFwN9SyJ9nUuLhSkzB/Qz0dvjjg=
github.com/nats-io/nats-server/v2 v2.10.6 h1:40U3ngyAKyC1tNT4Kw7PjuvivY74NTYD3qyIHxZUHKQ=
github.com/nats-io/nats-server/v2 v2.10.6/go.mod h1:IrTXS8o4Roa3G2kW8L5mEtSdmSrFjKhYb/m2g0gQ/vc=
github.com/nats-io/nats.go v1.31.0 h1:/WFBHEc/dOKBF6qf1TZhrdEfTmOZ5JzdJ+Y3m6Y/p7E=
github.com/nats-io/nats.go v1.31.0/go.mod h1:di3Bm5MLsoB4Bx61CBTsxuarI36WbhAwOm8QrW39+i8=
github.com/nats-io/nkeys v0.4.6 h1:IzVe95ru2CT6ta874rt9saQRkWfe2nFj1NtvYSLqMzY=
Expand All @@ -448,8 +448,8 @@ github.com/nightlyone/lockfile v1.0.0/go.mod h1:rywoIealpdNse2r832aiD9jRk8ErCatR
github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk=
github.com/nuts-foundation/crypto-ecies v0.0.0-20211207143025-5b84f9efce2b h1:80icUxWHwE1MrIOOEK5rxrtyKOgZeq5Iu1IjAEkggTY=
github.com/nuts-foundation/crypto-ecies v0.0.0-20211207143025-5b84f9efce2b/go.mod h1:6YUioYirD6/8IahZkoS4Ypc8xbeJW76Xdk1QKcziNTM=
github.com/nuts-foundation/go-did v0.9.0 h1:JBz1cYaMxplKZ31QyWierrR3Yt2RIpaxZTt8KFm4Ph4=
github.com/nuts-foundation/go-did v0.9.0/go.mod h1:L39mh6SBsuenqeZw2JxARx4a/bwdARwchG2x3zPMTjc=
github.com/nuts-foundation/go-did v0.11.0 h1:RTem1MlVoOOoLa/Y2miYRy70Jex0/kJBTCPH5RtUmrY=
github.com/nuts-foundation/go-did v0.11.0/go.mod h1:2e2H2Hqk0SWrrGZEg97dbK/ZFIkkFB65hNWdOSbylrg=
github.com/nuts-foundation/go-leia/v4 v4.0.1 h1:+Sbk3Bew1QnRUqRXSOwomMw3nIZgncmTX425J7U5Q34=
github.com/nuts-foundation/go-leia/v4 v4.0.1/go.mod h1:eaZuWIolpU61TMvTMcen85+SOEOnHiALdg5SxqLXzz8=
github.com/nuts-foundation/go-stoabs v1.9.0 h1:zK+ugfolaJYyBvGwsRuavLVdycXk4Yw/1gI+tz17lWQ=
Expand Down Expand Up @@ -639,7 +639,6 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -753,14 +752,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww=
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
1 change: 0 additions & 1 deletion vcr/api/vcr/v2/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ func (w *Wrapper) LoadVC(ctx context.Context, request LoadVCRequestObject) (Load
if err != nil {
return nil, core.InvalidInputError("invalid holder did: %w", err)
}
// VCs can only be added to the wallet of the credentialSubject.ID
if request.Body == nil {
return nil, core.InvalidInputError("missing credential in body")
}
Expand Down
7 changes: 4 additions & 3 deletions vcr/api/vcr/v2/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ func Test_Marshalling(t *testing.T) {
assert.IsType(t, make(map[string]interface{}, 0), result["credentialSubject"]) // single entry should not end up as slice
})
t.Run("CreateVP200JSONResponse", func(t *testing.T) {
r := CreateVP200JSONResponse{
issuanceDate := time.Now()
r := CreateVP200JSONResponse(VerifiablePresentation{
VerifiableCredential: []VerifiableCredential{
{
IssuanceDate: time.Now(),
IssuanceDate: &issuanceDate,
},
},
}
})
data, _ := json.Marshal(r)
result := make(map[string]interface{}, 0)
err := json.Unmarshal(data, &result)
Expand Down
Loading

0 comments on commit d90181a

Please sign in to comment.