Skip to content
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

Feature/pid 1123 #63

Merged
merged 31 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
723cc33
import verifier from go-circuits branch
volodymyr-basiuk Oct 30, 2023
6352f63
RegisterVerifier V3 & add unit test
volodymyr-basiuk Oct 30, 2023
f520206
add MPT V3 test
volodymyr-basiuk Oct 31, 2023
b9af7ca
update proofs V3 with verifier ID check
volodymyr-basiuk Nov 1, 2023
97ee431
undo "move verifier to go-circuits"
volodymyr-basiuk Nov 2, 2023
ca775ad
fix linter
volodymyr-basiuk Nov 2, 2023
cd52bf1
update to lates V3 (1/2 prooftype, IssuerState)
volodymyr-basiuk Nov 10, 2023
73511be
add core dep to registration commit
vmidyllic Nov 30, 2023
3121826
Merge branch 'main' into feature/pid-1123
vmidyllic Nov 30, 2023
8e1f3fe
Update go-iden3-core to the latest changes
Kolezhniuk Nov 30, 2023
ba59985
rework verifier id
vmidyllic Dec 1, 2023
057d18a
Merge remote-tracking branch 'origin/feature/pid-1123' into feature/p…
vmidyllic Dec 1, 2023
f925a5f
update core
vmidyllic Dec 1, 2023
20dfea5
move V3 specific checks from general query
volodymyr-basiuk Dec 4, 2023
abf51e8
do not reset VerifierDID in opts
volodymyr-basiuk Dec 4, 2023
ffa0c2d
rename verifierSessionID to nullifierSessionID
volodymyr-basiuk Dec 6, 2023
2389dca
fix linter
volodymyr-basiuk Dec 6, 2023
bb715a1
update v3 key & proof
volodymyr-basiuk Dec 13, 2023
2538369
add circuits params
vmidyllic Dec 15, 2023
41daf9f
rename group id
vmidyllic Dec 15, 2023
db675cc
fix
vmidyllic Dec 15, 2023
f2a45f3
remove check
vmidyllic Dec 15, 2023
ab7609b
fix typo
Kolezhniuk Dec 15, 2023
8abcf1e
fix
vmidyllic Dec 15, 2023
bc2f72c
fix validateDisclosure for v3 circuit (#66)
volodymyr-basiuk Dec 19, 2023
d633e39
fix check
vmidyllic Dec 19, 2023
690233f
fix test
vmidyllic Jan 4, 2024
66af1e7
update go-circuits (v3 renamed to beta)
volodymyr-basiuk Jan 4, 2024
54ab015
rename v3 testdata file with new circuit name
volodymyr-basiuk Jan 4, 2024
5db6962
upgrade dep
vmidyllic Jan 4, 2024
64ac62f
remove cfg
vmidyllic Jan 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/iden3/go-iden3-auth/v2/proofs"
"github.com/iden3/go-iden3-auth/v2/pubsignals"
"github.com/iden3/go-iden3-auth/v2/state"
"github.com/iden3/go-iden3-core/v2/w3c"
"github.com/iden3/go-jwz/v2"
schemaloaders "github.com/iden3/go-schema-processor/v2/loaders"
"github.com/iden3/go-schema-processor/v2/merklize"
Expand Down Expand Up @@ -321,6 +322,10 @@ func (v *Verifier) VerifyAuthResponse(
return errors.Errorf("message for request id %v was not presented in the response", request.ID)
}

if request.From != response.To {
return errors.Errorf("sender of the request is not a target of response - expected %s, given %s", request.From, response.To)
}

for _, proofRequest := range request.Body.Scope {
proofResponse := findProofByRequestID(response.Body.Scope, proofRequest.ID)
if proofResponse == nil {
Expand Down Expand Up @@ -370,7 +375,16 @@ func (v *Verifier) VerifyAuthResponse(
rawMessage = nil
}

err = cv.VerifyQuery(ctx, query, v.documentLoader, rawMessage, opts...)
if proofRequest.Params == nil {
proofRequest.Params = make(map[string]interface{})
}
verifierDID, err := w3c.ParseDID(request.From) // TODO: this is assuming that response.TO is always DID.
if err != nil {
return err
}
proofRequest.Params[pubsignals.ParamNameVerifierDID] = verifierDID

err = cv.VerifyQuery(ctx, query, v.documentLoader, rawMessage, proofRequest.Params, opts...)
if err != nil {
return err
}
Expand All @@ -379,6 +393,7 @@ func (v *Verifier) VerifyAuthResponse(
if err != nil {
return err
}

}

return nil
Expand Down
Loading
Loading