From 42b17031d8d183ae8e55343ece99c7601d96004a Mon Sep 17 00:00:00 2001 From: Juan Valacco <17687371+valack@users.noreply.github.com> Date: Wed, 22 May 2024 13:29:29 -0300 Subject: [PATCH] auth0 env vars naming homologation -- improve descriptions on example env vars files (#492) Co-authored-by: Juan Valacco <97040903+jvalacco-dataherald@users.noreply.github.com> --- services/admin-console/.env.example | 15 +++++++-------- services/enterprise/.env.example | 8 ++++---- services/enterprise/README.md | 2 +- services/enterprise/config.py | 2 +- services/slackbot/.env.example | 11 +++++------ 5 files changed, 18 insertions(+), 20 deletions(-) diff --git a/services/admin-console/.env.example b/services/admin-console/.env.example index e477af09..0f9beb39 100644 --- a/services/admin-console/.env.example +++ b/services/admin-console/.env.example @@ -1,16 +1,15 @@ NODE_ENV="development" # development | production # API URL -NEXT_PUBLIC_API_URL='http://localhost:3001' +NEXT_PUBLIC_API_URL='http://localhost:3001' # enterprise API service url # AUTH 0 CONFIG -AUTH0_BASE_URL='http://localhost:3000' -AUTH0_SCOPE='openid profile email offline_access' -AUTH0_SECRET='use [openssl rand -hex 32] to generate a 32 bytes value' -AUTH0_ISSUER_BASE_URL='{yourIssuer}' -AUTH0_API_AUDIENCE='{yourAudience}' -AUTH0_CLIENT_ID='{yourClientId}' -AUTH0_CLIENT_SECRET='{yourClientSecret}' +AUTH0_BASE_URL='http://localhost:3000' # admin-console url +AUTH0_SECRET= # use [openssl rand -hex 32] to generate a 32 bytes value +AUTH0_ISSUER_BASE_URL= # your auth0 issuer url, i.e.: https://auth.dataherald.com/ +AUTH0_API_AUDIENCE= # your auth0 API audience, i.e.: https://dataherald.us.auth0.com/api/v2/ +AUTH0_CLIENT_ID= # your auth0 application client ID +AUTH0_CLIENT_SECRET= # your auth0 application client secret # (OPTIONAL) Posthog Analytics NEXT_PUBLIC_POSTHOG_DISABLED='true' diff --git a/services/enterprise/.env.example b/services/enterprise/.env.example index 9d5f35ce..447b0988 100644 --- a/services/enterprise/.env.example +++ b/services/enterprise/.env.example @@ -1,13 +1,13 @@ -ENGINE_URL=http://{DOCKER_CONTAINER_NAME:PORT}/api/v1 # example: http://engine/api/v1 (port 80 by default) +ENGINE_URL= # http://{DOCKER_CONTAINER_NAME:PORT}/api/v1 -- example: http://engine/api/v1 (port 80 by default) MONGODB_DB_NAME=dataherald MONGODB_URI=mongodb://admin:admin@mongodb:27017 #The encryption key should be the same as the one used in engine ENCRYPT_KEY= -AUTH0_DOMAIN='{yourDomain}' -AUTH0_ISSUER='https://{yourDomain}/' -AUTH0_API_AUDIENCE='{yourAudience}' +AUTH0_DOMAIN= # your auth0 domain, i.e.: auth.dataherald.com +AUTH0_ISSUER_BASE_URL= # your auth0 issuer url, i.e.: https://auth.dataherald.com/ +AUTH0_API_AUDIENCE= # your auth0 API audience, i.e.: https://dataherald.us.auth0.com/api/v2/ # AUTH0_DISABLED creates a mock authentication token type for testing purposes # you can provide an email as the bearer token, note that the admin console will not be able to authenticate AUTH0_DISABED=False diff --git a/services/enterprise/README.md b/services/enterprise/README.md index 77ee24b3..2de27377 100644 --- a/services/enterprise/README.md +++ b/services/enterprise/README.md @@ -33,7 +33,7 @@ docker-compose up To connect to Auth0 you will need to fill in the following environment variables before running the app: ``` AUTH0_DOMAIN= -AUTH0_ISSUER= +AUTH0_ISSUER_BASE_URL= AUTH0_API_AUDIENCE= AUTH0_DISABED=False ``` diff --git a/services/enterprise/config.py b/services/enterprise/config.py index 1836608e..85133ae7 100644 --- a/services/enterprise/config.py +++ b/services/enterprise/config.py @@ -64,7 +64,7 @@ class AuthSettings(BaseSettings): auth0_domain: str = os.environ.get("AUTH0_DOMAIN") auth0_algorithms: str = os.environ.get("AUTH0_ALGORITHMS", "RS256") auth0_audience: str = os.environ.get("AUTH0_API_AUDIENCE") - auth0_issuer: str = os.environ.get("AUTH0_ISSUER") + auth0_issuer: str = os.environ.get("AUTH0_ISSUER_BASE_URL") def __getitem__(self, key: str) -> Any: return getattr(self, key) diff --git a/services/slackbot/.env.example b/services/slackbot/.env.example index c71c419d..39cf5e19 100644 --- a/services/slackbot/.env.example +++ b/services/slackbot/.env.example @@ -15,11 +15,10 @@ SOCKET_MODE=true ################################################################################ ################################################################################ -AUTH0_DOMAIN='{yourDomain}' -AUTH0_API_AUDIENCE='{yourAudience}' -AUTH0_CLIENT_ID='{yourClientId}' -AUTH0_CLIENT_SECRET='{yourClientSecret}' +AUTH0_DOMAIN= # your auth0 domain, i.e.: auth.dataherald.com +AUTH0_API_AUDIENCE= # your auth0 API audience, i.e.: https://dataherald.us.auth0.com/api/v2/ +AUTH0_CLIENT_ID= # your auth0 application client ID +AUTH0_CLIENT_SECRET= # your auth0 application client secret - -API_URL=http://{DOCKER_CONTAINER_NAME:PORT} # example: http://api:3001 +API_URL= # http://{DOCKER_CONTAINER_NAME:PORT} -- example: http://api:3001 PORT=3000 \ No newline at end of file