1
0
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:
Nick Meves 2020-11-26 11:53:41 -08:00
parent 5f8f856260
commit 57a8ef06b4
No known key found for this signature in database
GPG Key ID: 93BA8A3CEDCDD1CF
3 changed files with 7 additions and 5 deletions

View File

@ -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 {

View File

@ -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)

View File

@ -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) {