Add sso.Group, context.Auth, context.APIAuth to allow auth special routes #16086

Merged
lunny merged 9 commits from lunny/auth into main 2021-06-09 17:53:17 +00:00
Owner

This PR is only a refactor, but it makes auth according different routes possible.

This PR is only a refactor, but it makes auth according different routes possible.
zeripath approved these changes 2021-06-08 06:17:16 +00:00
zeripath left a comment
Contributor

Thanks this is the start of the refactor of the SSO methods I wanted to do but got stalled in earlier.

Few comments for more steps which can wait for the next pr but some of which could be done now

Thanks this is the start of the refactor of the SSO methods I wanted to do but got stalled in earlier. Few comments for more steps which can wait for the next pr but some of which could be done now
@ -0,0 +26,4 @@
// in order to allow the plugin to allocate necessary resources
Init() error
// Free should be called exactly once before application closes, in order to
Contributor

Could probably be better just named authenticate or verify

Could probably be better just named authenticate or verify
Contributor

We should think about whether we need this.

It could be rolled into the verifyauthdata function quite easily thus reducing complexity in the functions that call it, or (likely better) the methods groups could be constructed with only enabled methods enabled

Once we have the groups peppered within the routes we should then simplify the rest of these methods to remove the URL testing within methods.

We should think about whether we need this. It could be rolled into the verifyauthdata function quite easily thus reducing complexity in the functions that call it, or (likely better) the methods groups could be constructed with only enabled methods enabled Once we have the groups peppered within the routes we should then simplify the rest of these methods to remove the URL testing within methods.
@ -0,0 +30,4 @@
// give chance to the plugin to free any allocated resources
Free() error
// Verify tries to verify the authentication data contained in the request.
Contributor

Lint would probably prefer this be named Method instead.

Lint would probably prefer this be named Method instead.
lunny reviewed 2021-06-08 09:27:23 +00:00
@ -0,0 +30,4 @@
// give chance to the plugin to free any allocated resources
Free() error
// Verify tries to verify the authentication data contained in the request.
Author
Owner

But in fact, it doesn't complain.

But in fact, it doesn't complain.
6543 (Migrated from github.com) approved these changes 2021-06-09 17:53:01 +00:00
This repo is archived. You cannot comment on pull requests.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lunny/gitea#16086
No description provided.