You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-07-15 01:44:22 +02:00
Fix method renaming in comments and tests
This commit is contained in:
@ -299,7 +299,7 @@ func TestOIDCProviderRefreshSessionIfNeededWithIdToken(t *testing.T) {
|
|||||||
assert.Equal(t, refreshToken, existingSession.RefreshToken)
|
assert.Equal(t, refreshToken, existingSession.RefreshToken)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCreateSessionStateFromBearerToken(t *testing.T) {
|
func TestOIDCProviderCreateSessionFromToken(t *testing.T) {
|
||||||
const profileURLEmail = "janed@me.com"
|
const profileURLEmail = "janed@me.com"
|
||||||
|
|
||||||
testCases := map[string]struct {
|
testCases := map[string]struct {
|
||||||
|
@ -124,8 +124,7 @@ func (p *ProviderData) RefreshSessionIfNeeded(_ context.Context, _ *sessions.Ses
|
|||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateSessionStateFromBearerToken should be implemented to allow providers
|
// CreateSessionFromToken converts Bearer IDTokens into sessions
|
||||||
// to convert ID tokens into sessions
|
|
||||||
func (p *ProviderData) CreateSessionFromToken(ctx context.Context, token string) (*sessions.SessionState, error) {
|
func (p *ProviderData) CreateSessionFromToken(ctx context.Context, token string) (*sessions.SessionState, error) {
|
||||||
if p.Verifier != nil {
|
if p.Verifier != nil {
|
||||||
return middleware.CreateTokenToSessionFunc(p.Verifier.Verify)(ctx, token)
|
return middleware.CreateTokenToSessionFunc(p.Verifier.Verify)(ctx, token)
|
||||||
|
@ -49,10 +49,13 @@ func TestAcrValuesConfigured(t *testing.T) {
|
|||||||
assert.Contains(t, result, "acr_values=testValue")
|
assert.Contains(t, result, "acr_values=testValue")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestEnrichSessionState(t *testing.T) {
|
func TestProviderDataEnrichSession(t *testing.T) {
|
||||||
|
g := NewWithT(t)
|
||||||
p := &ProviderData{}
|
p := &ProviderData{}
|
||||||
s := &sessions.SessionState{}
|
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) {
|
func TestProviderDataAuthorize(t *testing.T) {
|
||||||
|
Reference in New Issue
Block a user