provider_with_prefix

Function provider_with_prefix 

Source
pub async fn provider_with_prefix(
    prefix: &str,
) -> Result<Option<Arc<dyn AuthProvider>>, Error>
Expand description

Initializes auth providers using env vars scoped to a prefix.

For prefix "MICROMEGAS_INGESTION":

  • API keys: tries MICROMEGAS_INGESTION_API_KEYS, falls back to MICROMEGAS_API_KEYS
  • OIDC: tries MICROMEGAS_INGESTION_OIDC_CONFIG, falls back to MICROMEGAS_OIDC_CONFIG
  • Admins: tries MICROMEGAS_INGESTION_ADMINS, falls back to MICROMEGAS_ADMINS

With an empty prefix the behaviour is identical to provider.