Skip to content

introduce @Value wiring for allowPublicClients in ClientAdminBootstrap - #4080

Open
robl-sap wants to merge 5 commits into
cloudfoundry:developfrom
robl-sap:allowpublicprovider-wiring-fix
Open

robl-sap wants to merge 5 commits into
cloudfoundry:developfrom
robl-sap:allowpublicprovider-wiring-fix

Conversation

@robl-sap

Copy link
Copy Markdown
Contributor

Problem

When ClientAdminBootstrap was converted to a @component (commit a1459a3), the @value SpEL annotation was accidentally dropped from the allowPublicClients constructor parameter. Without it, Spring performs type-based injection and injects all String-typed beans from the context into that Set instead of reading oauth.client.allowpublic from the YAML config.

Fix

Restore the @value expression on the allowPublicClients parameter with null-guards for the case where oauth or oauth.client are absent from the config:

@value("#{@config['oauth']==null ? null : @config['oauth']['client']==null ? null : @config['oauth']['client']['allowpublic']}")

Tests

Added ClientAdminBootstrapWiringTest — a minimal Spring context wiring test that covers three scenarios:

  • oauth.client.allowpublic is configured → correct client ID is picked up
  • oauth key is absent from config → resolves to empty set (no NPE)
  • oauth.client subkey is absent → resolves to empty set (no NPE)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

Only a documentation nit remains; no blocking issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

Restores Spring configuration binding for oauth.client.allowpublic and adds regression coverage for missing nested configuration.

Changes:

  • Restores null-safe @Value SpEL injection.
  • Adds wiring tests for configured and absent YAML paths.
File Summary
server/​src/​main/​java/​org/​cloudfoundry/​identity/​uaa/​client/​ClientAdminBootstrap.java Restores configuration-based public client injection. Minor nit: document the property in the configuration reference.
server/​src/​test/​java/​org/​cloudfoundry/​identity/​uaa/​client/​ClientAdminBootstrapWiringTest.java Verifies configured, missing oauth, and missing oauth.client scenarios.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@strehle
strehle requested a lite review from Copilot September 21, 2026 17:49
@strehle

strehle commented Sep 21, 2026

Copy link
Copy Markdown
Member

please. check unit tests

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The remaining accessor concern is a non-blocking nit; wiring, tests, and documentation are covered.

Review effort: Lite
Findings: 1 Low severity

Open (1)
Resolved since last review (2)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The remaining findings are minor, non-blocking nits.

Review effort: Lite
Findings: 1 Low severity

Open (1)

@github-project-automation github-project-automation Bot moved this from Inbox to Pending Merge | Prioritized in Foundational Infrastructure Working Group Sep 22, 2026
@strehle
strehle requested review from duanemay and fhanik September 22, 2026 19:42

This branch has not been deployed

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

Labels

None yet

Projects

Status: Pending Merge | Prioritized

Development

Successfully merging this pull request may close these issues.

3 participants