registry: add sqlx checks for auth profile reads
This commit is contained in:
@@ -665,18 +665,6 @@ fn map_operation_agent_ref(row: &PgRow) -> Result<OperationAgentRef, RegistryErr
|
||||
})
|
||||
}
|
||||
|
||||
fn map_auth_profile(row: &PgRow) -> Result<AuthProfile, RegistryError> {
|
||||
Ok(AuthProfile {
|
||||
id: crank_core::AuthProfileId::new(row.try_get::<String, _>("id")?),
|
||||
workspace_id: WorkspaceId::new(row.try_get::<String, _>("workspace_id")?),
|
||||
name: row.try_get("name")?,
|
||||
kind: deserialize_enum_text(&row.try_get::<String, _>("kind")?, "kind")?,
|
||||
config: deserialize_json_value(row.try_get::<Json<Value>, _>("config_json")?.0)?,
|
||||
created_at: row.try_get("created_at")?,
|
||||
updated_at: row.try_get("updated_at")?,
|
||||
})
|
||||
}
|
||||
|
||||
fn map_agent_binding(row: &PgRow) -> Result<AgentOperationBinding, RegistryError> {
|
||||
Ok(AgentOperationBinding {
|
||||
operation_id: OperationId::new(row.try_get::<String, _>("operation_id")?),
|
||||
@@ -758,6 +746,26 @@ fn build_operation_summary(
|
||||
})
|
||||
}
|
||||
|
||||
fn build_auth_profile(
|
||||
id: String,
|
||||
workspace_id: String,
|
||||
name: String,
|
||||
kind: String,
|
||||
config_json: Value,
|
||||
created_at: String,
|
||||
updated_at: String,
|
||||
) -> Result<AuthProfile, RegistryError> {
|
||||
Ok(AuthProfile {
|
||||
id: crank_core::AuthProfileId::new(id),
|
||||
workspace_id: WorkspaceId::new(workspace_id),
|
||||
name,
|
||||
kind: deserialize_enum_text(&kind, "kind")?,
|
||||
config: deserialize_json_value(config_json)?,
|
||||
created_at,
|
||||
updated_at,
|
||||
})
|
||||
}
|
||||
|
||||
fn build_agent_version_record(
|
||||
summary: &AgentSummary,
|
||||
version: i32,
|
||||
|
||||
Reference in New Issue
Block a user