jenkinsci / oidc-provider-plugin

OpenID Connect Provider Plugin for Jenkins
https://plugins.jenkins.io/oidc-provider/
MIT License
22 stars 13 forks source link

add regex replace support to ClaimTemplate #35

Open LeoQuote opened 8 months ago

LeoQuote commented 8 months ago

Add regex replace support in claim template, introducing more possibility to claims, like extract repo and org name from it

fix #34

This could be a good supplement for #6 , allowing users to replace and recreate claims using existing environments.

Known issues, I'm still figuring out how to fix:

Any suggestions are welcomed!

Testing done

it can replace the claim correctly, presenting jwt like

{
  "iss": "https://sa-jenkins.intra.xxx.com/oidc",
  "exp": 1703501635,
  "iat": 1703498035,
  "sub": "https://sa-jenkins.intra.xxx.com/",
  "build_number": 5,
  "org": "SA",
  "repo": "opa-policies"
}

it can fulfill my requirements.

Submitter checklist

LeoQuote commented 8 months ago

图片

this feature make it possible for the handler to know this pr is from a pull request or not

pserranoa commented 6 months ago

+1 good feature to manage authentication with bakends