feat(#2302): migrate dashboard to the single hive-host-sock Ident newtype

This commit is contained in:
damocles 2026-07-19 19:46:55 +02:00 committed by mara
commit 1286029947
10 changed files with 37 additions and 210 deletions

View file

@ -23,7 +23,7 @@ use axum::extract::{Form, Query};
use axum::response::{IntoResponse, Response};
use serde::{Deserialize, Serialize};
use super::{error_response, idents::PlainIdent};
use super::{Ident, error_response};
use crate::coordinator::Coordinator;
#[derive(Deserialize)]
@ -64,7 +64,7 @@ pub(super) struct ExtraForgesQuery {
/// sidecar when present. Never returns a token.
pub(super) async fn get_extra_forges(Query(q): Query<ExtraForgesQuery>) -> Response {
let agent = q.agent.trim();
let Ok(agent) = PlainIdent::parse(agent) else {
let Ok(agent) = Ident::parse(agent) else {
return error_response(&format!("extra-forges: invalid agent {agent:?}"));
};
let dir = Coordinator::agent_notes_dir(agent.as_str());
@ -130,10 +130,10 @@ struct ExtraForgeAccountResult {
pub(super) async fn post_extra_forge_account(Form(f): Form<ExtraForgeAccountForm>) -> Response {
let agent = f.agent.trim();
let label = f.label.trim();
let Ok(agent) = PlainIdent::parse(agent) else {
let Ok(agent) = Ident::parse(agent) else {
return error_response(&format!("extra-forge-account: invalid agent {agent:?}"));
};
let Ok(label) = PlainIdent::parse(label) else {
let Ok(label) = Ident::parse(label) else {
return error_response(&format!("extra-forge-account: invalid label {label:?}"));
};