mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-02-11 13:53:07 +02:00
Fix method renaming in comments and tests
This commit is contained in:
parent
5f8f856260
commit
57a8ef06b4
@ -299,7 +299,7 @@ func TestOIDCProviderRefreshSessionIfNeededWithIdToken(t *testing.T) {
|
||||
assert.Equal(t, refreshToken, existingSession.RefreshToken)
|
||||
}
|
||||
|
||||
func TestCreateSessionStateFromBearerToken(t *testing.T) {
|
||||
func TestOIDCProviderCreateSessionFromToken(t *testing.T) {
|
||||
const profileURLEmail = "janed@me.com"
|
||||
|
||||
testCases := map[string]struct {
|
||||
|
@ -124,8 +124,7 @@ func (p *ProviderData) RefreshSessionIfNeeded(_ context.Context, _ *sessions.Ses
|
||||
return false, nil
|
||||
}
|
||||
|
||||
// CreateSessionStateFromBearerToken should be implemented to allow providers
|
||||
// to convert ID tokens into sessions
|
||||
// CreateSessionFromToken converts Bearer IDTokens into sessions
|
||||
func (p *ProviderData) CreateSessionFromToken(ctx context.Context, token string) (*sessions.SessionState, error) {
|
||||
if p.Verifier != nil {
|
||||
return middleware.CreateTokenToSessionFunc(p.Verifier.Verify)(ctx, token)
|
||||
|
@ -49,10 +49,13 @@ func TestAcrValuesConfigured(t *testing.T) {
|
||||
assert.Contains(t, result, "acr_values=testValue")
|
||||
}
|
||||
|
||||
func TestEnrichSessionState(t *testing.T) {
|
||||
func TestProviderDataEnrichSession(t *testing.T) {
|
||||
g := NewWithT(t)
|
||||
p := &ProviderData{}
|
||||
s := &sessions.SessionState{}
|
||||
assert.NoError(t, p.EnrichSession(context.Background(), s))
|
||||
|
||||
err := p.EnrichSession(context.Background(), s)
|
||||
g.Expect(err).ToNot(HaveOccurred())
|
||||
}
|
||||
|
||||
func TestProviderDataAuthorize(t *testing.T) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user