lubimow-xwf commented on code in PR #70681:
URL: https://github.com/apache/airflow/pull/70681#discussion_r3878887080
##########
airflow-core/src/airflow/configuration.py:
##########
@@ -740,6 +741,55 @@ def get_custom_secret_backend(worker_mode: bool = False)
-> BaseSecretsBackend |
return conf._get_custom_secret_backend(worker_mode=worker_mode)
+class Backend(enum.Enum):
+ """Known secrets backends."""
+
+ ENVIRONMENT_VARIABLE = "environment_variable"
+ EXECUTION_API = "execution_api"
+ CUSTOM = "custom"
+ METASTORE = "metastore"
+
+ @classmethod
+ def from_module(cls, default_backend: str) -> Backend:
Review Comment:
Quickly regarding duplication. I know it's duplicated, I copied it myself :)
I wasn't aware there is a shared space, I thought you wanted core and sdk to be
fully decoupled. By the way, why don't you move DEFAULT_SECRETS_SEARCH_PATH to
shared space too? Wouldn't it be easier than having a script to compare them?
> The concrete failure: add a fourth backend to DEFAULT_SECRETS_SEARCH_PATH.
The hook stays green, because it only checks that the two constants match each
other and they both moved. Then initialize_secrets_backends raises ValueError:
Unknown module provided: <class path> on every start, in both core and the SDK.
That's not a failure. Adding a new backend to that list and not extending
the enum would be a bug. I think it's best to fail fast and let the developer
fix the issues.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]