Skip to content

Commit 1c729b7

Browse files
committed
fix typos
1 parent 2613976 commit 1c729b7

File tree

4 files changed

+5
-16
lines changed

4 files changed

+5
-16
lines changed

identity/managed_identity_provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func (m *ManagedIdentityProvider) RequestToken() (shared.IdentityProviderRespons
117117
// the resource is the URL of the resource that the identity has access to
118118
authResult, err := m.client.AcquireToken(context.TODO(), resource)
119119
if err != nil {
120-
return nil, fmt.Errorf("coudn't acquire token: %w", err)
120+
return nil, fmt.Errorf("couldn't acquire token: %w", err)
121121
}
122122

123123
return shared.NewIDPResponse(shared.ResponseTypeAuthResult, &authResult)

identity/managed_identity_provider_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func TestRequestToken_ErrorCases(t *testing.T) {
174174
m.On("AcquireToken", mock.Anything, RedisResource).
175175
Return(public.AuthResult{}, errors.New("failed to acquire token"))
176176
},
177-
expectedError: "coudn't acquire token: failed to acquire token",
177+
expectedError: "couldn't acquire token: failed to acquire token",
178178
},
179179
{
180180
name: "AcquireToken fails with custom resource",
@@ -186,7 +186,7 @@ func TestRequestToken_ErrorCases(t *testing.T) {
186186
m.On("AcquireToken", mock.Anything, "custom-resource").
187187
Return(public.AuthResult{}, errors.New("failed to acquire token"))
188188
},
189-
expectedError: "coudn't acquire token: failed to acquire token",
189+
expectedError: "couldn't acquire token: failed to acquire token",
190190
},
191191
{
192192
name: "AcquireToken fails with invalid resource",
@@ -198,7 +198,7 @@ func TestRequestToken_ErrorCases(t *testing.T) {
198198
m.On("AcquireToken", mock.Anything, "invalid-resource").
199199
Return(public.AuthResult{}, errors.New("invalid resource"))
200200
},
201-
expectedError: "coudn't acquire token: invalid resource",
201+
expectedError: "couldn't acquire token: invalid resource",
202202
},
203203
}
204204

manager/manager_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func (m *mockTokenListener) OnTokenError(err error) {
147147
}
148148

149149
type authResult struct {
150-
// ResultType is the type of the auth result
150+
// ResultType is the type of the response (AuthResult, AccessToken, or RawToken)
151151
ResultType string
152152
// AuthResultVal is the auth result value
153153
AuthResultVal *public.AuthResult

manager/token_manager_test.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -527,17 +527,6 @@ func TestDefaultIdentityProviderResponseParser(t *testing.T) {
527527
assert.Error(t, err)
528528
assert.Nil(t, token1)
529529
})
530-
t.Run("Default IdentityProviderResponseParser with token that expired", func(t *testing.T) {
531-
t.Parallel()
532-
authResultVal := testAuthResult(time.Now().Add(-time.Hour))
533-
idpResponse := &authResult{
534-
ResultType: shared.ResponseTypeAuthResult,
535-
AuthResultVal: authResultVal,
536-
}
537-
token1, err := parser.ParseResponse(idpResponse)
538-
assert.Error(t, err)
539-
assert.Nil(t, token1)
540-
})
541530
}
542531

543532
func TestEntraidTokenManager_GetToken(t *testing.T) {

0 commit comments

Comments
 (0)