Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Schema Signing & Verification #123

Merged
merged 9 commits into from
Oct 11, 2022

Conversation

decentralgabe
Copy link
Member

  • schema signing, verification functionality + APIs
  • added delete schema apis
  • tests for all
  • not yet integrated into credential creation code

@@ -0,0 +1,108 @@
package keyaccess
Copy link
Member Author

Choose a reason for hiding this comment

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

moved this to its own package, since it has use outside of just cred verification

@decentralgabe decentralgabe marked this pull request as ready for review October 11, 2022 00:05
@@ -87,8 +87,15 @@ func (dr DIDRouter) CreateDIDByMethod(ctx context.Context, w http.ResponseWriter
}

var request CreateDIDByMethodRequest
invalidCreateDIDRequest := "invalid create DID request"
if err := framework.Decode(r, &request); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

alternativly you could do

if framework.Decode(r, &request) != nil || framework.ValidateRequest(request) != nil {
errMsg := invalidCreateDIDRequest
logrus.WithError(err).Error(errMsg)
return framework.NewRequestError(errors.Wrap(err, errMsg), http.StatusBadRequest)
}

since its the same output (but you need to get err variable in a golang way somehow lol maybe not possible)

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, unfortunately this wouldn't work because both return unique errors and we couldn't capture both. conditional error assignment would be a nice feature 🤔

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants