mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-14 18:59:08 +02:00
[management] Put the debug upload URL's https-and-host rule in the OpenAPI schema
The account handler rejects a non-empty value unless url.Parse yields scheme https and a host, but the schema said only "string", so a schema-driven consumer saw an unconstrained field and learned the contract from a 422. Add a pattern that allows "" for the fallback and otherwise requires https with a host. Regenerating types.gen.go produces no diff: our oapi-codegen config emits types only, so the pattern documents the contract rather than enforcing it in Go. The handler stays the thing that rejects. Reported by CodeRabbit and cubic on #7514.
This commit is contained in:
@@ -390,6 +390,7 @@ components:
|
||||
URL with a host. Empty falls back to the deployment-wide value configured on the management server, and with
|
||||
neither to the upload service NetBird runs.
|
||||
type: string
|
||||
pattern: '^$|^https://[^/?#:\s]+(:[0-9]+)?([/?#].*)?$'
|
||||
example: "https://upload.example.com/upload-url"
|
||||
agent_network_only:
|
||||
description: Limits the dashboard to the Agent Network surface for this account. Set for accounts created via netbird.ai signups and can be disabled later. Enabling this requires dashboard_features.agent_network to be true in the same request.
|
||||
|
||||
Reference in New Issue
Block a user