-
Notifications
You must be signed in to change notification settings - Fork 148
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
Some improvements #151
base: master
Are you sure you want to change the base?
Some improvements #151
Conversation
37a4631
to
7870615
Compare
7870615
to
9c29985
Compare
@@ -20,7 +20,8 @@ const contentTypeJWT = "application/jwt" | |||
const contentTypeJSON = "application/json" | |||
const contentTypePlain = "text/plain" | |||
|
|||
type userClaimsFunc func(userInfo model.UserInfo) (jwt.Claims, 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 type should not be exported. It makes no sense to export this from my point of view; it is an implementation detail of loginsrv and not a public API which should be used from outside. If you want to provide custom user claims use the "user endpoint"-feature
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 am using loginsrv
embedded in my application, and my custom provider is just another piece of code in that application. It doesn't make sense to do provision over HTTP in this case(opening localhost server, and then connecting to itself). Maybe if we export UserClaimsFunc
"user endpoint" feature becomes one of the user claims providers available.
I do find mandatory provision over HTTP as unnecessary.
@@ -485,6 +485,45 @@ func TestHandler_ReturnUserInfoJSON(t *testing.T) { | |||
Equal(t, input, output) | |||
} | |||
|
|||
func callWithHandler(h *Handler, req *http.Request) *httptest.ResponseRecorder { |
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.
Could you please move this to the end of the file.
Hello @Dragomir-Ivanov , Thanks, Gregor |
No description provided.