UAT bridge credential migration
This upgrade is additive. users.uuid, username, email, password hash, MFA
secret and MFA timestamps are read-only throughout the procedure.
- Take a transaction-consistent database backup and record row fingerprints
for
users(uuid, username, email, password, mfa_totp_secret, mfa_enabled). - Apply
migratectl migrate --dir sql/migrations. - Copy the UAT Xray config to the migration runner without editing it, then
run
migratectl import-xray-credentials --tenant-id <tenant> --xray-config <copy> --dry-run. - Review that every client id resolves through
users.proxy_uuid, then rerun without--dry-run. The command inserts onlybridge_credentialsrows using the client ids exactly as found in the config. - Compare the users fingerprint from step 1. It must be identical. Verify
credential_uuid = users.proxy_uuidfor each imported row.
No command in this procedure writes /usr/local/etc/xray/config.json, reloads
Xray, or connects to production/Tky Proxy.
Runtime environment contract
- Accounts:
BRIDGE_CREDENTIAL_TOKEN_PEPPERand its existingINTERNAL_SERVICE_TOKENmust be supplied from deployment secret management. - Bridge:
BRIDGE_ACCOUNTS_INTROSPECTION_URL,BRIDGE_ACCOUNTS_SERVICE_TOKEN(the same value as AccountsINTERNAL_SERVICE_TOKEN), andOPENCLAW_GATEWAY_SERVICE_TOKENare required. - Caddy carries the user
Authorizationheader unchanged; it holds no user credential. Bridge validates it with Accounts before task routing, then uses onlyOPENCLAW_GATEWAY_SERVICE_TOKENfor the OpenClaw connection. - Compatibility owner: XWorkmate App. The App accepts the legacy response key
BRIDGE_AUTH_TOKENonly whenbridgeCredential.tokenis absent. Remove that parser branch after the UAT migration has verified every supported App build.