idunn-provision prints the derived identity id of an enrolled store

provider-health-identity-id and host-actuator-identity-id are read-only.
The id is what a binding names as expected_signer_identity_id and what
a host is keyed by; deriving it here closes the gap where an operator
had to decode an anchor by hand to fill a binding.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-11 13:51:50 +02:00
commit ffaeae3829

View file

@ -49,6 +49,18 @@ pub fn run(args: impl IntoIterator<Item = String>) -> Result<()> {
let public_key = provider_health_public_key(&options)?;
println!("{public_key}");
}
"provider-health-identity-id" => {
println!(
"{}",
identity_id::<GameCultProviderHealthIdentity>(&options)?
);
}
"host-actuator-identity-id" => {
println!(
"{}",
identity_id::<crate::host_actuator::IdunnHostActuatorIdentity>(&options)?
);
}
"export-provider-health-public-anchor" => export_identity_anchor::<
GameCultProviderHealthIdentity,
>(
@ -127,6 +139,15 @@ fn enroll_provider_health_identity(options: &BTreeMap<String, String>) -> Result
encode_public_key(&signer.entry().public_key)
}
/// The profile-derived identity id of an enrolled private store, read-only.
/// This is the value an operator binding names as `expected_signer_identity_id`
/// or that a host binding is keyed by; it is derived, never typed.
fn identity_id<P: ServiceIdentityProfile>(options: &BTreeMap<String, String>) -> Result<String> {
require_only(options, &["private-store"])?;
let signer = open_service_identity_at::<P>(&path(options, "private-store")?)?;
Ok(signer.entry().identity_id.clone())
}
fn provider_health_public_key(options: &BTreeMap<String, String>) -> Result<String> {
require_only(options, &["private-store"])?;
let signer = open_service_identity_at::<GameCultProviderHealthIdentity>(&path(