From b54bf450dcd4a8a1602ecc2225fcd75577ad16df Mon Sep 17 00:00:00 2001 From: Josh Hawn Date: Wed, 17 Dec 2014 12:16:32 -0800 Subject: [PATCH] Fixes typo on auth/token VerifyOptions field Docker-DCO-1.1-Signed-off-by: Josh Hawn (github: jlhawn) --- auth/token/accesscontroller.go | 2 +- auth/token/token.go | 4 ++-- auth/token/token_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/auth/token/accesscontroller.go b/auth/token/accesscontroller.go index 09d78a71c..f7ca4d52f 100644 --- a/auth/token/accesscontroller.go +++ b/auth/token/accesscontroller.go @@ -243,7 +243,7 @@ func (ac *accessController) Authorized(req *http.Request, accessItems ...auth.Ac verifyOpts := VerifyOptions{ TrustedIssuers: common.NewStringSet(ac.issuer), - AccpetedAudiences: common.NewStringSet(ac.service), + AcceptedAudiences: common.NewStringSet(ac.service), Roots: ac.rootCerts, TrustedKeys: ac.trustedKeys, } diff --git a/auth/token/token.go b/auth/token/token.go index 2c1114a6b..568b257a3 100644 --- a/auth/token/token.go +++ b/auth/token/token.go @@ -86,7 +86,7 @@ type Token struct { // options when verifying a JSON Web Token. type VerifyOptions struct { TrustedIssuers common.StringSet - AccpetedAudiences common.StringSet + AcceptedAudiences common.StringSet Roots *x509.CertPool TrustedKeys map[string]libtrust.PublicKey } @@ -156,7 +156,7 @@ func (t *Token) Verify(verifyOpts VerifyOptions) error { } // Verify that the Audience claim is allowed. - if !verifyOpts.AccpetedAudiences.Contains(t.Claims.Audience) { + if !verifyOpts.AcceptedAudiences.Contains(t.Claims.Audience) { log.Errorf("token intended for another audience: %q", t.Claims.Audience) return ErrInvalidToken } diff --git a/auth/token/token_test.go b/auth/token/token_test.go index c1e0d2ad6..13d7cedec 100644 --- a/auth/token/token_test.go +++ b/auth/token/token_test.go @@ -197,7 +197,7 @@ func TestTokenVerify(t *testing.T) { verifyOps := VerifyOptions{ TrustedIssuers: common.NewStringSet(issuer), - AccpetedAudiences: common.NewStringSet(audience), + AcceptedAudiences: common.NewStringSet(audience), Roots: rootPool, TrustedKeys: trustedKeys, }