Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add go templating to OIDC role templates #27546

Open
EtienneBruines opened this issue Jun 20, 2024 · 0 comments
Open

Add go templating to OIDC role templates #27546

EtienneBruines opened this issue Jun 20, 2024 · 0 comments

Comments

@EtienneBruines
Copy link

EtienneBruines commented Jun 20, 2024

Is your feature request related to a problem? Please describe.
I am wanting to generate a JWT using the Identity secret engine, but am unable to add a prefix/suffix to my strings, nor am I able to modify capitalization or anything.

Describe the solution you'd like
Something like this to become possible as a template:

{
    "id": {{"job:"+identity.entity.aliases.auth_jwt_7818b1f8.metadata.nomad_job_id}}
}

Describe alternatives you've considered

  • Attempting to modify the value of the metadata when it goes from the auth token to the metadata (is not supported, only direct JSON pointers to a single value).
  • Attempting to modify the value (or add a new value) at the Nomad side of things that includes a more complex string (is not supported, Add arbitrary claims to a job's workload identity nomad#19438)
  • Attempting to not require use of this, but not all applications offer this flexibility (e.g. SurrealDB requires the id field to be of the format table:id)

Explain any additional use-cases

  • Adding a suffix/prefix
  • Modify capitalization (all-caps, all-lowercase)
  • Combining multiple metadata fields into one

Additional information
It doesn't have to be go templating - it can be anything that's a bit more flexible than this. Even allowing this would be helpful:

{
    "id": "job:{{identity.entity.aliases.auth_jwt_7818b1f8.metadata.nomad_job_id}}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants