-
Notifications
You must be signed in to change notification settings - Fork 55
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
Presentation Exchange: support for json schema filtering and relational constraints #351
Conversation
Codecov Report
@@ Coverage Diff @@
## main #351 +/- ##
==========================================
+ Coverage 57.31% 57.38% +0.07%
==========================================
Files 51 51
Lines 6339 6410 +71
==========================================
+ Hits 3633 3678 +45
- Misses 2017 2032 +15
- Partials 689 700 +11
|
// CredentialsFromInterface turn a generic cred into a known shape without maintaining the proof/signature wrapper | ||
func CredentialsFromInterface(genericCred any) (*credential.VerifiableCredential, error) { | ||
// ToCredential turn a generic cred into its known object model | ||
func ToCredential(genericCred any) (*credential.VerifiableCredential, error) { |
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.
@nitro-neal refactored this method and the one below to handle jwt/json properly to fix #165
// CredentialsFromInterface turn a generic cred into a known shape without maintaining the proof/signature wrapper | ||
func CredentialsFromInterface(genericCred any) (*credential.VerifiableCredential, error) { | ||
// ToCredential turn a generic cred into its known object model | ||
func ToCredential(genericCred any) (*credential.VerifiableCredential, error) { |
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.
This is awesome, almost need this as a standard for every object.
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.
Awesome stuff
func ClaimAsJSON(claim any) (map[string]any, error) { | ||
switch c := claim.(type) { | ||
// ToCredentialJSONMap turn a generic cred into a JSON object | ||
func ToCredentialJSONMap(genericCred any) (map[string]any, error) { |
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.
Alternativly we could make this private and then the master ToCredential funciton will have the signature:
func ToCredential(genericCred any) (*credential.VerifiableCredential, map[string]any, jwt.Token, error) {
One func to rule them all
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.
I had it like this at first but figured it was cleaner to have each func do a single thing
fixes #350, #165, and partially #64