mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-03-19 21:27:58 +02:00
Note legacy areas to refactor away from groupValidator
This commit is contained in:
parent
b9661cb6fe
commit
d7fa979060
@ -180,6 +180,11 @@ func (p *GoogleProvider) Redeem(ctx context.Context, redirectURL, code string) (
|
|||||||
// EnrichSessionState checks the listed Google Groups configured and adds any
|
// EnrichSessionState checks the listed Google Groups configured and adds any
|
||||||
// that the user is a member of to session.Groups.
|
// that the user is a member of to session.Groups.
|
||||||
func (p *GoogleProvider) EnrichSessionState(ctx context.Context, s *sessions.SessionState) error {
|
func (p *GoogleProvider) EnrichSessionState(ctx context.Context, s *sessions.SessionState) error {
|
||||||
|
// TODO (@NickMeves) - Move to pure EnrichSessionState logic and stop
|
||||||
|
// reusing legacy `groupValidator`.
|
||||||
|
//
|
||||||
|
// This is called here to get the validator to do the `session.Groups`
|
||||||
|
// populating logic.
|
||||||
p.groupValidator(s)
|
p.groupValidator(s)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@ -273,6 +278,9 @@ func (p *GoogleProvider) RefreshSessionIfNeeded(ctx context.Context, s *sessions
|
|||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO (@NickMeves) - Align Group authorization needs with other providers'
|
||||||
|
// behavior in the `RefreshSession` case.
|
||||||
|
//
|
||||||
// re-check that the user is in the proper google group(s)
|
// re-check that the user is in the proper google group(s)
|
||||||
if !p.groupValidator(s) {
|
if !p.groupValidator(s) {
|
||||||
return false, fmt.Errorf("%s is no longer in the group(s)", s.Email)
|
return false, fmt.Errorf("%s is no longer in the group(s)", s.Email)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user