mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-05 00:47:48 +08:00
feat: configure auth channel mismatch formats
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
use crate::handlers::admin::provider::shared::payloads::AdminProviderKeyCreateRequest;
|
||||
use crate::handlers::admin::provider::write::normalize::{
|
||||
normalize_api_format_json_object_keys, normalize_api_format_list, normalize_auth_type,
|
||||
normalize_auth_type_by_format, validate_vertex_api_formats,
|
||||
normalize_allow_auth_channel_mismatch_formats, normalize_api_format_json_object_keys,
|
||||
normalize_api_format_list, normalize_auth_type, normalize_auth_type_by_format,
|
||||
validate_vertex_api_formats,
|
||||
};
|
||||
use crate::handlers::admin::request::AdminAppState;
|
||||
use crate::handlers::admin::shared::{
|
||||
@@ -192,6 +193,14 @@ pub(crate) async fn build_admin_create_provider_key_record(
|
||||
key.health_by_format = Some(json!({}));
|
||||
key.circuit_breaker_by_format = Some(json!({}));
|
||||
key.auth_type_by_format = auth_type_by_format;
|
||||
let allow_auth_channel_mismatch_formats = payload
|
||||
.allow_auth_channel_mismatch_formats
|
||||
.unwrap_or_else(|| Some(api_formats.clone()));
|
||||
key.allow_auth_channel_mismatch_formats = normalize_allow_auth_channel_mismatch_formats(
|
||||
allow_auth_channel_mismatch_formats,
|
||||
"allow_auth_channel_mismatch_formats",
|
||||
&api_formats,
|
||||
)?;
|
||||
key.created_at_unix_ms = Some(now_unix_secs);
|
||||
key.updated_at_unix_secs = Some(now_unix_secs);
|
||||
Ok(key)
|
||||
|
||||
Reference in New Issue
Block a user