fix: rp: wrong assignment in WithIssuedAtMaxAge
WithIssuedAtMaxAge assigned its value to v.maxAge, which was wrong. This change fixes that by assiging the duration to v.maxAgeIAT.
This commit is contained in:
parent
ef5a8a2e3a
commit
6e9d8739e8
2 changed files with 5 additions and 5 deletions
|
@ -141,7 +141,7 @@ func WithIssuedAtOffset(offset time.Duration) func(*idTokenVerifier) {
|
||||||
// WithIssuedAtMaxAge provides the ability to define the maximum duration between iat and now
|
// WithIssuedAtMaxAge provides the ability to define the maximum duration between iat and now
|
||||||
func WithIssuedAtMaxAge(maxAge time.Duration) func(*idTokenVerifier) {
|
func WithIssuedAtMaxAge(maxAge time.Duration) func(*idTokenVerifier) {
|
||||||
return func(v *idTokenVerifier) {
|
return func(v *idTokenVerifier) {
|
||||||
v.maxAge = maxAge
|
v.maxAgeIAT = maxAge
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -310,7 +310,7 @@ func TestNewIDTokenVerifier(t *testing.T) {
|
||||||
keySet: tu.KeySet{},
|
keySet: tu.KeySet{},
|
||||||
options: []VerifierOption{
|
options: []VerifierOption{
|
||||||
WithIssuedAtOffset(time.Minute),
|
WithIssuedAtOffset(time.Minute),
|
||||||
//WithIssuedAtMaxAge(time.Hour),
|
WithIssuedAtMaxAge(time.Hour),
|
||||||
WithNonce(nil), // otherwise assert.Equal will fail on the function
|
WithNonce(nil), // otherwise assert.Equal will fail on the function
|
||||||
WithACRVerifier(nil),
|
WithACRVerifier(nil),
|
||||||
WithAuthTimeMaxAge(2 * time.Hour),
|
WithAuthTimeMaxAge(2 * time.Hour),
|
||||||
|
@ -318,9 +318,9 @@ func TestNewIDTokenVerifier(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
want: &idTokenVerifier{
|
want: &idTokenVerifier{
|
||||||
issuer: tu.ValidIssuer,
|
issuer: tu.ValidIssuer,
|
||||||
offset: time.Minute,
|
offset: time.Minute,
|
||||||
//maxAgeIAT: time.Hour, // Maybe BUG?
|
maxAgeIAT: time.Hour,
|
||||||
clientID: tu.ValidClientID,
|
clientID: tu.ValidClientID,
|
||||||
keySet: tu.KeySet{},
|
keySet: tu.KeySet{},
|
||||||
nonce: nil,
|
nonce: nil,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue