Skip to content

Commit

Permalink
fix: avoid sending null scope (#632)
Browse files Browse the repository at this point in the history
  • Loading branch information
javip97 authored Apr 12, 2024
1 parent a449cb1 commit 9ffae93
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/api_ui/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func TestServer_AuthQRCode(t *testing.T) {
Body: protocol.AuthorizationRequestMessageBody{
CallbackURL: "https://testing.env/v1/authentication/callback?sessionID=",
Reason: "authentication",
Scope: nil,
Scope: make([]protocol.ZeroKnowledgeProofRequest, 0),
},
From: issuerDID.String(),
Typ: "application/iden3comm-plain-json",
Expand All @@ -278,7 +278,7 @@ func TestServer_AuthQRCode(t *testing.T) {
Body: protocol.AuthorizationRequestMessageBody{
CallbackURL: "https://testing.env/v1/authentication/callback?sessionID=",
Reason: "authentication",
Scope: nil,
Scope: make([]protocol.ZeroKnowledgeProofRequest, 0),
},
From: issuerDID.String(),
Typ: "application/iden3comm-plain-json",
Expand All @@ -296,7 +296,7 @@ func TestServer_AuthQRCode(t *testing.T) {
Body: protocol.AuthorizationRequestMessageBody{
CallbackURL: "https://testing.env/v1/authentication/callback?sessionID=",
Reason: "authentication",
Scope: nil,
Scope: make([]protocol.ZeroKnowledgeProofRequest, 0),
},
From: issuerDID.String(),
Typ: "application/iden3comm-plain-json",
Expand Down
1 change: 1 addition & 0 deletions internal/core/services/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ func (i *identity) CreateAuthenticationQRCode(ctx context.Context, serverURL str
Body: protocol.AuthorizationRequestMessageBody{
CallbackURL: fmt.Sprintf("%s/v1/authentication/callback?sessionID=%s", serverURL, sessionID),
Reason: authReason,
Scope: make([]protocol.ZeroKnowledgeProofRequest, 0),
},
}
if err := i.sessionManager.Set(ctx, sessionID.String(), *qrCode); err != nil {
Expand Down
1 change: 1 addition & 0 deletions internal/core/services/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ func (ls *Link) CreateQRCode(ctx context.Context, issuerDID w3c.DID, linkID uuid
Body: protocol.AuthorizationRequestMessageBody{
CallbackURL: fmt.Sprintf("%s/v1/credentials/links/callback?sessionID=%s&linkID=%s", serverURL, sessionID, linkID.String()),
Reason: authReason,
Scope: make([]protocol.ZeroKnowledgeProofRequest, 0),
},
}

Expand Down

0 comments on commit 9ffae93

Please sign in to comment.