mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-24 16:41:30 +02:00
Lands the review decision from #7085: PUT keeps the API-wide convention of requiring every field. endpoint and proxy_address join the update schema as required fields, compared against the stored row (trimmed, case-folded) and rejected with 422 on mismatch. They are never written, so the identity stays immutable while the request shape stays conventional. Because the identity is immutable, clients that model change-as-replace (the Terraform provider's RequiresReplace) need a real delete. DELETE /api/agent-network/settings now exists with two guards, both checked under the row lock: no providers may exist for the account, and no active proxy may declare the endpoint hostname as its cluster address. Either refusal is a 412. The proxy guard checks the endpoint hostname rather than the proxy address: for a dedicated pin they are equal, and for a labeled pin the shared parent cluster being up says nothing about this account once its providers are gone. Re-creating after a delete allocates a fresh endpoint; the released hostname is not reserved. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>