diff --git a/e2e-tests/browser/openid4vp_employeecredential/main_test.go b/e2e-tests/browser/openid4vp_employeecredential/main_test.go index 4fec1373fb..712b487f64 100644 --- a/e2e-tests/browser/openid4vp_employeecredential/main_test.go +++ b/e2e-tests/browser/openid4vp_employeecredential/main_test.go @@ -108,7 +108,7 @@ func Test_UserAccessToken_EmployeeCredential(t *testing.T) { func setupNode(t testing.TB, ctx context.Context, config core.ClientConfig) (string, did.DID, OpenID4VP) { subject, didDoc, err := createDID(config) require.NoError(t, err) - err = browser.IssueOrganizationCredential(didDoc, fmt.Sprintf("%s Organization", didDoc.ID.String()), "Testland", config) + err = browser.IssueOrganizationCredential(subject, didDoc, fmt.Sprintf("%s Organization", didDoc.ID.String()), "Testland", config) require.NoError(t, err) iamClientB, err := iamAPI.NewClient(config.GetAddress()) diff --git a/e2e-tests/browser/rfc019_selfsigned/main_test.go b/e2e-tests/browser/rfc019_selfsigned/main_test.go index 74d16e3528..4e7b436e0c 100644 --- a/e2e-tests/browser/rfc019_selfsigned/main_test.go +++ b/e2e-tests/browser/rfc019_selfsigned/main_test.go @@ -52,14 +52,14 @@ func Test_LoginWithSelfSignedMeans(t *testing.T) { require.NoError(t, err) err = registerCompoundService(verifyingOrganization.ID, purposeOfUse) require.NoError(t, err) - err = browser.IssueOrganizationCredential(verifyingOrganization, "Verifying Organization", "Testland", apps.NodeClientConfig) + err = browser.IssueOrganizationCredential("", verifyingOrganization, "Verifying Organization", "Testland", apps.NodeClientConfig) require.NoError(t, err) issuingOrganization, err := createDID() require.NoError(t, err) err = registerCompoundService(issuingOrganization.ID, purposeOfUse) require.NoError(t, err) - err = browser.IssueOrganizationCredential(issuingOrganization, "Issuing Organization", "Testland", apps.NodeClientConfig) + err = browser.IssueOrganizationCredential("", issuingOrganization, "Issuing Organization", "Testland", apps.NodeClientConfig) require.NoError(t, err) selfSigned := apps.SelfSigned{ diff --git a/e2e-tests/browser/util.go b/e2e-tests/browser/util.go index e45147d6e4..cdb338ad73 100644 --- a/e2e-tests/browser/util.go +++ b/e2e-tests/browser/util.go @@ -26,7 +26,7 @@ import ( vcrAPI "github.com/nuts-foundation/nuts-node/vcr/api/vcr/v2" ) -func IssueOrganizationCredential(organization *did.Document, name, city string, clientConfig core.ClientConfig) error { +func IssueOrganizationCredential(subject string, organization *did.Document, name, city string, clientConfig core.ClientConfig) error { vcrClient := vcrAPI.HTTPClient{ClientConfig: clientConfig} request := vcrAPI.IssueVCRequest{ Issuer: organization.ID.String(), @@ -56,7 +56,7 @@ func IssueOrganizationCredential(organization *did.Document, name, city string, } if organization.ID.Method == "web" { // Need to load it into tbe wallet - return vcrClient.LoadVC(organization.ID, *issuedCredential) + return vcrClient.LoadVC(subject, *issuedCredential) } return nil } diff --git a/e2e-tests/discovery/run-test.sh b/e2e-tests/discovery/run-test.sh index 5e398d99ca..3f721a9a41 100755 --- a/e2e-tests/discovery/run-test.sh +++ b/e2e-tests/discovery/run-test.sh @@ -36,7 +36,7 @@ else exitWithDockerLogs 1 fi -RESPONSE=$(echo $RESPONSE | curl --insecure -s -X POST --data-binary @- http://localhost:28081/internal/vcr/v2/holder/${DID}/vc -H "Content-Type:application/json") +RESPONSE=$(echo $RESPONSE | curl --insecure -s -X POST --data-binary @- http://localhost:28081/internal/vcr/v2/holder/${SUBJECT}/vc -H "Content-Type:application/json") if [[ $RESPONSE -eq "" ]]; then echo "VC stored in wallet" else diff --git a/e2e-tests/oauth-flow/openid4vp/do-test.sh b/e2e-tests/oauth-flow/openid4vp/do-test.sh index 765e306fdb..db68dc0115 100755 --- a/e2e-tests/oauth-flow/openid4vp/do-test.sh +++ b/e2e-tests/oauth-flow/openid4vp/do-test.sh @@ -33,7 +33,7 @@ else exitWithDockerLogs 1 fi -RESPONSE=$(echo $RESPONSE | curl -X POST --data-binary @- http://localhost:28081/internal/vcr/v2/holder/${PARTY_B_DID}/vc -H "Content-Type:application/json") +RESPONSE=$(echo $RESPONSE | curl -X POST --data-binary @- http://localhost:28081/internal/vcr/v2/holder/subjectB/vc -H "Content-Type:application/json") if echo $RESPONSE == ""; then echo "VC stored in wallet" else diff --git a/e2e-tests/oauth-flow/rfc021/do-test.sh b/e2e-tests/oauth-flow/rfc021/do-test.sh index 538d4ef108..05214337ba 100755 --- a/e2e-tests/oauth-flow/rfc021/do-test.sh +++ b/e2e-tests/oauth-flow/rfc021/do-test.sh @@ -54,7 +54,7 @@ else exitWithDockerLogs 1 fi -RESPONSE=$(echo $RESPONSE | curl -X POST --data-binary @- http://localhost:28081/internal/vcr/v2/holder/${VENDOR_B_DID}/vc -H "Content-Type:application/json") +RESPONSE=$(echo $RESPONSE | curl -X POST --data-binary @- http://localhost:28081/internal/vcr/v2/holder/vendorB/vc -H "Content-Type:application/json") if echo $RESPONSE == ""; then echo "VC stored in wallet" else diff --git a/vcr/api/vcr/v2/client.go b/vcr/api/vcr/v2/client.go index db0676a6d2..bb77afb380 100644 --- a/vcr/api/vcr/v2/client.go +++ b/vcr/api/vcr/v2/client.go @@ -23,7 +23,6 @@ import ( "context" "encoding/json" "fmt" - "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/core" "io" @@ -93,10 +92,10 @@ func (hb HTTPClient) Untrusted(credentialType string) ([]string, error) { } // LoadVC loads the given Verifiable Credential into the holder's wallet. -func (hb HTTPClient) LoadVC(holder did.DID, credential vc.VerifiableCredential) error { +func (hb HTTPClient) LoadVC(holderSubjectID string, credential vc.VerifiableCredential) error { ctx := context.Background() - httpResponse, err := hb.client().LoadVC(ctx, holder.String(), credential) + httpResponse, err := hb.client().LoadVC(ctx, holderSubjectID, credential) if err != nil { return err } else if err := core.TestResponseCode(http.StatusNoContent, httpResponse); err != nil {