Repository navigation
fix: log OAuth code-exchange failures, show a refused sign-in on the invitation page - #974
Merged
Merged
Conversation
…clairamb/solidping-business#100) A "452 4.4.5 rate limit" reply to RCPT TO failed the notification job for good: IsRetryableSendError (internal/email/sender.go) only read the code from a *textproto.Error, and go-mail returns its own SendError. It now uses smtpReply(), so any 4xx is retryable; the email notification sender wraps it in a RetryableError, which the notification job retries after its backoff (job_notification.go also honours RetryableError now), as does the email job. go-mail's ", affected recipient(s): ..." suffix is stripped from the logged and returned error. TestSend_RateLimitReplyIsRetryableAndRedacted fails before the fix. Closes fclairamb/solidping-business#100 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…iramb/solidping-business#101) During a database outage every agent reconnect got a 401: serveReconnect (internal/handlers/agentws/handler.go) answered "Unknown agent" to any GetAgent error and "Nonce already used" to any nonce store error, and serveEnrollment read any token lookup error as a bad token (the DB layer mapped every error to ErrEnrollmentTokenInvalid). Only not found, a bad signature or a replayed nonce now give 401 (a malformed agent UID is rejected before the lookup); other errors give 503 with Retry-After, logged at WARN. The agent treats a 5xx handshake as a lost connection (WARN once, re-claim). TestAgentAuthDatabaseDownIs503, TestReconnectNonceStoreFailureIs503 and TestWSBackendDial5xxIsConnLoss fail before the fix. Closes fclairamb/solidping-business#101 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… clone (fclairamb/solidping-business#102) A group slug passed as checkGroupUid (the MCP tools document "UID or slug") reached Postgres as is and failed as an invalid uuid (22P02): the caller got an internal error. CreateCheck, UpdateCheck and CloneCheck (internal/handlers/checks/service.go) copied the value without a lookup, so another org's group UID was accepted too. They now resolve it with GetCheckGroupByUidOrSlug in the caller's org and return ErrCheckGroupNotFound (400) otherwise; "" still ungroups. Upsert goes through update/create, import already resolves groups by name. TestCheckGroupUIDResolvedWithinOrg fails before the fix. Closes fclairamb/solidping-business#102 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-in on the invitation page (fclairamb/solidping-business#103) A federated sign-in failing with TOKEN_EXCHANGE_FAILED could not be diagnosed: every provider's handleOAuthError (google.go, github.go, ...) mapped the token-exchange error to the fixed "Failed to exchange authorization code" without logging the provider's answer (used or expired code, redirect_uri mismatch). It is now logged at WARN with the provider (logOAuthTokenExchangeFailure, handler.go). A sign-in started from an invitation comes back to the invitation page on failure, which ignored the error: invite.$token.tsx now shows error_description (invite-oauth-error), and its sign-in link still targets the bare invitation. The nested-returnTo case on the login page was already fixed for fclairamb/solidping-business#99. Tests: TestTokenExchangeFailureIsLogged fails on the previous code (nothing logged); the e2e invitations.spec.ts case fails on the previous build (no invite-oauth-error element). Closes fclairamb/solidping-business#103 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #974 +/- ##
==========================================
- Coverage 90.89% 90.89% -0.01%
==========================================
Files 1405 1405
Lines 145270 145273 +3
==========================================
+ Hits 132039 132041 +2
- Misses 13223 13224 +1
Partials 8 8
🚀 New features to boost your workflow:
|
fclairamb
added a commit
that referenced
this pull request
Nov 22, 2026
🤖 I have created a release *beep* *boop* --- ## [0.53.0](v0.52.0...v0.53.0) (2026-11-22) ### Features * **auth:** OIDC-only mode with IdP group admin roles ([#966](#966)) ([1b51f89](1b51f89)) * **service:** install writes config.env, unit loads it via EnvironmentFile ([#948](#948)) ([e4b7fc4](e4b7fc4)) ### Bug Fixes * **aggregation:** drain the raw backlog in one run and log lag ([#978](#978)) ([26b93cd](26b93cd)) * **deps:** update github.com/dop251/goja digest to 79d6ad3 ([#972](#972)) ([02c6821](02c6821)) * **deps:** update go dependencies (non-major) ([#955](#955)) ([7dfbcd6](7dfbcd6)) * **deps:** update go dependencies (non-major) ([#968](#968)) ([6c09bae](6c09bae)) * **deps:** update go dependencies (non-major) ([#979](#979)) ([ee088b6](ee088b6)) * **deps:** update module github.com/oapi-codegen/oapi-codegen/v2 to v2.9.0 ([#975](#975)) ([1121e2e](1121e2e)) * **deps:** update module go.mongodb.org/mongo-driver/v2 to v2.10.1 ([#950](#950)) ([9e684c4](9e684c4)) * email validation, OAuth error display, translator crash guard, clone slugs, watchdog pauses ([#959](#959)) ([a20f951](a20f951)) * log OAuth code-exchange failures, show a refused sign-in on the invitation page ([#974](#974)) ([c4a8dca](c4a8dca)) * retry SMTP 4xx, 503 on agent auth DB errors, scope checkGroupUid to the org ([#973](#973)) ([88179aa](88179aa)) * **security:** block WebRTC around the browser egress proxy, survive an invalid status page ?lang= ([#957](#957)) ([79bdc82](79bdc82)) * **security:** keep OIDC-group admin grants revocable, mask resolved channel references, contain browser popups ([#976](#976)) ([6e0f09e](6e0f09e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #973: merge it first.
Closes fclairamb/solidping-business#103
What changes
OAuth token exchange failedwith the provider and its answer when the authorization code exchange fails. The message shown to the user is unchanged. Until now the provider's reason (code already used, expired,redirect_urimismatch) was dropped, so aTOKEN_EXCHANGE_FAILEDcould not be diagnosed.error_descriptionin the URL) in a banner (data-testid="invite-oauth-error"), so a sign-in started from an invitation that fails comes back to it with a visible error.The error hidden inside
returnTowas already fixed by dda98b7 (login page lifts it out and strips it from the retry destination).Tests
TestTokenExchangeFailureIsLogged(fails on the old code).web/dash0/e2e/invitations.spec.ts: new case for the error banner.🤖 Generated with Claude Code