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:
parent
0da45e97e1
commit
d9c141ae7c
@ -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)
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user