Repository navigation
Refuse a placeholder OAuth client ID on connect and edit (146) - #147
Conversation
A saved PASTE_YOUR_CLIENT_ID_HERE made Google answer invalid_client. Connect and the service edit form now refuse a client ID containing PASTE, YOUR, CLIENT_ID or angle brackets (uppercase only; Google's IDs are lowercase), and, for oauth2.googleapis.com or accounts.google.com, one not ending in .apps.googleusercontent.com. Not checked on config load, so a running config still starts.
|
test-check prove: TestOAuthPlaceholderClientIDRefused proven (red on old, green here). TestEditOAuthServiceFixesAWrongClientID not_red_on_old, as intended: only its fixture changed (wrong ID CLIENT_ID → wrong.apps.googleusercontent.com, because the old fixture is now refused); its behaviour is unchanged on both heads. |
Decision: Findings
Tests Run
Raw runtime output was retained in local Gitmoot state and is not posted here. |
…ID only (#147 review F1) REPORTING_CLIENT_ID or WORKYOURWAY are valid opaque IDs elsewhere. Match template values instead: starts with PASTE_/YOUR_/ENTER_/INSERT_/REPLACE_, ends in _HERE, is just client_id, or uses <...>, {{ or ${ syntax. An edit that keeps the client ID and token URL is not refused for them.
|
F1 fixed in 6d208da: only whole template shapes count (starts PASTE_/YOUR_/ENTER_/INSERT_/REPLACE_, ends _HERE, is client_id, or <…>/{{/${); REPORTING_CLIENT_ID, WORKYOURWAY, your.app.client pass. The edit form checks the client ID only when it or the token URL changes, so an unrelated edit of an existing config is never refused (tested with a stored PASTE_YOUR_CLIENT_ID_HERE). Full race suite green. |
Decision: Findings
Tests Run
Raw runtime output was retained in local Gitmoot state and is not posted here. |
…nd 2)
enter_47f9e2 or app_here are opaque IDs. Refuse only a whole template for
the field itself (optional PASTE_/ENTER_/INSERT_/PUT_/REPLACE_, optional
YOUR_, optional OAUTH_/GOOGLE_, CLIENT_ID, optional _HERE) or explicit
<...>, {{ or ${ syntax.
|
F1 round 2 in 8406ee4: the rule now refuses only a complete template value for the field (e.g. PASTE_YOUR_CLIENT_ID_HERE, YOUR_CLIENT_ID, client_id, Enter-Your-OAuth-Client-ID-Here) or explicit <…>, {{ or ${ syntax. enter_47f9e2, app_here, client_id_7f3, REPORTING_CLIENT_ID, WORKYOURWAY pass (in the test). Google host suffix rule unchanged. Full race suite green. |
Decision: Findings
Tests Run
Raw runtime output was retained in local Gitmoot state and is not posted here. |
Closes 146. Jarvis 447635: the Gmail service's saved client_id was the literal
PASTE_YOUR_CLIENT_ID_HERE; Google answeredinvalid_client.Change
clientIDProblem(dashboard) refuses a client ID containingPASTE,YOUR,CLIENT_ID,<or>(case-sensitive: Google's IDs are lowercase, so a real one never matches; spaces are already refused by policy).oauth2.googleapis.comoraccounts.google.com, the ID must end in.apps.googleusercontent.com.policy.Validate: a config already holding such an ID must still load, or every service would stop at upgrade.TestEditOAuthServiceFixesAWrongClientIDusedCLIENT_IDas its wrong ID; nowwrong.apps.googleusercontent.com(same intent: a wrong but well-formed ID).Evidence
TestOAuthPlaceholderClientIDRefused: placeholder, non-Google and angle-bracket IDs get 400 on connect with the message and nothing saved; a real ID connects; editing to a placeholder gets 400 and keeps the old ID.