Different value served to Gitlab from KV path based on policy/role?

Hey, got an idea for how to deal with some secrets in vault, and just want to validate if It’s possible or not.

I’m using GitLab CI and I authenticate with JWT tokens.
And based on some parameter. Like protected or not, environment name etc. I want to serve different values. Basically just something available in a bound token.

Right now, I can fix it by adding different path references in GitLab, pointing to the different values. But it would be awesome if I could point all the variables to the same path and then based on some magic in the policy make the resolution.

Would it be possible to add a template variable to the path reference in GitLab, for example?

I don’t really understand what you what.
What I do:
login with the branch in the role "role=“gitlab-project-$CI_COMMIT_BRANCH” (to get different policies based on the projet/branch)
And use a path like: