hussein-awala commented on issue #30368:
URL: https://github.com/apache/airflow/issues/30368#issuecomment-1491080026
Allowing backend DB to authenticate using temporary tokens (or other kind of
tokens) is a good new feature, but IMHO implementing a new method in Airflow
core only for AWS RDS is not a good idea.
Instead, we can add a new conf to tell Airflow which method it should use
for tokens (I prefer a generic method for all connection conf), something like:
```python
@event.listens_for(engine, "do_connect")
def provide_token(dialect, conn_rec, cargs, cparams):
sql_alchemy_amend_connection_method_path = conf.get("database",
"sql_alchemy_amend_connection_method")
if sql_alchemy_amend_connection_method_path:
sql_alchemy_amend_connection_method =
import_string(sql_alchemy_amend_connection_method_path)
sql_alchemy_amend_connection_method(cparams)
```
Then the user can implement his own method and provide its path to the
Airflow conf `database.sql_alchemy_amend_connection_method`, we can change the
method and the conf name if you have a better suggestion.
And maybe later in a separate PR, we add the amend method used for AWS RDS
tokens to the AWS provider. WDYT about this suggestion?
@potiuk I don't think he needs an AIP in this case, WDYT?
--
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]