Repository navigation
docs(bb-auth): document the password policy in the README - #1510
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 6234fa7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
Contributor
📖 Glossary & notes — scoring, indicators, per-metric thresholds (click to expand)
Results — PR vs
|
| Task | Template | Tests | Judge | Cost | Turns | Score | Stop reason |
|---|---|---|---|---|---|---|---|
| async-word-counter | bare | ✅ 13/13 (0) | ❌ $3.79 (+$1.17) | ❌ 25.1 (-12.2) | endTurn | ||
| auth-notes | demo | ✅ 11/11 (0) | ✅ 8.4 (0) | ❌ $20.64 (+$8.34) | ❌ 63 (+23) | ✅ 4.5 (-3.1) | endTurn |
| cognito-profile | auth | ✅ 10/10 (0) | ❌ $39.79 (+$28.79) | ❌ 79 (+40) | endTurn | ||
| collab-presence-board | default | ✅ 11/11 (0) | ✨ 9.4 (+0.8) | ❌ $3.59 (+$1.17) | ❌ 27.2 (-11.8) | endTurn | |
| email-digest | demo | ✅ 12/12 (0) | ✅ 9.4 (+0.2) | ❌ $5.25 (+$1.02) | ❌ 33 (+16) | ✅ 18.6 (-4.3) | endTurn |
| file-gallery | bare | ✅ 12/12 (0) | ✅ 9.6 (+0.2) | ✨ $2.69 (-$0.38) | ✅ 14 (-3) | ✅ 36.6 (+4.8) | endTurn |
| kb-chat-agent | demo | 🆕 9/9 (new) | 🆕 8.8 (new) | ❌ $31.47 (+$27.42) | ❌ 60 (+47) | ✅ 3 (+3) | endTurn |
| observability-api | backend | ✅ 18/18 (0) | ✅ $6.75 (+$0.4) | ✨ 26 (-6) | ✅ 14.2 (-1.2) | endTurn | |
| oidc-dsql-notes | react | ✅ 2/11 (0) | ❌ 7.4 (-1) | ✨ $14.8 (-$15.57) | ✨ 44 (-37) | ✅ 2.2 (+1) | endTurn |
| sql-kb-catalog | nextjs | ✅ 9/9 (0) | ❌ $8.16 (+$3.32) | endTurn |
Merge verdict
✅ This bench run does not block the PR.
- ✅ Absolute floor — mean composite 89.6 >= floor 65.
- ✅ Regression vs
main— mean composite delta +9.0 pts vs main is within the 10-pt limit.
The Δ vs base ball above is a fixed ±5-pt display band; the regression gate uses BENCH_MAX_REGRESSION. The ball is cosmetic — the gate threshold is what blocks.
3 tasks done
This was referenced Nov 16, 2026
Merged
xyos
marked this pull request as ready for review
November 16, 2026 14:56
2 of 3 tasks
xyos
force-pushed
the
docs/bb-auth-password-policy
branch
from
November 17, 2026 22:11
24a66b0 to
6d948e7
Compare
xyos
force-pushed
the
docs/bb-auth-password-policy
branch
from
November 17, 2026 22:18
6d948e7 to
5f8e05b
Compare
VarshithaPamisetty
approved these changes
Nov 18, 2026
The README never mentioned `emailPassword.passwordPolicy`; API.md only declares it. A new "Password policy" section lists each `PasswordPolicy` field and its default, the calls that enforce it (sign-up, the new-password sign-in answer, password reset and change, and the two admin calls that set a password), and what a client receives for a weak password: `InvalidPasswordException`, 400, retriable through `setAuthState`, with a message built from the policy. It shows how to branch on it with `isAuthError` and `hasAuthError`, and notes that an imported pool keeps its own policy and the fixed message.
- Move the policy and hasAuthError snippets into a Recipes entry, so the README recipe test compiles them. - minLength: 6 to 99, checked at synth by the CDK UserPool, not by the block or the local pool. - With no passwordPolicy the block writes no policy; the pool gets the CDK UserPool default. - Locally a generated temporary password is checked against the policy (minLength above 16 throws). - An imported pool: the local pool still checks the block's policy; AWS checks the pool's.
This branch was previously 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
AuthREADME never mentionsemailPassword.passwordPolicy, andAPI.mdonly declaresPasswordPolicy's fields without saying what they default to. A developer can't learn from the docs what a password needs by default, which calls check it, or what the client receives for a weak password.Issue #, if available: none
Stack: 2 of 5 (base: #1509, the docs content fixes). The PRs above it add the
cdk-blocks docscommand (#1511), point the scaffolded docs at it (#1512) and add--output json(#1521). Review fixes are in their own commit. This PR only touchespackages/bb-auth/README.mdand adds a changeset.Changes
A new "Password policy" section in the
@aws-blocks/bb-authREADME, after "Sign-up and email delivery" (@aws-blocks/bb-authand@aws-blocks/blocks, patch; the umbrella ships the block READMEs in itsdocs/). It covers:PasswordPolicyfield (minLength,requireUppercase,requireLowercase,requireDigits,requireSymbols) and its default: 8 characters, with all four kinds of character required. With nopasswordPolicythe block writes none, and the pool gets the CDKUserPoolconstruct's default policy, which has the same values;minLength, 6 to 99: the block and the local pool don't check it, and the CDK construct throws at synth;signUp, the new-password answer toconfirmSignIn,confirmResetPassword,updatePassword,auth.admin.createUser'stemporaryPasswordandauth.admin.setUserPassword, plus thesetAuthStateactions that call them. On AWS the user pool the block creates enforces it; locally the local user pool checks the same rules, with two differences: a generated temporary password (admin.createUserwithouttemporaryPassword) has 16 characters and is checked against the policy, sominLengthabove 16 throws locally, and an imported pool keeps the block's policy locally while AWS checks the pool's own;InvalidPasswordException(AuthErrors.InvalidPassword), status 400, with a message built from the policy (the same locally and on AWS). ThroughsetAuthStatethe error is retriable;isAuthError(e, AuthErrors.InvalidPassword)for a thrown error,hasAuthError(state, 'InvalidPasswordException')for a returned state. The example is a new recipe, "Tell the user what a password needs", under## Recipes, soreadme-recipes.test.tscompiles it;userPool: Auth.fromExisting(…)) keeps its own policy on AWS and the fixed message.Every statement follows the current source:
PasswordPolicyandEmailPasswordOptionsinsrc/types.ts,passwordPolicyMessageandtoAuthApiErrorinsrc/error-mapping.ts,statusForAuthErrorandisRetriableAuthErrorinsrc/errors.ts, the local engines' password checks (src/engines/native-mock*.ts), the Cognito calls that carry a password (src/engines/native-cognito*.ts) andmapPasswordPolicyinsrc/cdk/mappers.ts.No code change.
Validation
Run locally at the stack top (
f05527191, onmainat03778d9f6) with Node 22.23.1 (.nvmrc):npm run build,npm run lint(warnings only),npm run lint:deps: exit 0.node --test scripts/sink-guards/*.test.mjs): 35 pass, 0 fail (ci(kotlin): pass the emulator script path through env #1603 fixed the workflows site from ci(kotlin): retry the Android e2e leg when the device drops out #1600).cdk-blocks docstests (docs,bin,parse,help) with@aws-blocks/blocks'docs-pointers.test.js: 110 pass, 0 fail;@aws-blocks/create-blocks-app'sdocs-pointers.test.js: 5 pass;@aws-blocks/bb-auth'sreadme-recipes.test.js: 8 pass.The full suites ran on the previous head (
b8a78177a, onmainatd01c34c96), Node 22.23.1, before this rebase onto nine moremaincommits; the rebase changed onlybb-kv-store/README.md(a conflict with #1608) in this stack's own diff:npm run test:e2e:local: exit 0; 580 tests, 574 pass, 0 fail, 6 skipped.npm test: 13,802 tests, 13,767 pass, 21 fail, 10 skipped. Every failure is a dev-server, signal or file-watcher test incore,hostingorblocks'cli/context.test.js(none incdk-blocks docs,bb-auth,bb-kv-storeorcreate-blocks-app), and the log has 46EMFILEerrors fromfs.watch: this machine'sfs.inotify.max_user_instances(128) was used up by other processes. CI runs these suites.No new tests: the change is documentation only. No sandbox run.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.