Skip to content

Commit

Permalink
server/config: Allow omitting jwt section entirely
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaofengli committed Oct 5, 2024
1 parent 858120c commit 77f76d5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions server/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ pub struct Config {
pub garbage_collection: GarbageCollectionConfig,

/// JSON Web Token.
#[serde(default = "Default::default")]
pub jwt: JWTConfig,

/// (Deprecated Stub)
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 77f76d5

Please sign in to comment.