auth: extract community auth crate

This commit is contained in:
github-ops
2026-05-14 19:48:58 +00:00
parent 56268d1482
commit 7c2a8f4fac
13 changed files with 457 additions and 139 deletions
+4
View File
@@ -10,6 +10,7 @@ mod storage;
use std::{env, net::SocketAddr, path::PathBuf};
use crank_community_auth::PasswordIdentityProvider;
use crank_registry::{PostgresPoolConfig, PostgresRegistry};
use sqlx::postgres::PgConnectOptions;
use tokio::net::TcpListener;
@@ -70,6 +71,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.with_limits(runtime_limits)
.with_response_cache(cache_stores.response.clone())
.build();
let identity_provider =
PasswordIdentityProvider::new(registry.clone(), auth_settings.password_pepper.clone());
let service = AdminServiceBuilder::new(
registry,
storage_root,
@@ -77,6 +80,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
secret_crypto,
runtime,
)
.with_identity_provider(std::sync::Arc::new(identity_provider))
.build();
service.bootstrap_admin_user().await?;
if env_flag("CRANK_DEMO_SEED") {