<#4005 [BUG] Vault Secret Manager Plugin mishandle...
# flyte-github
c
#4005 [BUG] Vault Secret Manager Plugin mishandles response for
group_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
...
Copy code
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:
Copy code
{ 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):
Copy code
(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/flyte