Skip to content

Add API key host enrollment endpoint#1029

Open
ZacharyZcR wants to merge 1 commit into
Termix-SSH:dev-2.5.1from
ZacharyZcR:feature/support-951-host-enrollment
Open

Add API key host enrollment endpoint#1029
ZacharyZcR wants to merge 1 commit into
Termix-SSH:dev-2.5.1from
ZacharyZcR:feature/support-951-host-enrollment

Conversation

@ZacharyZcR

@ZacharyZcR ZacharyZcR commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

  • add POST /host/enroll for scriptable host enrollment with existing tmx_ API keys
  • scope enrolled hosts to the user assigned to the API key and reuse the existing encrypted host creation path
  • provide safe SSH defaults for minimal payloads and explicit API_KEY_REQUIRED / DATA_LOCKED responses
  • document the endpoint in OpenAPI and cover its authentication and defaulting behavior

Example

curl -X POST https://termix.example/host/enroll -H "Authorization: Bearer tmx_..." -H "Content-Type: application/json" --data-binary @host.json
{"ip":"server.example","name":"server-01","tags":["auto-enrolled"]}

The API key user must have an active unlocked session because host secrets remain protected by the existing per-user encryption boundary.

Validation

  • npm test -- src/backend/database/routes/host-enrollment-auth.test.ts
  • npm run type-check
  • npm run lint
  • npm run build
  • targeted ESLint and Prettier checks

Fixes Termix-SSH/Support#951

Issue: Termix-SSH/Support#951

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