From 43ad22046cda28ce8cf8ffa096f3bc279166251f Mon Sep 17 00:00:00 2001 From: Ben Rometsch Date: Mon, 1 Nov 2021 14:55:11 +0000 Subject: [PATCH] Add Public security definition to Swagger (#447) (#454) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add Public security definition to Swagger (#447) Add Public security definition to Swagger settings as described in #446 * Formatting * flake8 Co-authored-by: Milan Jaroš --- api/app/settings/common.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/api/app/settings/common.py b/api/app/settings/common.py index 74b7e042794e..1d261d4de02d 100644 --- a/api/app/settings/common.py +++ b/api/app/settings/common.py @@ -319,10 +319,22 @@ SWAGGER_SETTINGS = { "SHOW_REQUEST_HEADERS": True, "SECURITY_DEFINITIONS": { - "api_key": {"type": "apiKey", "in": "header", "name": "Authorization"} + "Private": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "Every time you create a new Project Environment, an environment API key is automatically generated for you. This is all you need to pass in to get access to Flags etc.
Example value:
Token 884b1b4c6b4ddd112e7a0a139f09eb85e8c254ff", # noqa + }, + "Public": { + "type": "apiKey", + "in": "header", + "name": "X-Environment-Key", + "description": "Things like creating new flags, environments, toggle flags or indeed anything that is possible from the administrative front end.
Example value:
FFnVjhp7xvkT5oTLq4q788", # noqa + }, }, } + LOGIN_URL = "/admin/login/" LOGOUT_URL = "/admin/logout/"