-
Notifications
You must be signed in to change notification settings - Fork 55
show an example of gin middleware for authorization and authentication #551
Conversation
Codecov Report
@@ Coverage Diff @@
## main #551 +/- ##
=======================================
Coverage 20.00% 20.00%
=======================================
Files 50 50
Lines 6175 6175
=======================================
Hits 1235 1235
Misses 4712 4712
Partials 228 228 |
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 don't think we should add this to the main codeline, I'm fine with it living in an examples
directory for extension.
I'm not certain we should add any auth, let alone user-based auth like this. If we do add auth I'd favor a DID-auth based solution. Until we have requirements, a design, and some consensus let's hold off on this.
@decentralgabe yeah can be in examples/docs for sure. I think there needs to be flexibility for implementers. Is there did based auth already in there? |
no DID auth yet, we have a ticket to track TBD54566975/ssi-sdk#306 |
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.
Lgtm
TBD54566975#551) * show an example and document gin middleware for authorization and authentication
Overview
Implementers of an ssi-service may want to weave in authentication and authorization.
Description
This shows how it can be done with stubbed out code which can be modified as needed.
There isn't an easy runtime plugin mechanism for golang so this would likely be done by the implementer.
How Has This Been Tested?
Regression tests covers this as it adds no functionality.
References
https://github.com/gin-gonic/gin/blob/master/docs/doc.md#using-basicauth-middleware