initialize jwt validator with keys rotation state

This commit is contained in:
Bethuel 2023-04-14 12:17:28 +03:00
parent c6190fa2ba
commit a89808ecae
2 changed files with 5 additions and 1 deletions

View File

@ -80,6 +80,7 @@ var (
if err != nil {
return fmt.Errorf("failed reading provided config file: %s: %v", mgmtConfig, err)
}
config.HttpConfig.KeyRotationEnabled = UseKeyCacheHeaders
tlsEnabled := false
if mgmtLetsencryptDomain != "" || (config.HttpConfig.CertFile != "" && config.HttpConfig.CertKey != "") {
@ -186,6 +187,7 @@ var (
config.HttpConfig.AuthIssuer,
config.GetAuthAudiences(),
config.HttpConfig.AuthKeysLocation,
config.HttpConfig.KeyRotationEnabled,
)
if err != nil {
return fmt.Errorf("failed creating JWT validator: %v", err)

View File

@ -52,7 +52,9 @@ func NewServer(config *Config, accountManager AccountManager, peersUpdateManager
jwtValidator, err = jwtclaims.NewJWTValidator(
config.HttpConfig.AuthIssuer,
config.GetAuthAudiences(),
config.HttpConfig.AuthKeysLocation)
config.HttpConfig.AuthKeysLocation,
config.HttpConfig.KeyRotationEnabled,
)
if err != nil {
return nil, status.Errorf(codes.Internal, "unable to create new jwt middleware, err: %v", err)
}