feat(import): complete OpenAPI onboarding and verify delivery
CI / Rust Checks (pull_request) Failing after 1s
CI / UI Checks (pull_request) Skipped
CI / Frontend E2E (pull_request) Skipped
CI / Community Image Smoke (pull_request) Skipped
CI / Deploy (pull_request) Skipped

This commit is contained in:
bsodfather committed 2026-10-09 17:50:38 +03:00
1 parent bb3e376767
commit e93de7015a
244 files changed
+57020 -5139

No files matched your search

+28 -3
View File
@@ -3,6 +3,7 @@
use std::{
collections::BTreeMap,
env, fmt,
str::FromStr,
sync::Arc,
time::{SystemTime, UNIX_EPOCH},
};
@@ -15,7 +16,9 @@ use crank_core::{
};
use crank_core::{IdentityError, IdentityProvider, IdentityProviderKind, LoginOutcome};
use crank_mapping::{MappingRule, MappingSet};
use crank_registry::{MASTER_KEY_CIPHER_CONTRACT, MasterKeyIdentityCandidate, PostgresRegistry};
use crank_registry::{
MASTER_KEY_CIPHER_CONTRACT, MasterKeyIdentityCandidate, PostgresPoolConfig, PostgresRegistry,
};
use crank_runtime::SecretCrypto;
use crank_schema::{Schema, SchemaKind};
use serde_json::{Value, json};
@@ -358,11 +361,33 @@ pub(super) async fn create_lead(Json(payload): Json<Value>) -> Json<Value> {
pub(super) async fn test_registry() -> PostgresRegistry {
let database_url = crank_test_support::postgres_schema_url("test_admin_api").await;
let pool = sqlx::PgPool::connect(&database_url).await.unwrap();
test_registry_at_url(&database_url, None).await
}
pub(super) async fn test_registry_with_single_connection() -> (PostgresRegistry, String) {
let database_url = crank_test_support::postgres_schema_url("test_admin_api_replay").await;
let pool_config = PostgresPoolConfig::try_new(1, 0, 5_000, 60_000, 1_800_000).unwrap();
let registry = test_registry_at_url(&database_url, Some(pool_config)).await;
(registry, database_url)
}
async fn test_registry_at_url(
database_url: &str,
pool_config: Option<PostgresPoolConfig>,
) -> PostgresRegistry {
let pool = sqlx::PgPool::connect(database_url).await.unwrap();
crank_registry::MigrationAuthority::apply(&pool)
.await
.unwrap();
let registry = PostgresRegistry::connect(&database_url).await.unwrap();
let registry = match pool_config {
Some(config) => {
let options = sqlx::postgres::PgConnectOptions::from_str(database_url).unwrap();
PostgresRegistry::connect_with_options_and_pool_config(options, config)
.await
.unwrap()
}
None => PostgresRegistry::connect(database_url).await.unwrap(),
};
let secret_crypto = test_secret_crypto();
registry
.verify_or_register_master_key_identity(MasterKeyIdentityCandidate {