Skip to content

Some improvements#151

Open
Dragomir-Ivanov wants to merge 2 commits into
qvest-digital:masterfrom
Dragomir-Ivanov:master
Open

Some improvements#151
Dragomir-Ivanov wants to merge 2 commits into
qvest-digital:masterfrom
Dragomir-Ivanov:master

Conversation

@Dragomir-Ivanov

Copy link
Copy Markdown

No description provided.

@coveralls

coveralls commented Nov 24, 2019

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.03%) to 91.769% when pulling 9c29985 on Dragomir-Ivanov:master into be2ae2c on tarent:master.

Comment thread login/handler.go
const contentTypeJSON = "application/json"
const contentTypePlain = "text/plain"

type userClaimsFunc func(userInfo model.UserInfo) (jwt.Claims, error)

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Author

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.

Comment thread login/handler_test.go
Equal(t, input, output)
}

func callWithHandler(h *Handler, req *http.Request) *httptest.ResponseRecorder {

Copy link
Copy Markdown
Contributor

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.

@g-w

g-w commented Dec 5, 2019

Copy link
Copy Markdown
Contributor

Hello @Dragomir-Ivanov ,
I'll accept your changes if you resolve the issues pointed out in my review. Please, remove 9c29985 from the PR and reformat the test.

Thanks, Gregor

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