Skip to content
Permalink
Browse files

Token => signature

  • Loading branch information...
DarthSim committed Nov 20, 2018
1 parent adf6055 commit 2209063ce30e7a53c26a2a3e6a1576c7817ad1be
Showing with 7 additions and 7 deletions.
  1. +6 −6 crypt.go
  2. +1 −1 processing_options_test.go
@@ -8,16 +8,16 @@ import (
)

var (
errInvalidToken = errors.New("Invalid token")
errInvalidTokenEncoding = errors.New("Invalid token encoding")
errInvalidSignature = errors.New("Invalid signature")
errInvalidSignatureEncoding = errors.New("Invalid signature encoding")
)

type securityKey []byte

func validatePath(token, path string) error {
messageMAC, err := base64.RawURLEncoding.DecodeString(token)
func validatePath(signature, path string) error {
messageMAC, err := base64.RawURLEncoding.DecodeString(signature)
if err != nil {
return errInvalidTokenEncoding
return errInvalidSignatureEncoding
}

for i := 0; i < len(conf.Keys); i++ {
@@ -26,7 +26,7 @@ func validatePath(token, path string) error {
}
}

return errInvalidToken
return errInvalidSignature
}

func signatureFor(str string, pairInd int) []byte {
@@ -555,7 +555,7 @@ func (s *ProcessingOptionsTestSuite) TestParsePathSignedInvalid() {
_, err := parsePath(context.Background(), req)

require.Error(s.T(), err)
assert.Equal(s.T(), errInvalidToken.Error(), err.Error())
assert.Equal(s.T(), errInvalidSignature.Error(), err.Error())
}

func TestProcessingOptions(t *testing.T) {

0 comments on commit 2209063

Please sign in to comment.
You can’t perform that action at this time.