From bcae7aafc08325f299231bc18a2fe6b19fb0e12c Mon Sep 17 00:00:00 2001 From: Rein Krul Date: Sun, 12 Nov 2023 14:12:31 +0100 Subject: [PATCH] fixes after merge with master --- storage/config.go | 4 ---- usecase/maintainer_test.go | 10 +++++----- vcr/credential/resolver.go | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/storage/config.go b/storage/config.go index 44f57aa22c..0804d98a89 100644 --- a/storage/config.go +++ b/storage/config.go @@ -34,10 +34,6 @@ func DefaultConfig() Config { } } -type SQLConfig struct { - ConnectionString string `koanf:"connection"` -} - // SQLConfig specifies config for the SQL storage engine. type SQLConfig struct { // ConnectionString is the connection string for the SQL database. diff --git a/usecase/maintainer_test.go b/usecase/maintainer_test.go index bb8a55e068..04f2a69540 100644 --- a/usecase/maintainer_test.go +++ b/usecase/maintainer_test.go @@ -280,7 +280,7 @@ func Test_maintainer_delete(t *testing.T) { func setupMaintainer(t *testing.T, storageInstance storage.Engine) *maintainer { t.Cleanup(func() { - underlyingDB, err := storageInstance.SQLDatabase().DB() + underlyingDB, err := storageInstance.GetSQLDatabase().DB() require.NoError(t, err) _, err = underlyingDB.Exec("DELETE FROM usecaselist_presentations") require.NoError(t, err) @@ -292,7 +292,7 @@ func setupMaintainer(t *testing.T, storageInstance storage.Engine) *maintainer { for k, v := range testDefinitions { testDefinitionsCopy[k] = v } - m, err := newMaintainer(storageInstance.SQLDatabase(), testDefinitionsCopy) + m, err := newMaintainer(storageInstance.GetSQLDatabase(), testDefinitionsCopy) require.NoError(t, err) return m } @@ -304,7 +304,7 @@ func createCredential(issuerDID did.DID, subjectDID did.DID) vc.VerifiableCreden } func createCredentialWithClaims(issuerDID did.DID, subjectDID did.DID, claimVisitor func(map[string]interface{})) vc.VerifiableCredential { - vcID := issuerDID + vcID := did.DIDURL{DID: issuerDID} vcID.Fragment = uuid.NewString() vcIDURI := vcID.URI() expirationDate := time.Now().Add(time.Hour * 24) @@ -341,7 +341,7 @@ func createPresentationWithClaims(subjectDID did.DID, claimVisitor func(map[stri claims := map[string]interface{}{ jwt.IssuerKey: subjectDID.String(), jwt.SubjectKey: subjectDID.String(), - jwt.JwtIDKey: subjectDID.WithoutURL().String() + "#" + uuid.NewString(), + jwt.JwtIDKey: subjectDID.String() + "#" + uuid.NewString(), "vp": vc.VerifiablePresentation{ Type: append([]ssi.URI{ssi.MustParseURI("VerifiablePresentation")}), VerifiableCredential: credentials, @@ -371,7 +371,7 @@ func signJWT(subjectDID did.DID, claims map[string]interface{}, headers map[stri if err != nil { return "", nil } - keyID := subjectDID + keyID := did.DIDURL{DID: subjectDID} keyID.Fragment = "0" if err := subjectKeyJWK.Set(jwk.AlgorithmKey, jwa.ES256); err != nil { return "", err diff --git a/vcr/credential/resolver.go b/vcr/credential/resolver.go index 7557ddc65c..5267a3b4f9 100644 --- a/vcr/credential/resolver.go +++ b/vcr/credential/resolver.go @@ -70,7 +70,7 @@ func PresentationSigner(presentation vc.VerifiablePresentation) (*did.DID, error } } -func PresentationSigningKeyID(presentation vc.VerifiablePresentation) (*did.DID, error) { +func PresentationSigningKeyID(presentation vc.VerifiablePresentation) (*did.DIDURL, error) { switch presentation.Format() { case vc.JWTPresentationProofFormat: token := presentation.JWT()