Skip to content

Commit

Permalink
fix: added error if no tokens are valid when starting in strict mode (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswk authored Nov 25, 2024
1 parent dba5aec commit 92c85db
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ async fn build_edge(args: &EdgeArgs, app_name: &str) -> EdgeResult<EdgeInfo> {
.await;
}

if args.strict && token_cache.is_empty() {
error!("You started Edge in strict mode, but Edge was not able to validate any of the tokens configured at startup");
return Err(EdgeError::NoTokens("No valid tokens was provided on startup. At least one valid token must be specified at startup when running in Strict mode".into()));
}
for validated_token in token_cache
.iter()
.filter(|candidate| candidate.value().token_type == Some(TokenType::Client))
Expand Down

0 comments on commit 92c85db

Please sign in to comment.