Skip to content

refactor: deduplicate KMS auth helpers#581

Merged
kvinwang merged 2 commits intomasterfrom
refactor/dedup-kms-auth-helpers
Mar 20, 2026
Merged

refactor: deduplicate KMS auth helpers#581
kvinwang merged 2 commits intomasterfrom
refactor/dedup-kms-auth-helpers

Conversation

@kvinwang
Copy link
Collaborator

Summary

  • Move shared helper functions (dstack_client, app_attest, pad64, ensure_self_kms_allowed, ensure_kms_allowed) from onboard_service.rs into upgrade_authority.rs and reuse them
  • Remove the no-op ensure_remote_kms_allowed wrapper that just delegated to ensure_kms_allowed
  • Clean up unused imports (DstackGuestClient, AttestResponse, RawQuoteArgs, PrpcClient)

Net result: -23 lines, no behavior change.

Follow-up to #573.

Test plan

  • cargo check -p dstack-kms passes
  • cargo clippy -p dstack-kms --all-targets -- -D warnings passes

…thority

Move shared helper functions (dstack_client, app_attest, pad64,
ensure_self_kms_allowed, ensure_kms_allowed) into upgrade_authority.rs
and reuse them from onboard_service.rs. Remove the no-op
ensure_remote_kms_allowed wrapper.
- Add QEMU user-mode networking note (host at 10.0.2.2 from CVM)
- Document empty osImageHash in remote KMS attestation and the need
  for "0x" in osImages for receiver-side onboard checks
- Recommend port forwarding over gateway for simpler test setup
- Note that source_url must be CVM-reachable, not 127.0.0.1
- Update auth config templates with "0x" in osImages
@kvinwang kvinwang merged commit d147c75 into master Mar 20, 2026
14 checks passed
kvinwang added a commit that referenced this pull request Mar 20, 2026
- Note 10 (empty osImageHash) is no longer applicable: new KMS uses
  unified PHALA_RATLS_ATTESTATION cert format, and old KMS source
  attestation gets os_image_hash filled from local KMS automatically
- Remove "0x" entries from auth config templates
- Update PR references and remove stale PR #538 dependency note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant