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

show an example of gin middleware for authorization and authentication #551

Merged
merged 6 commits into from
Jun 22, 2023

Conversation

michaelneale
Copy link
Contributor

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

@michaelneale michaelneale changed the title show an example of gin middle ware for authorization and authentication show an example of gin middleware for authorization and authentication Jun 21, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jun 21, 2023

Codecov Report

Merging #551 (d5bd3ae) into main (7218df0) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #551   +/-   ##
=======================================
  Coverage   20.00%   20.00%           
=======================================
  Files          50       50           
  Lines        6175     6175           
=======================================
  Hits         1235     1235           
  Misses       4712     4712           
  Partials      228      228           

Copy link
Member

@decentralgabe decentralgabe left a 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.

@michaelneale
Copy link
Contributor Author

@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?

@decentralgabe
Copy link
Member

no DID auth yet, we have a ticket to track TBD54566975/ssi-sdk#306

Copy link
Member

@decentralgabe decentralgabe left a comment

Choose a reason for hiding this comment

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

Lgtm

@michaelneale michaelneale merged commit 3761db2 into main Jun 22, 2023
6 checks passed
@michaelneale michaelneale deleted the gin_authn branch June 22, 2023 06:38
vlad-tim pushed a commit to vlad-tim/ssi-service that referenced this pull request Jun 23, 2023
TBD54566975#551)

* show an example and document gin middleware for authorization and authentication
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.

3 participants