forked from TrueCloudLab/distribution
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:
parent
d30a8321d8
commit
b54bf450dc
3 changed files with 4 additions and 4 deletions
|
@ -243,7 +243,7 @@ func (ac *accessController) Authorized(req *http.Request, accessItems ...auth.Ac
|
||||||
|
|
||||||
verifyOpts := VerifyOptions{
|
verifyOpts := VerifyOptions{
|
||||||
TrustedIssuers: common.NewStringSet(ac.issuer),
|
TrustedIssuers: common.NewStringSet(ac.issuer),
|
||||||
AccpetedAudiences: common.NewStringSet(ac.service),
|
AcceptedAudiences: common.NewStringSet(ac.service),
|
||||||
Roots: ac.rootCerts,
|
Roots: ac.rootCerts,
|
||||||
TrustedKeys: ac.trustedKeys,
|
TrustedKeys: ac.trustedKeys,
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ type Token struct {
|
||||||
// options when verifying a JSON Web Token.
|
// options when verifying a JSON Web Token.
|
||||||
type VerifyOptions struct {
|
type VerifyOptions struct {
|
||||||
TrustedIssuers common.StringSet
|
TrustedIssuers common.StringSet
|
||||||
AccpetedAudiences common.StringSet
|
AcceptedAudiences common.StringSet
|
||||||
Roots *x509.CertPool
|
Roots *x509.CertPool
|
||||||
TrustedKeys map[string]libtrust.PublicKey
|
TrustedKeys map[string]libtrust.PublicKey
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ func (t *Token) Verify(verifyOpts VerifyOptions) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify that the Audience claim is allowed.
|
// 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)
|
log.Errorf("token intended for another audience: %q", t.Claims.Audience)
|
||||||
return ErrInvalidToken
|
return ErrInvalidToken
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,7 +197,7 @@ func TestTokenVerify(t *testing.T) {
|
||||||
|
|
||||||
verifyOps := VerifyOptions{
|
verifyOps := VerifyOptions{
|
||||||
TrustedIssuers: common.NewStringSet(issuer),
|
TrustedIssuers: common.NewStringSet(issuer),
|
||||||
AccpetedAudiences: common.NewStringSet(audience),
|
AcceptedAudiences: common.NewStringSet(audience),
|
||||||
Roots: rootPool,
|
Roots: rootPool,
|
||||||
TrustedKeys: trustedKeys,
|
TrustedKeys: trustedKeys,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue