From 3ea144f00a73aefc8e0c1c2a2b9bef7a213be75c Mon Sep 17 00:00:00 2001 From: sanchegm Date: Wed, 11 Dec 2024 17:05:03 -0800 Subject: [PATCH] Add documentation - Add documentation about API Keys --- .env.template | 2 +- doc/tutorial.md | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.env.template b/.env.template index 04f3eb3..9df9be3 100644 --- a/.env.template +++ b/.env.template @@ -22,4 +22,4 @@ export AFFILS_AWS_S3_ACL="placeholder" # Django stuff export DJANGO_SECRET_KEY="placeholder" -export API_KEY="placeholder" +export AFFILS_API_KEY="placeholder" diff --git a/doc/tutorial.md b/doc/tutorial.md index caf77ec..9781b09 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -48,3 +48,24 @@ oriented towards learning how rather than learning what. variables as needed): `logger = logging.getLogger("watchtower")` `logger.info(f"Affiliation Created:\\n\\n {Affiliation.full_name} (PK: {Affiliation.pk})")` - The desired log line will appear in the selected logging handler. + +## API Key Information + +- We are utilizing + [Django REST Framework API Key](https://florimondmanca.github.io/djangorestframework-api-key/) + package to support the use of API keys. + +### API KEY + +- If you are in need of an API Key, please reach out to one of the website + administrators or your admin user to obtain an API Key. +- Upon creating an API key from the admin, the full API key is shown only once + in a success message banner. After creation, only the prefix of the API key is + shown in the admin site, mostly for identification purposes. If you lose the + full API key, you'll need to regenerate a new one. + +### Authorization header + +By default, clients must pass their API key via the Authorization header. It +must be formatted as follows: `Authorization: X-Api-Key ` where +\ refers to the full generated API key