@@ -42,6 +42,7 @@ pub struct CertConfig {
4242pub struct RedisConfig {
4343 pub uri : SecretString ,
4444 pub require_client_auth : bool ,
45+ pub cert_cache_ttl : u64 ,
4546}
4647
4748#[ derive( Debug , Clone , Deserialize ) ]
@@ -52,6 +53,7 @@ pub struct DatabaseConfig {
5253#[ derive( Debug , Clone , Deserialize ) ]
5354pub struct AwsConfig {
5455 pub region : String ,
56+ pub secrets_cache_ttl : u64 ,
5557}
5658
5759#[ derive( Debug , Clone , Deserialize ) ]
@@ -136,6 +138,8 @@ impl Config {
136138 ) ?
137139 . set_default ( "redis.uri" , "redis://localhost:6379" ) ?
138140 . set_default ( "redis.require_client_auth" , false ) ?
141+ . set_default ( "redis.cert_cache_ttl" , 3600 ) ? // Default 1 hour
142+ . set_default ( "aws.secrets_cache_ttl" , 300 ) ? // Default 5 minutes
139143 . set_default ( "server.cert.email" , "admin@example.com" ) ?
140144 . set_default ( "server.cert.eku" , vec ! [ 1 , 3 , 6 , 1 , 5 , 5 , 7 , 3 , 30 ] ) ?
141145 . set_default ( "server.cert.organization" , "adorsys GmbH & CO KG" ) ?
@@ -225,6 +229,7 @@ mod tests {
225229 ( "APP_SERVER__CERT__ORGANIZATION" , "Test Org" ) ,
226230 ( "APP_SERVER__CERT__EKU" , "1,3,6,1,5,5,7,3,30" ) ,
227231 ( "APP_AWS__REGION" , "us-west-2" ) ,
232+ ( "APP_AWS__SECRETS_CACHE_TTL" , "600" ) ,
228233 ( "APP_CACHE__TTL" , "600" ) ,
229234 ( "APP_CACHE__MAX_CAPACITY" , "2000" ) ,
230235 ] ) ]
0 commit comments