Fixes typo on auth/token VerifyOptions field

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
This commit is contained in:
Josh Hawn 2014-12-17 12:16:32 -08:00
parent d30a8321d8
commit b54bf450dc
3 changed files with 4 additions and 4 deletions

View File

@ -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,
}

View File

@ -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
}

View File

@ -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,
}