Problem
Mockin's loginHints and domainHints maps are built at startup from 5 hardcoded users. When login_hint or domain_hint is passed for a user not in that static list, Mockin rejects the request with invalid_request.
This forces consumers (e.g., Lifecycle's HelloOIDCClient) to add an isMockServer guard that skips sending login_hint/domain_hint entirely in mock mode — which means that code path is never tested in E2E tests.
Proposed Solution
Add mock API endpoints to dynamically register login hints and domain hints:
PUT /mock/claims should also register the user's email as a valid login_hint and the email domain as a valid domain_hint
- Alternatively, add dedicated endpoints like
PUT /mock/login-hints and PUT /mock/domain-hints
DELETE /mock (reset) should clear dynamically registered hints
This would allow Playwright E2E tests that use setHelloMockUser() to also have working login_hint resolution, and consumers could remove the isMockServer guard.
Context
- Lifecycle
HelloOIDCClient.ts has an isMockServer guard that skips login_hint/domain_hint in mock mode
- Lifecycle Playwright tests use dynamic test emails like
admin@testorg.com that aren't in Mockin's hardcoded user list
- See: hellocoop/Lifecycle#122
Problem
Mockin's
loginHintsanddomainHintsmaps are built at startup from 5 hardcoded users. Whenlogin_hintordomain_hintis passed for a user not in that static list, Mockin rejects the request withinvalid_request.This forces consumers (e.g., Lifecycle's
HelloOIDCClient) to add anisMockServerguard that skips sendinglogin_hint/domain_hintentirely in mock mode — which means that code path is never tested in E2E tests.Proposed Solution
Add mock API endpoints to dynamically register login hints and domain hints:
PUT /mock/claimsshould also register the user'semailas a validlogin_hintand the email domain as a validdomain_hintPUT /mock/login-hintsandPUT /mock/domain-hintsDELETE /mock(reset) should clear dynamically registered hintsThis would allow Playwright E2E tests that use
setHelloMockUser()to also have workinglogin_hintresolution, and consumers could remove theisMockServerguard.Context
HelloOIDCClient.tshas anisMockServerguard that skipslogin_hint/domain_hintin mock modeadmin@testorg.comthat aren't in Mockin's hardcoded user list