Add missing validy validator to oidc.
This commit is contained in:
parent
5ce5a891f7
commit
6d395f3818
3 changed files with 7 additions and 4 deletions
|
@ -116,11 +116,8 @@ func (p *JWT) Authorize(token string) ([]SignOption, error) {
|
|||
dnsNamesValidator(dnsNames),
|
||||
ipAddressesValidator(ips),
|
||||
// profileWithOption(x509util.WithNotBeforeAfterDuration(so.NotBefore, so.NotAfter, p.Claims.DefaultTLSCertDuration())),
|
||||
&validityValidator{
|
||||
min: p.Claims.MinTLSCertDuration(),
|
||||
max: p.Claims.MaxTLSCertDuration(),
|
||||
},
|
||||
newProvisionerExtensionOption(TypeJWK, p.Name, p.Key.KeyID),
|
||||
newValidityValidator(p.Claims.MinTLSCertDuration(), p.Claims.MaxTLSCertDuration()),
|
||||
}
|
||||
|
||||
// Store the token to protect against reuse.
|
||||
|
|
|
@ -157,6 +157,7 @@ func (o *OIDC) Authorize(token string) ([]SignOption, error) {
|
|||
return []SignOption{
|
||||
emailOnlyIdentity(claims.Email),
|
||||
newProvisionerExtensionOption(TypeOIDC, o.Name, o.ClientID),
|
||||
newValidityValidator(o.Claims.MinTLSCertDuration(), o.Claims.MaxTLSCertDuration()),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -123,6 +123,11 @@ type validityValidator struct {
|
|||
max time.Duration
|
||||
}
|
||||
|
||||
// newValidityValidator return a new validity validator.
|
||||
func newValidityValidator(min, max time.Duration) *validityValidator {
|
||||
return &validityValidator{min: min, max: max}
|
||||
}
|
||||
|
||||
// Validate validates the certificate temporal validity settings.
|
||||
func (v *validityValidator) Valid(crt *x509.Certificate) error {
|
||||
var (
|
||||
|
|
Loading…
Reference in a new issue