1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-03-19 21:27:58 +02:00

Remove GetUserName method from Provider

This commit is contained in:
Nick Meves 2020-09-27 15:18:12 -07:00
parent 0da45e97e1
commit d9c141ae7c
No known key found for this signature in database
GPG Key ID: 93BA8A3CEDCDD1CF
3 changed files with 0 additions and 14 deletions

View File

@ -368,12 +368,6 @@ func (p *OAuthProxy) enrichSessionState(ctx context.Context, s *sessionsapi.Sess
return err
}
}
if s.User == "" {
s.User, err = p.provider.GetUserName(ctx, s)
if err != nil && !errors.Is(err, providers.ErrNotImplemented) {
return err
}
}
return p.provider.EnrichSessionState(ctx, s)
}

View File

@ -92,12 +92,6 @@ func (p *ProviderData) GetEmailAddress(_ context.Context, _ *sessions.SessionSta
return "", ErrNotImplemented
}
// GetUserName returns the Account username
// DEPRECATED: Migrate to EnrichSessionState
func (p *ProviderData) GetUserName(_ context.Context, _ *sessions.SessionState) (string, error) {
return "", ErrNotImplemented
}
// ValidateGroup validates that the provided email exists in the configured provider
// email group(s).
func (p *ProviderData) ValidateGroup(_ string) bool {

View File

@ -12,8 +12,6 @@ type Provider interface {
Data() *ProviderData
// DEPRECATED: Migrate to EnrichSessionState
GetEmailAddress(ctx context.Context, s *sessions.SessionState) (string, error)
// DEPRECATED: Migrate to EnrichSessionState
GetUserName(ctx context.Context, s *sessions.SessionState) (string, error)
Redeem(ctx context.Context, redirectURI, code string) (*sessions.SessionState, error)
ValidateGroup(string) bool
EnrichSessionState(ctx context.Context, s *sessions.SessionState) error