Fix method renaming in comments and tests

This commit is contained in:
Nick Meves
2020-11-28 10:25:12 -08:00
parent 5f8f856260
commit 57a8ef06b4
3 changed files with 7 additions and 5 deletions
+1 -1
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 {
+1 -2
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)
+5 -2
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) {