1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-11-29 22:48:19 +02:00

Standardize provider interface method names

This commit is contained in:
Nick Meves
2020-10-23 22:06:50 -07:00
parent 2706909fe3
commit e9f787957e
15 changed files with 29 additions and 29 deletions

View File

@@ -64,7 +64,7 @@ func TestGitLabProviderBadToken(t *testing.T) {
p := testGitLabProvider(bURL.Host)
session := &sessions.SessionState{AccessToken: "unexpected_gitlab_access_token"}
err := p.EnrichSessionState(context.Background(), session)
err := p.EnrichSession(context.Background(), session)
assert.Error(t, err)
}
@@ -76,7 +76,7 @@ func TestGitLabProviderUnverifiedEmailDenied(t *testing.T) {
p := testGitLabProvider(bURL.Host)
session := &sessions.SessionState{AccessToken: "gitlab_access_token"}
err := p.EnrichSessionState(context.Background(), session)
err := p.EnrichSession(context.Background(), session)
assert.Error(t, err)
}
@@ -89,7 +89,7 @@ func TestGitLabProviderUnverifiedEmailAllowed(t *testing.T) {
p.AllowUnverifiedEmail = true
session := &sessions.SessionState{AccessToken: "gitlab_access_token"}
err := p.EnrichSessionState(context.Background(), session)
err := p.EnrichSession(context.Background(), session)
assert.NoError(t, err)
assert.Equal(t, "foo@bar.com", session.Email)
}
@@ -103,7 +103,7 @@ func TestGitLabProviderUsername(t *testing.T) {
p.AllowUnverifiedEmail = true
session := &sessions.SessionState{AccessToken: "gitlab_access_token"}
err := p.EnrichSessionState(context.Background(), session)
err := p.EnrichSession(context.Background(), session)
assert.NoError(t, err)
assert.Equal(t, "FooBar", session.User)
}
@@ -118,7 +118,7 @@ func TestGitLabProviderGroupMembershipValid(t *testing.T) {
p.Groups = []string{"foo"}
session := &sessions.SessionState{AccessToken: "gitlab_access_token"}
err := p.EnrichSessionState(context.Background(), session)
err := p.EnrichSession(context.Background(), session)
assert.NoError(t, err)
assert.Equal(t, "FooBar", session.User)
}
@@ -133,6 +133,6 @@ func TestGitLabProviderGroupMembershipMissing(t *testing.T) {
p.Groups = []string{"baz"}
session := &sessions.SessionState{AccessToken: "gitlab_access_token"}
err := p.EnrichSessionState(context.Background(), session)
err := p.EnrichSession(context.Background(), session)
assert.Error(t, err)
}