ARO-29491 | feat: add key_vault_type field to AzureKmsEncryption for Managed HSM support #1193
All Vouch review confidence checks passed
Residual risk 0.33 = Change Risk (0.75) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.75 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.075
Real PR Conversation Timeline
1 comments
"Review active on #1193"
general
weight: 0.35
ahitacat
What
Adds a
key_vault_typeattribute toAzureKmsEncryptioninmodel/aro_hcp/v1alpha1, backed by a newAzureKmsEncryptionKeyVaultTypeenum (key_vault/managed_hsm).This unblocks Managed HSM support for customer-managed keys on ARO HCP: the RP currently has no way to tell Cluster Service which Azure service hosts a customer's key, because
arohcpv1alpha1.NewAzureKmsEncryption()only exposes what is declared here.Jira: ARO-29491 · epic ARO-27215
Semantics
The field is optional and defaults to
key_vaultwhen unset, which preserves behaviour for existing clusters. It applies to the whole KMS configuration rather than to an individual key, and is immutable after cluster creation.The model DSL enforces none of that — validation lands in Cluster Service (ARO-29425).
Why an enum rather than a full key URL
Two shapes were considered. The alternative was a single
key_encryption_key_urlstring, which was the initially preferred option on the ticket.The enum won on two grounds:
1. It matches what the consumer actually accepts. HyperShift's
AzureKMSKeyremains fully decomposed (keyVaultName/keyName/keyVersion, all required); openshift/hypershift#9199 addedAzureKMSSpec.keyVaultTypealongside it rather than moving to a URL. HyperShift treats the URL as an output, composing it from vault name plus a cloud-specific suffix.Azure/ARO-HCPmainis likewise still decomposed.2. It avoids permanent overlap. A key URL would name the same key that
ActiveKeyalready names, a second way. The coherent version of that design replaces the decomposed fields — which this repo cannot do, since attributes here are effectively unretractable. We would carry both representations forever with no way to express "exactly one of these" and no defined precedence when they disagree.KeyVaultTypeis orthogonal toActiveKey: one says which key, the other says which service hosts it.Full rationale, including the evidence gathered and the trade-off accepted, is recorded on ARO-29491.
Known trade-off: a URL is self-validating where an enum is not —
managedhsm.azure.netin a host proves the key store, whereaskey_vault_type: managed_hsmcan be set against a vault that is not one. HyperShift exportsazureutil.GetAzureEncryptionKeyInfo(url)for exactly this, so CS need not maintain its own suffix table.Naming
Wire values are
key_vault/managed_hsm, following the generator's existing snake_case behaviour (Public→"public"). These differ in case from HyperShift'sKeyVault/ManagedHSM, so Cluster Service maps between them.The DSL spells the enum value
ManagedHsmrather thanManagedHSMto avoid trailing-acronym mangling; the generated wire value was confirmed to bemanaged_hsm.Generated output
Follows PR #1149 (
ARO-24796, thevisibilityfield) — same struct, same 8-file shape. 31 hand-written lines, the rest generated bymake update.| File | |
|---|---|
|
model/aro_hcp/v1alpha1/azure_kms_encryption_type.model| hand-written ||
model/aro_hcp/v1alpha1/azure_kms_encryption_key_vault_type.model| hand-written, new ||
clientapi/arohcp/v1alpha1/azure_kms_encryption_type.go| generated ||
clientapi/arohcp/v1alpha1/azure_kms_encryption_builder.go| generated ||
clientapi/arohcp/v1alpha1/azure_kms_encryption_type_json.go| generated ||
clientapi/arohcp/v1alpha1/azure_kms_encryption_key_vault_type_type.go| generated, new ||
clientapi/arohcp/v1alpha1/azure_kms_encryption_key_vault_type_list_type_json.go| generated, new ||
openapi/aro_hcp/v1alpha1/openapi.json| generated |CHANGES.mdis intentionally untouched:auto-tag.yamlregenerates it at release time from commit subjects, so a manual entry would be clobbered. PR #1149 likewise did not add one.Compatibility
Adding this attribute shifts the generated
fieldSet_index ofvisibilityfrom 1 to 2, because the generator assigns bitmap indices alphabetically by attribute name rather than by declaration order.This is safe. The bitmap is never serialised — the JSON codec is name-keyed (
case \"visibility\":), allocatesfieldSet_fresh on unmarshal, and skips unknown fields viadefault: iterator.ReadAny(). Indices are internal to a single binary, where they are self-consistent by construction:key_vault_typeabsent,KeyVaultType()reports unset, treated askey_vault.key_vault_typeignored by thedefaultbranch;visibilitystill matched by name.Testing
make check— passesmake verify— passes (the CI gate)go build ./arohcp/...andgo vet— cleanmake lint— fails identically on unmodifiedmain; pre-existing and unrelated. Both changed.modelfiles were checked directly against the lint regex and are clean.Follow-ups
Releasing is automatic, not a manual step:
auto-tag.yamlfires on merge tomain, bumps the patch version, tags all four module paths and publishes a release, andsync-sdk.yamlthen dispatches toocm-sdk-go. Downstream consumption is tracked separately in Cluster Service (ARO-29425) and the RP (ARO-27779).Draft pending ARO approver sign-off on the field shape — flagging @miguelsorianod @machi1990, since this reverses the preference originally recorded on the ticket.
🤖 Generated with Claude Code