Closed agupta01 closed 5 months ago
Add
'{"auth_backends": "airflow.api.auth.backend.default"}'
toMWAA__CORE__CUSTOM_AIRFLOW_CONFIGS
We should add this environment variable ourselves, instead of expecting the user to set the auth type to none
, and then manually set the auth backend.
Also, I assume you meant AIRFLOW__API__AUTH_BACKENDS
config, right? If that's the case, then basically you need to add a function for the API
configuration in this file, something like:
def _get_essential_airflow_api_config() -> Dict[str, str]:
api_config = {}
if os.environ.get("MWAA__CORE__AUTH_TYPE", "").lower() == "none":
api_config["AIRFLOW__API__AUTH_BACKENDS"] = "airflow.api.auth.backend.default"
return api_config
@rafidka Thanks for the feedback — I agree, user setting MWAA__CORE__CUSTOM_AIRFLOW_CONFIGS="none"
should be all they need to do to disable auth. I made the proposed change of moving the config to airflow.py
and tested it.
Description of changes:
This adds the ability to disable authentication in the local runner. (NOTE: this should only be used in non-production environments).
Usage
In order to fully disable auth:
MWAA__CORE__AUTH_TYPE
to"none"
'{"auth_backends": "airflow.api.auth.backend.default"}'
toMWAA__CORE__CUSTOM_AIRFLOW_CONFIGS
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.