Skip to content

feat(kms): enhance onboard page with site name, chain info, and k256 pubkey#571

Draft
Leechael wants to merge 6 commits intomasterfrom
feat/kms-onboard-page-enhancements
Draft

feat(kms): enhance onboard page with site name, chain info, and k256 pubkey#571
Leechael wants to merge 6 commits intomasterfrom
feat/kms-onboard-page-enhancements

Conversation

@Leechael
Copy link
Copy Markdown
Collaborator

@Leechael Leechael commented Mar 18, 2026

Summary

Enhance the KMS onboard page with additional attestation and chain information, and align all auth API implementations to expose the Ethereum RPC URL.

Changes

KMS Onboard Page (kms/src/www/onboard.html)

  • Display PPID above Device ID (raw hex, no 0x prefix)
  • Display Device ID with 0x prefix
  • Display Chain Info card when available:
    • ETH RPC URL
    • KMS Contract Address
  • Display custom site name in page title/heading when configured

KMS RPC Proto (kms/rpc/proto/kms_rpc.proto)

  • AttestationInfoResponse new fields:
    • string site_name = 5
    • string eth_rpc_url = 6
    • string kms_contract_address = 7
    • bytes ppid = 8

KMS Backend (kms/src/onboard_service.rs)

  • Extract raw ppid from verified TDX attestation report
  • Fetch eth_rpc_url / kms_contract_address from auth API
  • Populate all new AttestationInfoResponse fields

KMS Config (kms/src/config.rs, kms/kms.toml)

  • Add optional site_name field under [core]

Auth API Info Endpoint

  • kms/auth-eth/src/server.ts: add ethRpcUrl to GET / response
  • kms/auth-eth-bun/index.ts: add ethRpcUrl to GET / response
  • kms/auth-eth-bun/openapi.json: update SystemInfo schema with ethRpcUrl
  • kms/auth-eth-bun/index.test.ts: sync tests and schema assertions

Auth API Client (kms/src/main_service/upgrade_authority.rs)

  • AuthApiInfoResponse: add eth_rpc_url (with #[serde(default)])
  • GetInfoResponse: add eth_rpc_url: Option<String>

Auth Mock (kms/auth-mock/index.ts)

  • Add configurable authorization policies support

Builder Dockerfile (kms/dstack-app/builder/Dockerfile)

  • Use absolute paths in COPY --from=build-shared for BuildKit named context compatibility

Configuration Example

[core]
site_name = "My KMS"

[core.auth_api]
type = "webhook"

[core.auth_api.webhook]
url = "http://auth-api:8000"

Testing

  • cargo check -p dstack-kms -p dstack-kms-rpc
  • prek run
  • cd kms/auth-eth-bun && bun run test:run && bun run lint

@Leechael Leechael force-pushed the feat/kms-onboard-page-enhancements branch 7 times, most recently from a65e78e to 8e40de3 Compare March 20, 2026 05:39
…pubkey

- Add configurable site_name to core config, displayed as page title
  and heading on the onboard page for operator visibility.
- Read eth_rpc_url and kms_contract_address from auth-api instead of
  duplicating in onboard config. Display chain info in a separate card.
- Return k256_pubkey in OnboardResponse so it can be compared with the
  on-chain kmsInfo.k256Pubkey after onboarding.
Support MOCK_POLICY env var to control boot authorization behavior:
- allow-all (default): all requests allowed
- deny-kms: reject KMS self-authorization
- deny-app: reject app authorization
- deny-all: reject all requests
- allowlist-device: only allow specified MOCK_ALLOWED_DEVICE_IDS
- allowlist-mr: only allow specified MOCK_ALLOWED_MR_AGGREGATED
@Leechael Leechael force-pushed the feat/kms-onboard-page-enhancements branch from ba2df92 to 7bcb5c9 Compare April 16, 2026 18:45
@Leechael Leechael force-pushed the feat/kms-onboard-page-enhancements branch from 41dcb12 to f57d4d0 Compare April 16, 2026 22:58
@Leechael Leechael force-pushed the feat/kms-onboard-page-enhancements branch from f2e82de to 1f0ff46 Compare April 22, 2026 11:35
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