Repository navigation
refactor(extension): split generatePassword into small steps - #1368
Open
rubenvdlinde wants to merge 2 commits into
Open
rubenvdlinde wants to merge 2 commits into
rubenvdlinde wants to merge 2 commits into
Conversation
Assisted-by: ClaudeCode:claude-opus-5-5
| for (const [label, request] of requests()) { | ||
| const result = generatePassword({ ...request, excludedCharacters: excluded }, policy, seeded(cases)) | ||
| if (!result.ok) failures[result.failure] = (failures[result.failure] ?? 0) + 1 | ||
| hash.update(`${label}=${JSON.stringify(result)}\n`) |
…he grid golden 30 s generate() and generatePassword() without an injected source must draw from crypto.getRandomValues and never from Math.random. The golden grid test gets an explicit 30 s timeout for loaded runners. Assisted-by: ClaudeCode:claude-opus-5-5
Contributor
Quality Report — ConductionNL/keepiq @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-manifest | ✅ | ||||
| test-l10n | ✅ | ||||
| format | ✅ | ||||
| check-l10n-js | ✅ | ||||
| check-schema-l10n | ✅ | ||||
| composer | ✅ | ✅ 114/114 | |||
| npm | ✅ | ✅ 661/661 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ✅ | ||||
| lockfile sync | ✅ | ||||
| PHPUnit | ✅ 2797/2797 · 3 skipped | ||||
| Newman | ✅ 177/177 · 20 skipped | ||||
| Playwright | ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development. |
||||
| Hydra gates | ✅ |
Quality workflow — 2026-11-02 01:20 UTC
Download the full PDF report from the workflow artifacts.
This branch has not been 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.
What changes
generatePassword()in the browser extension keeps its signature and its result for every request. Its body is now split into small steps:readSpec(the request with its defaults, raised to the policy's floor),buildCharset,classMinimums,invalidLengthandinvalidCharset. Each new helper takes at most 2 parameters and works on onePasswordSpecvalue.REVIEW: this is the password generator.
SIG numbers (keepiq, TypeScript, lizard via gate 122)
generatePasswordgoes from McCabe 30 to 8. Its 3 parameters are the public signature thatgenerate.ts,menus.tsand the cross-language vectors call, so they stay.How I verified it
password.golden.test.ts. It runs 4,050 requests (lengths, include flags, minimum counts, avoid-ambiguous) under 4 policies and 4 exclusion sets, with a seeded draw. It records a digest and the refusal counts per group (every refusal code occurs). Recorded on the old code, then run plain on the old and the new code.NODE_OPTIONS=--max-old-space-size=1536 timeout 120) on the old and the new code: 15 mutants on the old code and 16 on the new code (the extra one swaps the order of the two refusal checks). Every one of them is killed on both The no-op control survives on both.password.test.ts,vectors.test.tsandgenerate.test.tspass (184 tests). eslint is clean andtsc --noEmitexits 0. Gate 122 ratchet: 0 findings in 10 changed units. Gate 119: 0.Inherited
random.test.ts("fills 7776 buckets evenly over 1 000 000 draws") failed once in a fullsrc/generatorrun on a loaded machine, then passed on its own. It does not importpassword.ts.This change was prepared with Claude Code (AI assisted) and reviewed by a human before merge.