Skip to content

Request: Support base64 decode as a Jinja plugin (for configuration yaml files) #5754

@JohnSchlerf

Description

@JohnSchlerf

Context:

I run SQLMesh on a shared system that connects to BigQuery. BigQuery authentication keys are stored as long JSON files that (in my setup, at least) don't work nicely as environment variables. The "workaround" that seems effective (...in my setup, at least) is to base64 encode the JSON file contents and store that as an environment variable. I can then use a script to decode the environment variable, write the blob to a file, and then have SQLMesh configured to read the key from that file. It works, albeit somewhat clunkily.

Request:

It would be a nice enhancement to have a Jinja2 filter built in for this. Ansible packages something like this with their Jinja2 filter; the code they use is here:
https://github.com/ansible/ansible/blob/ed7623ecdec8585282ce91f1534d02e6a38c22a4/lib/ansible/plugins/filter/core.py#L377

This would let me just run SQLmesh directly from the command line and pull my credentials from the environment, rather than needing to explicitly decode the secret beforehand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions