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

feat: Self Attested Claims (VCs) - id_token & custom scope #1505

Conversation

mishasizov-SK
Copy link
Contributor

No description provided.

@cla-bot cla-bot bot added the cla-signed label Oct 31, 2023
Copy link

codecov bot commented Oct 31, 2023

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (31c00a5) 85.22% compared to head (b97098f) 85.22%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1505   +/-   ##
=======================================
  Coverage   85.22%   85.22%           
=======================================
  Files         166      166           
  Lines       10596    10643   +47     
=======================================
+ Hits         9030     9071   +41     
- Misses       1136     1139    +3     
- Partials      430      433    +3     
Files Coverage Δ
pkg/kms/aws/service_mocks.go 77.84% <ø> (ø)
...bility/tracing/wrappers/oidc4vp/oidc4vp_wrapper.go 89.74% <100.00%> (+0.26%) ⬆️
pkg/service/oidc4vp/oidc4vp_service.go 86.25% <100.00%> (+0.58%) ⬆️
pkg/service/oidc4vp/txmanager.go 89.70% <100.00%> (ø)
...storage/mongodb/oidc4vptxstore/oidc4vp_tx_store.go 90.21% <100.00%> (+0.21%) ⬆️
pkg/storage/redis/oidc4vptxstore/doc.go 50.00% <ø> (ø)
...g/storage/redis/oidc4vptxstore/oidc4vp_tx_store.go 81.96% <100.00%> (+0.61%) ⬆️
cmd/vc-rest/startcmd/start.go 80.17% <50.00%> (ø)
pkg/restapi/v1/verifier/controller.go 91.25% <90.90%> (-0.27%) ⬇️
pkg/service/oidc4vp/claims.go 83.05% <71.42%> (-3.62%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -602,6 +603,21 @@ func (f *Flow) createIDToken(
return idTokenJSON, nil
}

func (f *Flow) extractAdditionalClaims(requestObjectScope string) map[string]Claims {
Copy link
Contributor Author

@mishasizov-SK mishasizov-SK Oct 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, for the testing purpose wallet-cli returns random claims and does not considers custom scope value.
CC: @sudeshrshetty @vkubiv

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mishasizov-SK What do you mean by random? Any?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vkubiv as aligned with @sudeshrshetty.
This logic will be extended/changed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what you mean, you can pre-configure wallet CLI with pre-defined "scope:claim", and ask the exact scope while testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sudeshrshetty updated

Comment on lines +400 to +405
// If custom scope was requested, but no relevant additional claims were supplied by Holder.
noAdditionalClaims := tx.CustomScope != "" && len(authResponse.CustomScopeClaims[tx.CustomScope]) == 0
// If custom scope was not requested, but additional claims were supplied by Holder.
unexpectedAdditionalClaims := tx.CustomScope == "" && len(authResponse.CustomScopeClaims) != 0

Copy link
Contributor Author

@mishasizov-SK mishasizov-SK Oct 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verifier checks if additional claims supplied for given scope.

@mishasizov-SK mishasizov-SK force-pushed the feat_OID4VP_Requesting_custom_claim_from_holder_in_addition_to_vp_token branch 2 times, most recently from c3b6801 to 7ad1fae Compare October 31, 2023 16:31
Signed-off-by: Mykhailo Sizov <mykhailo.sizov@securekey.com>
@mishasizov-SK mishasizov-SK force-pushed the feat_OID4VP_Requesting_custom_claim_from_holder_in_addition_to_vp_token branch from 7ad1fae to b97098f Compare November 1, 2023 16:03
@fqutishat fqutishat merged commit c5a7654 into trustbloc:main Nov 1, 2023
@mishasizov-SK mishasizov-SK deleted the feat_OID4VP_Requesting_custom_claim_from_holder_in_addition_to_vp_token branch November 6, 2023 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants