@@ -71,11 +71,11 @@ type NativeRealmOptions struct {
71
71
}
72
72
73
73
type JwtRealmOptions struct {
74
- Enabled bool `json:"enabled"`
75
- Secret string `json:"secret"`
76
- Expiry int `json:"expiry"`
77
- RefreshSecret string `json:"refresh_secret"`
78
- RefreshExpiry int `json:"refresh_expiry"`
74
+ Enabled bool `json:"enabled" envconfig:"CONVOY_JWT_REALM_ENABLED" `
75
+ Secret string `json:"secret" envconfig:"CONVOY_JWT_SECRET" `
76
+ Expiry int `json:"expiry" envconfig:"CONVOY_JWT_EXPIRY" `
77
+ RefreshSecret string `json:"refresh_secret" envconfig:"CONVOY_JWT_REFRESH_SECRET" `
78
+ RefreshExpiry int `json:"refresh_expiry" envconfig:"CONVOY_JWT_REFRESH_EXPIRY" `
79
79
}
80
80
81
81
type SMTPConfiguration struct {
@@ -421,6 +421,26 @@ func overrideConfigWithEnvVars(c *Configuration, override *Configuration) {
421
421
c .Auth .File .Basic = override .Auth .File .Basic
422
422
}
423
423
424
+ // CONVOY_JWT_SECRET
425
+ if ! IsStringEmpty (override .Auth .Jwt .Secret ) {
426
+ c .Auth .Jwt .Secret = override .Auth .Jwt .Secret
427
+ }
428
+
429
+ // CONVOY_JWT_EXPIRY
430
+ if override .Auth .Jwt .Expiry != 0 {
431
+ c .Auth .Jwt .Expiry = override .Auth .Jwt .Expiry
432
+ }
433
+
434
+ // CONVOY_JWT_REFRESH_SECRET
435
+ if ! IsStringEmpty (override .Auth .Jwt .RefreshSecret ) {
436
+ c .Auth .Jwt .RefreshSecret = override .Auth .Jwt .RefreshSecret
437
+ }
438
+
439
+ // CONVOY_JWT_REFRESH_EXPIRY
440
+ if override .Auth .Jwt .RefreshExpiry != 0 {
441
+ c .Auth .Jwt .RefreshExpiry = override .Auth .Jwt .RefreshExpiry
442
+ }
443
+
424
444
// boolean values are weird; we have to check if they are actually set
425
445
426
446
if _ , ok := os .LookupEnv ("CONVOY_MULTIPLE_TENANTS" ); ok {
@@ -438,6 +458,10 @@ func overrideConfigWithEnvVars(c *Configuration, override *Configuration) {
438
458
if _ , ok := os .LookupEnv ("CONVOY_NATIVE_REALM_ENABLED" ); ok {
439
459
c .Auth .Native .Enabled = override .Auth .Native .Enabled
440
460
}
461
+
462
+ if _ , ok := os .LookupEnv ("CONVOY_JWT_REALM_ENABLED" ); ok {
463
+ c .Auth .Jwt .Enabled = override .Auth .Jwt .Enabled
464
+ }
441
465
}
442
466
443
467
// LoadConfig is used to load the configuration from either the json config file
0 commit comments