mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-20 01:38:41 +02:00
initialize jwt validator with keys rotation state
This commit is contained in:
parent
c6190fa2ba
commit
a89808ecae
@ -80,6 +80,7 @@ var (
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed reading provided config file: %s: %v", mgmtConfig, err)
|
return fmt.Errorf("failed reading provided config file: %s: %v", mgmtConfig, err)
|
||||||
}
|
}
|
||||||
|
config.HttpConfig.KeyRotationEnabled = UseKeyCacheHeaders
|
||||||
|
|
||||||
tlsEnabled := false
|
tlsEnabled := false
|
||||||
if mgmtLetsencryptDomain != "" || (config.HttpConfig.CertFile != "" && config.HttpConfig.CertKey != "") {
|
if mgmtLetsencryptDomain != "" || (config.HttpConfig.CertFile != "" && config.HttpConfig.CertKey != "") {
|
||||||
@ -186,6 +187,7 @@ var (
|
|||||||
config.HttpConfig.AuthIssuer,
|
config.HttpConfig.AuthIssuer,
|
||||||
config.GetAuthAudiences(),
|
config.GetAuthAudiences(),
|
||||||
config.HttpConfig.AuthKeysLocation,
|
config.HttpConfig.AuthKeysLocation,
|
||||||
|
config.HttpConfig.KeyRotationEnabled,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed creating JWT validator: %v", err)
|
return fmt.Errorf("failed creating JWT validator: %v", err)
|
||||||
|
@ -52,7 +52,9 @@ func NewServer(config *Config, accountManager AccountManager, peersUpdateManager
|
|||||||
jwtValidator, err = jwtclaims.NewJWTValidator(
|
jwtValidator, err = jwtclaims.NewJWTValidator(
|
||||||
config.HttpConfig.AuthIssuer,
|
config.HttpConfig.AuthIssuer,
|
||||||
config.GetAuthAudiences(),
|
config.GetAuthAudiences(),
|
||||||
config.HttpConfig.AuthKeysLocation)
|
config.HttpConfig.AuthKeysLocation,
|
||||||
|
config.HttpConfig.KeyRotationEnabled,
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, status.Errorf(codes.Internal, "unable to create new jwt middleware, err: %v", err)
|
return nil, status.Errorf(codes.Internal, "unable to create new jwt middleware, err: %v", err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user