feat: added auth by api key
Some checks failed
Publish Metadata Agent Image / build-and-push-image (push) Successful in 1m15s
Publish Web Player Image / build-and-push-image (push) Successful in 1m5s
Publish Server Image / build-and-push-image (push) Failing after 12m24s

This commit is contained in:
Boris Cherepanov
2026-03-23 12:07:57 +03:00
parent c30a3aff5d
commit 03f95cfd05
4 changed files with 46 additions and 19 deletions

View File

@@ -39,6 +39,10 @@ struct Args {
/// OIDC Session Secret (32+ chars, for HMAC). Random if not provided.
#[arg(long, env = "FURUMI_PLAYER_OIDC_SESSION_SECRET")]
oidc_session_secret: Option<String>,
/// API key for x-api-key header auth (alternative to OIDC session)
#[arg(long, env = "FURUMI_PLAYER_API_KEY")]
api_key: Option<String>,
}
#[tokio::main]
@@ -90,10 +94,15 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
std::process::exit(1);
});
if args.api_key.is_some() {
tracing::info!("x-api-key auth: enabled");
}
let state = Arc::new(web::AppState {
pool,
storage_dir: Arc::new(args.storage_dir),
oidc: oidc_state,
api_key: args.api_key,
});
tracing::info!("Web player: http://{}", bind_addr);