diff --git a/README.md b/README.md index 3d2b239..a38e56d 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ services: # The password used to log in to the voucher portal Web UI AUTH_INTERNAL_PASSWORD: '0000' # The Bearer token used for the API - AUTH_TOKEN: '00000000-0000-0000-0000-000000000000' + AUTH_INTERNAL_BEARER_TOKEN: '00000000-0000-0000-0000-000000000000' # Toggle to enable/disable OIDC authentication AUTH_OIDC_ENABLED: 'false' # OIDC issuer base url provided by oauth provider. Example: https://auth.example.com/.well-known/openid-configuration @@ -230,7 +230,7 @@ the different endpoints available in the API: ``` > This endpoint is protected by a security mechanism. To access it, users need to include a bearer token in the - request authorization header. The token must match the value of the `AUTH_TOKEN` environment variable. Without + request authorization header. The token must match the value of the `AUTH_INTERNAL_BEARER_TOKEN` environment variable. Without this token, access to the endpoint will be denied. 4. **`/api/vouchers`** @@ -269,7 +269,7 @@ the different endpoints available in the API: ``` > This endpoint is protected by a security mechanism. To access it, users need to include a bearer token in the -request authorization header. The token must match the value of the `AUTH_TOKEN` environment variable. Without +request authorization header. The token must match the value of the `AUTH_INTERNAL_BEARER_TOKEN` environment variable. Without this token, access to the endpoint will be denied. ## Authentication @@ -509,6 +509,10 @@ When upgrading from 3.x to 4.x, the following changes need to be made: - **`AUTH_PASSWORD`** has been renamed to **`AUTH_INTERNAL_PASSWORD`**. - Update your environment variable to use `AUTH_INTERNAL_PASSWORD` if you rely on internal authentication. +5. **Bearer Token Variable Rename** + - **`AUTH_TOKEN`** has been replaced by **`AUTH_INTERNAL_BEARER_TOKEN`**. + - Update your environment variable to use `AUTH_INTERNAL_BEARER_TOKEN` for api bearer token authentication. + ### Migration from 2.x to 3.x When upgrading from 2.x to 3.x, the following changes need to be made: diff --git a/docker-compose.yml b/docker-compose.yml index 26e8ad9..128a671 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,7 @@ services: UNIFI_SSID_PASSWORD: '' AUTH_INTERNAL_ENABLED: 'true' AUTH_INTERNAL_PASSWORD: '0000' - AUTH_TOKEN: '00000000-0000-0000-0000-000000000000' + AUTH_INTERNAL_BEARER_TOKEN: '00000000-0000-0000-0000-000000000000' AUTH_OIDC_ENABLED: 'false' AUTH_OIDC_ISSUER_BASE_URL: '' AUTH_OIDC_APP_BASE_URL: '' diff --git a/modules/variables.js b/modules/variables.js index 00d8d3f..384d31b 100644 --- a/modules/variables.js +++ b/modules/variables.js @@ -20,7 +20,7 @@ module.exports = { serviceApi: config('service_api') || (process.env.SERVICE_API === 'true') || false, authInternalEnabled: config('auth_internal_enabled') !== null ? config('auth_internal_enabled') : process.env.AUTH_INTERNAL_ENABLED ? process.env.AUTH_INTERNAL_ENABLED !== 'false' : true, authInternalPassword: config('auth_internal_password') || process.env.AUTH_INTERNAL_PASSWORD || '0000', - authToken: config('auth_token') || process.env.AUTH_TOKEN || '00000000-0000-0000-0000-000000000000', + authToken: config('auth_internal_bearer_token') || process.env.AUTH_INTERNAL_BEARER_TOKEN || '00000000-0000-0000-0000-000000000000', authOidcEnabled: config('auth_oidc_enabled') || (process.env.AUTH_OIDC_ENABLED === 'true') || false, authOidcIssuerBaseUrl: config('auth_oidc_issuer_base_url') || process.env.AUTH_OIDC_ISSUER_BASE_URL || '', authOidcAppBaseUrl: config('auth_oidc_app_base_url') || process.env.AUTH_OIDC_APP_BASE_URL || '',