core: type auth profile timestamps

This commit is contained in:
a.tolmachev
2026-04-12 22:20:19 +00:00
parent e03d4da925
commit edf318ba67
10 changed files with 90 additions and 42 deletions
+6 -6
View File
@@ -389,8 +389,8 @@ impl PostgresRegistry {
.bind(&request.profile.name)
.bind(serialize_enum_text(&request.profile.kind, "kind")?)
.bind(Json(serialize_json_value(&request.profile.config)?))
.bind(&request.profile.created_at)
.bind(&request.profile.updated_at)
.bind(request.profile.created_at)
.bind(request.profile.updated_at)
.execute(&self.pool)
.await?;
@@ -409,8 +409,8 @@ impl PostgresRegistry {
name,
kind,
config_json,
to_char(created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",
to_char(updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"updated_at!\"
created_at as \"created_at!: OffsetDateTime\",
updated_at as \"updated_at!: OffsetDateTime\"
from auth_profiles
where workspace_id = $1 and id = $2",
workspace_id.as_str(),
@@ -444,8 +444,8 @@ impl PostgresRegistry {
name,
kind,
config_json,
to_char(created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",
to_char(updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"updated_at!\"
created_at as \"created_at!: OffsetDateTime\",
updated_at as \"updated_at!: OffsetDateTime\"
from auth_profiles
where workspace_id = $1
order by name asc",
+6 -6
View File
@@ -750,8 +750,8 @@ fn build_auth_profile(
name: String,
kind: String,
config_json: Value,
created_at: String,
updated_at: String,
created_at: OffsetDateTime,
updated_at: OffsetDateTime,
) -> Result<AuthProfile, RegistryError> {
Ok(AuthProfile {
id: crank_core::AuthProfileId::new(id),
@@ -1315,8 +1315,8 @@ mod tests {
header_name: "X-Api-Key".to_owned(),
secret_id: SecretId::new("secret_crank_api_key"),
}),
created_at: "2026-03-25T12:00:00Z".to_owned(),
updated_at: "2026-03-25T12:00:00Z".to_owned(),
created_at: timestamp("2026-03-25T12:00:00Z"),
updated_at: timestamp("2026-03-25T12:00:00Z"),
};
registry
@@ -1396,8 +1396,8 @@ mod tests {
username_secret_id: primary_secret_id.clone(),
password_secret_id: secondary_secret_id.clone(),
}),
created_at: "2026-03-25T12:00:00Z".to_owned(),
updated_at: "2026-03-25T12:00:00Z".to_owned(),
created_at: timestamp("2026-03-25T12:00:00Z"),
updated_at: timestamp("2026-03-25T12:00:00Z"),
};
registry