mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-27 20:39:53 +01:00
feat(api): enforce API v1 security from the spec and harden problem responses
This commit is contained in:
parent
71c379ff44
commit
3e645959f8
13 changed files with 918 additions and 34 deletions
|
|
@ -29,6 +29,7 @@
|
|||
"tags": [
|
||||
"server"
|
||||
],
|
||||
"security": [],
|
||||
"summary": "Describe the server",
|
||||
"description": "Returns the public server description. No authentication required.\nAuthenticated requests will additionally receive the implemented capability modules\nonce authentication is available.\n",
|
||||
"responses": {
|
||||
|
|
@ -56,6 +57,7 @@
|
|||
"tags": [
|
||||
"server"
|
||||
],
|
||||
"security": [],
|
||||
"summary": "Get the OpenAPI document (JSON)",
|
||||
"description": "The bundled OpenAPI document of the running server version. Supports ETag revalidation.",
|
||||
"responses": {
|
||||
|
|
@ -89,6 +91,7 @@
|
|||
"tags": [
|
||||
"server"
|
||||
],
|
||||
"security": [],
|
||||
"summary": "Get the OpenAPI document (YAML)",
|
||||
"description": "The bundled OpenAPI document of the running server version. Supports ETag revalidation.",
|
||||
"responses": {
|
||||
|
|
@ -195,13 +198,23 @@
|
|||
"enum": [
|
||||
"validation",
|
||||
"unauthorized",
|
||||
"token_expired",
|
||||
"forbidden",
|
||||
"insufficient_scope",
|
||||
"not_found",
|
||||
"method_not_allowed",
|
||||
"setup_complete",
|
||||
"password_managed_externally",
|
||||
"payload_too_large",
|
||||
"rate_limited",
|
||||
"unavailable",
|
||||
"internal"
|
||||
]
|
||||
},
|
||||
"referenceId": {
|
||||
"type": "string",
|
||||
"description": "Present on internal errors. Quote it when reporting a problem; it tags the server's log lines for this request."
|
||||
},
|
||||
"errors": {
|
||||
"type": "array",
|
||||
"description": "Per-field failures. Present only when `code` is `validation`.",
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ paths:
|
|||
x-module: core
|
||||
x-stability-level: alpha
|
||||
tags: [server]
|
||||
security: []
|
||||
summary: Describe the server
|
||||
description: |
|
||||
Returns the public server description. No authentication required.
|
||||
|
|
@ -50,6 +51,7 @@ paths:
|
|||
x-module: core
|
||||
x-stability-level: alpha
|
||||
tags: [server]
|
||||
security: []
|
||||
summary: Get the OpenAPI document (JSON)
|
||||
description: The bundled OpenAPI document of the running server version. Supports ETag revalidation.
|
||||
responses:
|
||||
|
|
@ -71,6 +73,7 @@ paths:
|
|||
x-module: core
|
||||
x-stability-level: alpha
|
||||
tags: [server]
|
||||
security: []
|
||||
summary: Get the OpenAPI document (YAML)
|
||||
description: The bundled OpenAPI document of the running server version. Supports ETag revalidation.
|
||||
responses:
|
||||
|
|
@ -152,11 +155,20 @@ components:
|
|||
enum:
|
||||
- validation
|
||||
- unauthorized
|
||||
- token_expired
|
||||
- forbidden
|
||||
- insufficient_scope
|
||||
- not_found
|
||||
- method_not_allowed
|
||||
- setup_complete
|
||||
- password_managed_externally
|
||||
- payload_too_large
|
||||
- rate_limited
|
||||
- unavailable
|
||||
- internal
|
||||
referenceId:
|
||||
type: string
|
||||
description: Present on internal errors. Quote it when reporting a problem; it tags the server's log lines for this request.
|
||||
errors:
|
||||
type: array
|
||||
description: Per-field failures. Present only when `code` is `validation`.
|
||||
|
|
|
|||
|
|
@ -23,11 +23,20 @@ properties:
|
|||
enum:
|
||||
- validation
|
||||
- unauthorized
|
||||
- token_expired
|
||||
- forbidden
|
||||
- insufficient_scope
|
||||
- not_found
|
||||
- method_not_allowed
|
||||
- setup_complete
|
||||
- password_managed_externally
|
||||
- payload_too_large
|
||||
- rate_limited
|
||||
- unavailable
|
||||
- internal
|
||||
referenceId:
|
||||
type: string
|
||||
description: Present on internal errors. Quote it when reporting a problem; it tags the server's log lines for this request.
|
||||
errors:
|
||||
type: array
|
||||
description: Per-field failures. Present only when `code` is `validation`.
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ json:
|
|||
x-module: core
|
||||
x-stability-level: alpha
|
||||
tags: [server]
|
||||
security: []
|
||||
summary: Get the OpenAPI document (JSON)
|
||||
description: The bundled OpenAPI document of the running server version. Supports ETag revalidation.
|
||||
responses:
|
||||
|
|
@ -25,6 +26,7 @@ yaml:
|
|||
x-module: core
|
||||
x-stability-level: alpha
|
||||
tags: [server]
|
||||
security: []
|
||||
summary: Get the OpenAPI document (YAML)
|
||||
description: The bundled OpenAPI document of the running server version. Supports ETag revalidation.
|
||||
responses:
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ get:
|
|||
x-module: core
|
||||
x-stability-level: alpha
|
||||
tags: [server]
|
||||
security: []
|
||||
summary: Describe the server
|
||||
description: |
|
||||
Returns the public server description. No authentication required.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue