Skip to content

Commit 7ff1c5c

Browse files
committed
more CR suggestions
1 parent 100e6e1 commit 7ff1c5c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

middleware_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ func TestProjectVerifier(t *testing.T) {
402402
projectID := uint64(7)
403403

404404
authStore[projectID] = authcontrol.StaticAuth{
405-
Algorythm: authcontrol.DefaultAlgorithm,
405+
Algorithm: authcontrol.DefaultAlgorithm,
406406
Private: []byte(JWTSecret),
407407
}
408408

@@ -427,7 +427,7 @@ func TestProjectVerifier(t *testing.T) {
427427
})
428428

429429
authStore[projectID] = authcontrol.StaticAuth{
430-
Algorythm: "RS256",
430+
Algorithm: "RS256",
431431
Public: public,
432432
}
433433

verifier.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,24 @@ type AuthProvider interface {
2222

2323
// NewAuth creates a new AuthProvider with a static secret
2424
func NewAuth(secret string) AuthProvider {
25-
return StaticAuth{Algorythm: DefaultAlgorithm, Private: []byte(secret)}
25+
return StaticAuth{Algorithm: DefaultAlgorithm, Private: []byte(secret)}
2626
}
2727

2828
// StaticAuth is an AuthProvider with a static configuration
2929
type StaticAuth struct {
30-
Algorythm string
30+
Algorithm string
3131
Private []byte
3232
Public []byte
3333
}
3434

3535
// GetJWTAuth returns a JWTAuth using the private secret when available, otherwise the public key
3636
func (s StaticAuth) GetJWTAuth(_ *http.Request, options ...jwt.ValidateOption) (*jwtauth.JWTAuth, error) {
37-
if s.Algorythm == "" {
37+
if s.Algorithm == "" {
3838
return nil, fmt.Errorf("missing algorithm")
3939
}
4040

4141
if s.Private != nil {
42-
return jwtauth.New(s.Algorythm, s.Private, s.Private, options...), nil
42+
return jwtauth.New(s.Algorithm, s.Private, s.Private, options...), nil
4343
}
4444

4545
if s.Public == nil {
@@ -52,7 +52,7 @@ func (s StaticAuth) GetJWTAuth(_ *http.Request, options ...jwt.ValidateOption) (
5252
return nil, fmt.Errorf("parse public key: %w", err)
5353
}
5454

55-
return jwtauth.New(s.Algorythm, nil, pub, options...), nil
55+
return jwtauth.New(s.Algorithm, nil, pub, options...), nil
5656
}
5757

5858
// AuthStore is an interface for getting a StaticAuth by project ID

0 commit comments

Comments
 (0)