api-test: select the PMS OIDC-client registration endpoint by config - #2588
nandhu-kumar wants to merge 1 commit into
Conversation
PMS 1.2.2.x serves only {pms}/oauth/client and answers 404 for
{pms}/oidc-clients, which the e2e harness had hardcoded — so every
scenario against such a deployment died at client registration before
the flow was ever driven.
esignet.pms.client_api (PMS_CLIENT_API) now selects the endpoint:
oidc-clients (the default, so existing deployments are unaffected) or
oauth-client.
Both endpoints take the identical request body, so the setting changes
the path and nothing else. Verified live against a 1.2.2.3 PMS and two
current builds: /oidc-clients validates the wrapper id and rejects a
wrong one with PMS_REQUEST_ERROR_002, whereas /oauth/client registers
the client regardless and echoes id/version back as null — it ignores
those members entirely.
/oidc-clients stays the default because a client registered there is
the one IDA is known to authenticate; /oauth/client registrations have
been seen refused at login, which only a full login reveals.
There is deliberately no auto-detection: a deployment whose PMS is
upgraded or replaced needs this setting revisited. So a 404 from the
configured endpoint now names the setting that switches it rather than
reporting a bare Not Found.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Nandhukumar <nandhukumare@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (9)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe change adds configurable PMS client-registration endpoint selection. Configuration supports ChangesPMS client endpoint selection
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Config
participant E2ERunner
participant PMS
Config->>E2ERunner: Provide PMSClientAPI
E2ERunner->>E2ERunner: Select registration path
E2ERunner->>PMS: POST wrapped client request
PMS-->>E2ERunner: Client ID or 404 response
Merge Risk: ⚪ Minimal · up to The e2e harness can now select the PMS client-registration endpoint while retaining the existing default behavior. Configuration, routing, and endpoint request coverage support merge readiness. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 44.44% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 5 files. (4 skipped: 4 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Two endpoints wait beneath the base URL Comment |
Problem
The e2e harness hardcoded
{pms}/oidc-clientsas the client-registration endpoint. PMS 1.2.2.x has no such controller and answers HTTP 404 for it, so on a deployment running that build every e2e scenario failed at client registration, before any flow was driven:Change
esignet.pms.client_api(PMS_CLIENT_API) selects the endpoint:oidc-clients{pms}/oidc-clients— default, existing deployments unaffectedoauth-client{pms}/oauth/client— the only one PMS 1.2.2.x servesBoth endpoints take the identical request body, so the setting changes the path and nothing else — there is no second body shape to maintain.
Why no auto-detection
A 404 fallback was considered and deliberately rejected: a deployment whose PMS is upgraded or replaced should have this setting revisited rather than silently switching endpoints underneath the run. To keep that discoverable, a 404 from the configured endpoint now names the setting that fixes it instead of reporting a bare Not Found.
oidc-clientsremains the default because a client registered there is the one IDA is known to authenticate;/oauth/clientregistrations have been seen refused at login — visible only by driving a full login, so no create-and-read-back test catches it.Verification
Measured live against three PMS builds, using a garbage wrapper
idas the control:/oidc-clients/oauth/clientreleased)qajava21,dev)id/version/metadataPMS_REQUEST_ERROR_002, echoed back in the responseid/versionasnullDriven end to end through
createClientViaPMSitself, not a stub: withclient_api: oauth-clientit registered a real client on the 1.2.2.3 deployment; with the default it produced the new 404 message.Compatibility
No behaviour change for any deployment serving
/oidc-clients— same URL, same body, same single call. A config with noclient_apikey resolves to the default. ExistingTestCreateClientViaPMS_*tests pass untouched; 5 new tests cover the default, both configured values, the body shape at each path, and the 404 message.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
oidc-clientsand the legacyoauth-clientpath.PMS_CLIENT_APIenvironment variable andclient_apiconfiguration option.oidc-clients.Documentation
Tests