cuddly-jelly-27016
05/24/2025, 12:09 AMgroup_version="db"
Issue created by EternalDeiwos
### Describe the bug
Vault kv2 works well enough and the service allows deep referencing of specific values in the group parameter past the .../data/... part of the path. This is not the case for group_version="db" where the resulting credentials cannot be deeply referenced. See documentation.
The difficulty is when I specify a secret for a SQLAlchemyTask...
secrets = {
"user": Secret(
group="mydb/creds/test_role", key="username", group_version="db"
),
"password": Secret(
group="mydb/creds/test_role", key="password", group_version="db"
),
}
sql_task = SQLAlchemyTask(
"sql_query",
query_template="""
select version()
""",
output_schema_type=DataSchema,
task_config=SQLAlchemyConfig(
uri="postgresql://host:1234/test",
secret_connect_args=secrets,
),
secret_requests=[*secrets.values()],
)
... the value returned by current_context().secret.get() in this context is a dict which looks like:
{ username: "...", password: "..." }
This results in errors being produced because the task is expecting a string value for username and password respectively and not a dict. I suspect this is because the result of the API call to vault is not flat and rather is nested under the data property name.
### Expected behavior
Dynamically generated credentials from Vault Database Engine should be passed to SQLAlchemy in the format it is expecting (i.e. strings not a dict).
### Additional context to reproduce
Running the workflow produced this error message (carefully redacted):
(psycopg2.OperationalError) connection to server at "host", port 1234 failed: FATAL: password authentication failed for user "{"password":"...","username":"..."
### Screenshots
No response
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flytecuddly-jelly-27016
05/24/2025, 12:09 AMgroup_version="db"
Issue closed as not planned by github-actions[bot]
flyteorg/flyte