Skip to content

Commit

Permalink
server/config: allow authentication: false to disable auth
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonish committed Mar 25, 2024
1 parent f50cd36 commit 7798bf8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/server/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ pub async fn main(args: &clap::ArgMatches) -> Result<()> {
}

fn is_authentication_required(config: &Config) -> bool {
// Allows `authentication: false` to disable authentication.
if let Ok(false) = config.get_bool("authentication") {
info!("Authentication disabled by configuration");
return false;
}

// First check if authentication has been explicitly disabled.
if !config.get_bool_with_default("authentication.required", true) {
info!("Authentication disabled by configuration");
Expand Down

0 comments on commit 7798bf8

Please sign in to comment.