-
Notifications
You must be signed in to change notification settings - Fork 19
Description
What feature do you want to see added?
When using build scoped claims on a multi-branch pipeline the JOB_BASE_NAME
will always be present which makes the sub always unique per branch.
Given the following template: job:${JOB_NAME}
Would produce a sub like:
"sub": "job:random-branch-test/master",
However depending on your target system this can or cannot be handled, for example AWS iam conditions are flexible enough:
"StringLike": {
"jenkins.at.my.issuer.com:sub": "job:random-branch-test/*"
},
However azuread federated credentials are not, it needs to be an explicit match meaning id need to configure the name of every branch (and pull request) ahead of it running.
Proposal
Can we allow the claims template to utilise some groovy scripts to do much deeper configuration.
This would allow us todo things like determine if the multi-branch job is triggered from a pull request where would could create similar subjects to githubs pull_request events, e.g: repo:<orgName/repoName>:pull_request
but job bound like job:random-branch-test:pull_request
.
Given that the build templates are secured at the Jenkins administrator security level would this be acceptable?
Upstream changes
No response