Skip to content

Commit 40c1f23

Browse files
Dillon StreatorDillon Streator
authored andcommitted
adjust naming
1 parent f636433 commit 40c1f23

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hmac.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (m *SigningMethodHMAC) Alg() string {
4848
// Verify implements token verification for the SigningMethod. Returns nil if the signature is valid.
4949
func (m *SigningMethodHMAC) Verify(signingString, signature string, key interface{}) error {
5050
// Verify the key is the right type
51-
keyBytes, err := bytesFrom(key)
51+
keyBytes, err := m.keyBytesFrom(key)
5252
if err != nil {
5353
return err
5454
}
@@ -80,7 +80,7 @@ func (m *SigningMethodHMAC) Verify(signingString, signature string, key interfac
8080
// Sign implements token signing for the SigningMethod.
8181
// Key must be []byte
8282
func (m *SigningMethodHMAC) Sign(signingString string, key interface{}) (string, error) {
83-
keyBytes, err := bytesFrom(key)
83+
keyBytes, err := m.keyBytesFrom(key)
8484
if err != nil {
8585
return "", err
8686
}
@@ -95,7 +95,7 @@ func (m *SigningMethodHMAC) Sign(signingString string, key interface{}) (string,
9595
return EncodeSegment(hasher.Sum(nil)), nil
9696
}
9797

98-
func bytesFrom(value interface{}) ([]byte, error) {
98+
func (m *SigningMethodHMAC) keyBytesFrom(value interface{}) ([]byte, error) {
9999
switch v := value.(type) {
100100
case []byte:
101101
return v, nil

0 commit comments

Comments
 (0)