1
0
Fork 0
mirror of https://github.com/zhaofengli/attic.git synced 2024-12-14 11:57:30 +00:00

server/config: Allow omitting jwt section entirely

This commit is contained in:
Zhaofeng Li 2024-10-05 17:42:16 -06:00
parent 858120c450
commit 77f76d55ed

View file

@ -123,6 +123,7 @@ pub struct Config {
pub garbage_collection: GarbageCollectionConfig,
/// JSON Web Token.
#[serde(default = "Default::default")]
pub jwt: JWTConfig,
/// (Deprecated Stub)
@ -399,6 +400,16 @@ fn load_database_url_from_env() -> String {
))
}
impl Default for JWTConfig {
fn default() -> Self {
Self {
token_bound_issuer: None,
token_bound_audiences: None,
signing_config: load_jwt_signing_config_from_env(),
}
}
}
impl CompressionConfig {
pub fn level(&self) -> CompressionLevel {
if let Some(level) = self.level {