-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add Presentation Definition and use test vectors #192
Conversation
} | ||
|
||
impl InputDescriptor { | ||
pub fn select_credentials(&self, vc_jwts: &Vec<String>) -> Result<Vec<String>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol pex is so hard, can you give some documentation on the overall algorithm here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure. I'll also clean up the code a bit. I'm not good at making things readable in rust yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. If it's still hard to read, let me know and I'll take another pass :)
pub path: &'a String, | ||
} | ||
|
||
impl InputDescriptor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the other libs we have
PresentationExchange.select_credentials
PresentationExchange.createPresentationFromCredentials
...
Was the plan to keep it similar or are there other api design changes in the pipeline?
https://github.com/TBD54566975/web5-js/tree/main/packages/credentials#presentationexchange
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The priority for now (keep me honest @frankhinek @mistermoe) is only select_credentials
since that is needed for TBDex but createPresentationFromCredentials
is not. Instead of using Presentation Submissions in TBDex RFQ messages, we submit a list of claims in the Rfq.data.required_claims
field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it works it works! My understanding of the rust language is still rusty
😃
but this works by
- doing some preprocessing creating a token mapping for each field
- you do processing on each element in the jwt payload and see if it matches?
- then do the jsonpath and if it matches then it is successful
something like that right?
the algorithm compiles an
once an ID is compiled into ^, the tokenized fields are iterated through to build a |
Copy algorithm for
selectCredentials
laid out here decentralized-identity/web5-go#143.Use web5-spec submodule to get test vectors. As we use test vectors more, we'll want to establish a common pattern and DRY up the code.