Skip to content

feat(sso): create KeepSimple accounts from Windrunner Google sign-in - #264

Merged
manager merged 1 commit into
mainfrom
fix/windrunner-google-signin
Dec 6, 2026
Merged

manager merged 1 commit into
mainfrom
fix/windrunner-google-signin

Conversation

@manager

@manager manager commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

Windrunner signs visitors in with its own Google client, so a visitor never sees a KeepSimple page. This adds POST /api/sso/windrunner-google, a server-to-server endpoint:

  • Windrunner's server posts { access_token, nonce } from its Google sign-in.
  • Google tokeninfo must show the token was issued to Windrunner's client and the email is verified.
  • Strapi's Google callback finds or creates the KeepSimple account, the same path as a Google sign-in on keepsimple.io. The Strapi session is discarded and never returned.
  • The response is the existing Ed25519 assertion (provider google), bound to Windrunner's nonce.

Errors: 400 invalid_request, 401 invalid_token, 403 unauthorized_client / access_denied, 409 account_conflict (email bound to another sign-in method), 502 temporarily_unavailable, 503 server_error.

Checked with a stubbed handler run covering 16 cases (all pass), lint, prettier and tsc. One cross-model review round; two findings fixed, the third was the then-empty client list.

Released outside the batch; authorized by Wolf on 2026-12-06.

🤖 Generated with Claude Code

Windrunner signs visitors in with its own Google client, so they never see
a KeepSimple page. Its server posts the Google access token; we confirm with
Google that the token was issued to Windrunner and the email is verified,
let Strapi find or create the account by that Google identity, and answer
with the existing signed assertion. The Strapi session is discarded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Dec 6, 2026 •

Copy link
Copy Markdown

Claude finished @manager's task in 23s —— View job


Review of PR #264: Windrunner Google sign-in endpoint

I read both files in full. I did not run lint, tsc or the stubbed handler, and I did not open @lib/sso/windrunnerToken. This is a read-only review, with no code changes pushed.

Overall: The flow is sound. The checks run in a sensible order: method, input shape, key and config, Google tokeninfo (audience and verified email), Strapi, blocked check, then an email cross-check between Google and Strapi. The Strapi session is discarded, and Cache-Control: no-store is set. The HTTP status mapping is consistent, and 5xx and 429 from upstream map to 502. No project-convention violations apply to these server-only files, and there are no any leaks beyond the loosely typed info and result locals.

Points to consider (none blocking)

  1. Conflict detection is a loose regex. src/lib/sso/windrunnerGoogle.ts:88 uses /taken|exist/i on Strapi's message. A message like "User does not exist" or "Provider is disabled, doesn't exist" would return 409 account_conflict instead of 401. A wrong 409 could send Windrunner users into a misleading "your email is bound to another method" flow. I'd match the exact Strapi strings, such as "Email is already taken", or at least drop the bare exist.
  2. Access token in a query string. strapiGoogleSignIn sends the token as ?access_token= (line 68). That is how Strapi's callback works, so it's likely unavoidable. It does mean the token can land in Strapi or proxy access logs. It's worth confirming those logs scrub it. Tokens are short-lived, so the risk is low.
  3. No rate limiting. The endpoint makes two outbound calls per request, to Google and to Strapi, before any caller authentication, because the Google token is the only credential. Anyone can spend your Google and Strapi quota with junk tokens, and only the 4096-character cap limits that. A cheap per-IP limit, or a shared secret or allowlist for Windrunner's server, would harden it. The invalid_token path is already cheap, since tokeninfo rejects junk.
  4. Client check could be stricter. isWindrunnerClient takes azp || aud. If a token ever carries both and they differ, azp wins. Google issues them equal for access tokens, so this is fine today. Requiring aud to be in the list as well would be the more conservative reading.
  5. Assertion payload. Line 105 spreads the entire Strapi user into signWindrunnerAssertion. Please confirm that function whitelists the fields it signs, so internal fields never reach Windrunner. I didn't verify this.
  6. Tests. Playwright is the only test framework here, so the stubbed 16-case run is understandably not committed. If you keep that script anywhere, a note in scripts/release/ would help the next person who changes this handler.

Process notes

  • The PR body says this is released outside the batch with Wolf's authorization on 2026-12-06. I can't verify that from the PR, and I did not check it against the "one batch branch" rule in CLAUDE.md. The merge to main still needs Wolf's explicit go in the conversation, quoted in --go.
  • The hardcoded Google client ID is public by design, and the comment says so. I have no concerns there.

@manager

manager commented Dec 6, 2026

Copy link
Copy Markdown
Contributor Author

Dispositions for the review points:

  1. Conflict regex: deferred. It is the same reading the browser sign-in uses in src/api/auth.ts. A misread changes only the error code Windrunner logs; no account is created or changed on that path.
  2. Token in the query string: inherent to Strapi's provider callback, and identical to the existing browser sign-in.
  3. Rate limiting: disproved in part. Strapi is called only after Google confirms that the token belongs to Windrunner's client and carries a verified email, so a junk token costs one tokeninfo call. A per-IP limit is deferred.
  4. azp versus aud: Google issues access tokens with both equal to the client ID; deferred.
  5. Assertion payload: verified. signWindrunnerAssertion builds its payload from named fields only (sub, email, email_verified, name, provider, nonce and the time fields). Nothing else from the Strapi user is signed.
  6. Stubbed test script: noted, kept out of the tree.

Release authorization was given in the operator's conversation on 2026-12-06.

@manager
manager merged commit dc76e0d into main Dec 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant