Repository navigation
fix(bb-auth-cognito, bb-auth-oidc, auth-common): final patch of the current auth blocks; AuthErrors contract (stack 06/24) - #855
Open
harsh62 wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: fc1a913 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
3 tasks done
harsh62
marked this pull request as ready for review
October 19, 2026 14:18
harsh62
force-pushed
the
auth/stack-06-old-auth-blocks-final-patch
branch
from
October 19, 2026 22:38
074cb17 to
7a12f9a
Compare
3 tasks done
…urrent auth blocks; AuthErrors contract (stack 06/14)
This branch had an error being deployed
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.
Problem
The last patch of the current auth blocks, before anything moves off them. People who stay on
AuthCognitoorAuthOIDCget B6's security fixes (L7 option (a), decided by the maintainer).Issue #, if available: see #711
Changes
bb-auth-cognitosecurity fixes:bb-auth-cognitofixes: refreshed ID tokens are verified; block-raised errors keep their status;InternalErrorExceptionis a retriable 500.main's fix(bb-auth-cognito): stop leaking raw Cognito SDK text in ApiError #678. Client messages stay the block's own fixed text per error name. The masking and IAM-denial logging from B6 sit on top of that, and the "unknown user" text is the same string as the wrong-code text, so the two can't be told apart.bb-auth-oidc: correctedcognitoFederated()docs. Cognito adds no MFA for federated users.auth-common: the canonicalAuthErrorsvocabulary and guards (includingPasskeysNotEnabledandMfaNotEnabled), the shared auth-state store behindmain'ssubmitAuthAction(fix(auth-common): add submitAuthAction so setAuthState drives onAuthChange #208) withsubscribeAuthState/getAuthStateSnapshot, cookie docs.AuthState<U>andAuthStateApi<I, U>take the user type, with defaults, andAuthUserOfnames it. Sign-in and sign-out broadcasts are tagged with the API's RPC namespace, which core's client reports from part 07, so one auth API'sonAuthChangedoesn't get another's user; untagged messages still reach every API.requireRoleis an optional member ofBlocksAuthuntil the cutover (part 12).bb-auth-cognito0.1.13 andbb-auth-oidc0.2.3, plusauth-common's.What to review closely: Please read
packages/bb-auth-cognito/src/index.aws.ts(asApiError) andcookies.ts. Merge the Version Packages PR after this part, so the patch ships before parts 07–12.Validation
Re-cut onto
main@02cdf908. This branch passed on its own, from a freshnpm ci:npm cichangeset-guard: its tests and all four checkscomprehensive'stsc --noEmittsc --noEmit, matchingmain's baseline: the same five apps fail as onmain(amplify-gen2,extending-blocks-guide,hosting-ssr-nuxt,hosting-ssr-sveltekit,native-bindings), and no otherPart 12's tree, which is the whole stack apart from the stack doc, also passed build,
update:api, the fixture regeneration and the live auth-spec check with zero drift,comprehensive'stsc --noEmit, andnpm test: 8,857 passed, 0 failed.An earlier tree of the full stack passed end to end on AWS, on new stacks that were destroyed afterwards: upgrade-in-place from
AuthCognito,comprehensivesandbox and production, hosting, native, and the CloudFront front door (see #711). That run came before the later merges ofmain(#824's synth guards, #797's SwiftBlocksentry point, #834's template metadata, #835/#837's native opt-out warnings, #841, #749, #819 and dependency bumps, then #208'ssubmitAuthAction, #807's Swift typed declared-binding results, #637's config-bucket hardening and more dependency bumps, then #736's per-namespace RPC paths, #574'sComputeBase, #910's native escaping, #704's KotlinBlocksentry point, #907's Next.js 16, #927's hosting security headers and more, then #1042's sandbox-only stub IdP andgetDeploymentType(), #1032's fail-closed mock entries, #510's swappable hosting front doors, #949, #827, #948's per-namespace compute and more, then this round's #1024, #1050, #1027'sapiWaf, #1076, #962, #902's typedOIDCClient, #674 and more) and before the #856 review fixes.The
bench / summarycheck is not a required check. It currently fails repo-wide, on unrelated PRs too, because of runner isolation.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.