Skip to content

Commit

Permalink
Allow boolean value for SKIP_ENV_CHECK
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoav Nahshon committed Jan 21, 2025
1 parent 963fabc commit 27727e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ In order to successfully enable the callback for the token-generation and token-
| `KEYCLOAK_VERIFY_HOST` | Controls whether SSL certificates are verified for HTTPS requests. Default is set to `False`. | "True" |
| `KEYCLOAK_REALM_ADMIN_USER` | User name of the realm admin, if any action shall be performed as admin in your Flask/FastAPI application. | "admin" |
| `KEYCLOAK_REALM_ADMIN_PASSWORD` | Password of the realm admin, if any action shall be performed as admin in your Flask/FastAPI application. | "admin_password" |
| `SKIP_ENV_CHECK` | Optional. If set, skips the check for mandatory environment variables during startup. | "1" |
| `SKIP_ENV_CHECK` | Optional. If set, skips the check for mandatory environment variables during startup. | "True" |

#### Note
- If `SKIP_ENV_CHECK` is set, the application will bypass the mandatory environment variable checks during startup. This is useful for development or testing scenarios where not all variables are needed.
Expand Down
2 changes: 1 addition & 1 deletion shieldapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def check_mandatory_env_vars():
Raises an EnvironmentError if any are missing.
"""
# Allow skipping the check if SKIP_ENV_CHECK is set
if os.environ.get("SKIP_ENV_CHECK"):
if os.environ.get("SKIP_ENV_CHECK", "").lower() in ["1", "true", "yes"]:
logger.info(
"Skipping mandatory environment variable check due to SKIP_ENV_CHECK."
)
Expand Down

0 comments on commit 27727e1

Please sign in to comment.