]> git.ipfire.org Git - thirdparty/pdns.git/commit - lgtm.yml
auth: Add /api/docs endpoint to obtain OpenAPI document 8911/head
authorKevin P. Fleming <kevin@km6g.us>
Tue, 10 Nov 2020 12:29:39 +0000 (07:29 -0500)
committerKevin P. Fleming <kevin@km6g.us>
Tue, 10 Nov 2020 18:34:47 +0000 (13:34 -0500)
commit917f686a035e6039f8a4f318c4a93fc3a282d5e8
tree1a584f73c33fac7c0eb4500efe9a1c855156b760
parentb33d85d3b0c69293c518ba3522916a8b34237681
auth: Add /api/docs endpoint to obtain OpenAPI document

This patch adds an /api/docs endpoint to the API webserver,
allowing clients to obtain the OpenAPI (Swagger) document that
describes the server's API directly from the server.

It also modifies the response body mechanism in the webserver
to no longer assume JSON output, but allow handlers to specify
JSON, YAML, or plain text. It also adds detection of YAML
support in the request so that handlers can choose which type
to send in their response. Since there is not yet a standard
MIME type for YAML, 'application/x-yaml' is used since it
appears to be the most commonly used type.

Signed-off-by: Kevin P. Fleming <kevin@km6g.us>
17 files changed:
.github/actions/spell-check/expect.txt
.github/workflows/codeql-analysis.yml
docs/http-api/index.rst
docs/http-api/swagger/authoritative-api-swagger.yaml
ext/Makefile.am
lgtm.yml
m4/pdns_check_virtualenv.m4
pdns/.gitignore
pdns/Makefile.am
pdns/incfiles [new file with mode: 0755]
pdns/requirements.txt [new file with mode: 0644]
pdns/webserver.cc
pdns/webserver.hh
pdns/ws-api.cc
pdns/ws-auth.cc
pdns/ws-auth.hh
pdns/ws-recursor.cc