Skip to content

refactor!: Pass OIDCSubjectClaimCustomTemplate by value in the OIDC subject-claim Set methods#4340

Open
JamBalaya56562 wants to merge 2 commits into
google:masterfrom
JamBalaya56562:refactor/3644-oidc-value-params
Open

refactor!: Pass OIDCSubjectClaimCustomTemplate by value in the OIDC subject-claim Set methods#4340
JamBalaya56562 wants to merge 2 commits into
google:masterfrom
JamBalaya56562:refactor/3644-oidc-value-params

Conversation

@JamBalaya56562

Copy link
Copy Markdown
Contributor

This continues the #3644 value-parameter refactor for the Actions OIDC subject-claim customization methods.

Pass the request body by value (refactor!)

  • Actions.SetOrgOIDCSubjectClaimCustomTemplate and Actions.SetRepoOIDCSubjectClaimCustomTemplate now take OIDCSubjectClaimCustomTemplate by value instead of by pointer, along with the shared setOIDCSubjectClaimCustomTemplate helper.
  • Renamed the SetRepoOIDCSubjectClaimCustomTemplate body parameter from template to body.
  • Removed OIDCSubjectClaimCustomTemplate from the paramcheck body-allowed-pointer-types allowlist in .golangci.yml.

The type stays shared between the Get* (response) and Set* (request) methods, matching existing by-value shared types such as RepositoryRuleset and CodeSecurityConfiguration.

Add two missing OpenAPI fields (feat)

  • UseImmutableSubject (use_immutable_subject) — present in both the org and repo request bodies and responses.
  • SubClaimPrefix (sub_claim_prefix) — returned by the repository-level GET response.

Both are optional, so this part is non-breaking. Accessors regenerated.

Towards #3644

… subject-claim Set methods

BREAKING CHANGE: `Actions.SetOrgOIDCSubjectClaimCustomTemplate` and `Actions.SetRepoOIDCSubjectClaimCustomTemplate` now take `OIDCSubjectClaimCustomTemplate` by value instead of by pointer.
…ectClaimCustomTemplate`

The Actions OIDC subject-claim customization schema includes two fields that were missing from `OIDCSubjectClaimCustomTemplate`:

- `use_immutable_subject` (*bool): present in the org and repo request bodies and responses; opts in to the immutable, repository-ID-based OIDC `sub` claim format.
- `sub_claim_prefix` (*string): the current `sub` claim prefix, returned by the repository GET response.

Both are optional, so the change is non-breaking. Regenerate the accessors.
@gmlewis gmlewis added NeedsReview PR is awaiting a review before merging. Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). labels Jun 29, 2026
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.50%. Comparing base (9b51fac) to head (2b272ae).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4340   +/-   ##
=======================================
  Coverage   97.50%   97.50%           
=======================================
  Files         193      193           
  Lines       19451    19451           
=======================================
  Hits        18965    18965           
  Misses        269      269           
  Partials      217      217           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmlewis gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @JamBalaya56562!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @alexandear - @Not-Dhananjay-Mishra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants