Skip to main content

resolve_token_source

Function resolve_token_source 

Source
pub async fn resolve_token_source() -> Result<Box<dyn TokenSource>>
Expand description

Pick the token source based on configuration.

Preference order:

  1. If OMNIGRAPH_SERVER_BEARER_TOKENS_AWS_SECRET is set AND the binary was built with --features aws, returns an AWS Secrets Manager source.
  2. If that env var is set but the binary was built without the feature, errors with a clear rebuild instruction rather than silently falling back to the env/file source (which would hide the misconfiguration).
  3. Otherwise, returns EnvOrFileTokenSource.