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

For Credential Application processing, handle JWT and Data Integrity Creds #238

Merged
merged 3 commits into from
Oct 19, 2022

Conversation

decentralgabe
Copy link
Member

No description provided.

@@ -322,6 +323,36 @@ func IsValidCredentialApplicationForManifest(cm CredentialManifest, applicationA
return nil
}

// turn a generic cred into a known shape without maintaining the proof/signature wrapper
func credentialsFromInterface(genericCred interface{}) (*credential.VerifiableCredential, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

awesome, like if we want to refactor one day, this function can be used at the very first line in the service.

The service input gives us 'something' we instantly take that something and turn it into a *credential.VerifiableCredential. We can do this for all objects that can take different forms

Copy link
Contributor

Choose a reason for hiding this comment

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

so maybe make it capital CredentialsFromInterface because I have a feeling we will use this somewhere else

Copy link
Member Author

Choose a reason for hiding this comment

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

agreed...there is more refactoring to do here and moving a number of things from the service here

Copy link
Member Author

Choose a reason for hiding this comment

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

moving to a new pkg in credentials called util to avoid import cycles

@decentralgabe
Copy link
Member Author

added tests

@decentralgabe decentralgabe merged commit 4b326c0 into main Oct 19, 2022
@decentralgabe decentralgabe deleted the cred-from-jwt branch October 19, 2022 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants