Skip to content

Dev#110

Open
vsilent wants to merge 11 commits intomainfrom
dev
Open

Dev#110
vsilent wants to merge 11 commits intomainfrom
dev

Conversation

@vsilent
Copy link
Collaborator

@vsilent vsilent commented Feb 18, 2026

No description provided.

vsilent added 11 commits February 16, 2026 10:09
When SSH authentication fails, the validate response now includes
the public key stored in Vault so you can compare it with what's in
the server's authorized_keys file to debug key mismatches.
Per CORS spec, Access-Control-Allow-Headers: * does not cover
Authorization when credentials mode is used. Replaced allow_any_header()
with explicit allowed_headers list including Authorization, Content-Type,
Accept, Origin, and X-Requested-With. Also removed supports_credentials()
since the API uses Bearer tokens (not cookies), and allow_any_origin()
is incompatible with credentials mode per spec.
The PUT /server/{id} endpoint was creating a fresh Server model from
the form data, overwriting ALL columns. If the form omitted srv_ip
(or any other field), it would be set to NULL in the database.

Now explicitly preserves existing DB values for any field that is
None in the incoming form: srv_ip, ssh_port, ssh_user, name,
cloud_id, region, zone, server, os, disk_type, vault_key_path,
and key_status.
Critical bugs:
1. saved_item() hardcoded routing to tfa, now uses connector
2. Connector routes to own flow when server has existing IP
3. srv_ip preserved with .or() pattern in both endpoints
4. item() now handles server_id for existing servers
- Auto-generate SSH keypair and store in Vault when creating a new server
  during deployment (both item() and saved_item() endpoints). This ensures
  vault_key_path is populated on the server record for future SSH access.
- In item() endpoint, capture cloud insert result so cloud_creds.id is
  available, then set server.cloud_id from saved cloud credentials.
- Use .or() pattern for zone in update paths to prevent overwriting
  existing zone with None when form doesn't provide it.
- Add VaultClient as web::Data parameter to both deploy endpoints.
Migration 20260204120000 registered rules with '/api/v1/project/:id/...'
but the actual routes are mounted at '/project/:id/...'. This caused
Casbin to reject all GET /project/:id/containers/discover requests with
403, which the browser then reported as a CORS error because the CORS
middleware never got to add 'Access-Control-Allow-Origin' to the response.

Fixes: container discovery 403 / CORS header missing regression
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

Comments