Skip to content

Commit

Permalink
Fixed name.
Browse files Browse the repository at this point in the history
  • Loading branch information
KN4CK3R committed Jun 16, 2021
1 parent 602c741 commit 032c0ab
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions modules/auth/oauth2/jwtsigningkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,35 +48,35 @@ type JWTSigningKey interface {
PreProcessToken(*jwt.Token)
}

type hmacSingingKey struct {
type hmacSigningKey struct {
signingMethod jwt.SigningMethod
secret []byte
}

func (key hmacSingingKey) IsSymmetric() bool {
func (key hmacSigningKey) IsSymmetric() bool {
return true
}

func (key hmacSingingKey) SigningMethod() jwt.SigningMethod {
func (key hmacSigningKey) SigningMethod() jwt.SigningMethod {
return key.signingMethod
}

func (key hmacSingingKey) SignKey() interface{} {
func (key hmacSigningKey) SignKey() interface{} {
return key.secret
}

func (key hmacSingingKey) VerifyKey() interface{} {
func (key hmacSigningKey) VerifyKey() interface{} {
return key.secret
}

func (key hmacSingingKey) ToJWK() (map[string]string, error) {
func (key hmacSigningKey) ToJWK() (map[string]string, error) {
return map[string]string{
"kty": "oct",
"alg": key.SigningMethod().Alg(),
}, nil
}

func (key hmacSingingKey) PreProcessToken(*jwt.Token) {}
func (key hmacSigningKey) PreProcessToken(*jwt.Token) {}

type rsaSingingKey struct {
signingMethod jwt.SigningMethod
Expand Down Expand Up @@ -240,7 +240,7 @@ func CreateJWTSingingKey(algorithm string, key interface{}) (JWTSigningKey, erro
if !ok {
return nil, jwt.ErrInvalidKeyType
}
return hmacSingingKey{signingMethod, secret}, nil
return hmacSigningKey{signingMethod, secret}, nil
}
}

Expand Down

0 comments on commit 032c0ab

Please sign in to comment.