Absorb auth package - #13
Conversation
…algorithms and proofs
Co-authored-by: Matej Bačo <matejbaco2000@gmail.com>
Co-authored-by: Matej Bačo <matejbaco2000@gmail.com>
Co-authored-by: Matej Bačo <matejbaco2000@gmail.com>
- Set default algorithm in Password class when initializing - Update tests to use new algorithm methods and default settings - Modify token generation to explicitly set SHA algorithm - Adjust test assertions to match new default hashing methods
- Update Proof classes to generate random values without input parameter - Add password generation with configurable length and charset - Modify README.md with comprehensive usage examples for different proof types - Update tests to reflect new generation and configuration methods - Improve code flexibility and security for authentication proofs
Move common hash and verify implementations from individual Proof subclasses to the abstract Proof base class, reducing code duplication and simplifying the class hierarchy
Algorithms -> Hashes
Introduce a new section demonstrating the usage of the Utopia\Auth\Store class, showcasing key features like setting, getting, encoding, and decoding data with practical code examples
Add auth Store class
Feat: Issuers
Add OAuth2 resource indicator helpers
Greptile SummaryThis PR absorbs the
Confidence Score: 3/5The JWT issuers and most hash classes are solid, but the Scrypt salt-not-embedded issue will cause verify() to silently return false in any stateless (new-instance-per-request) verification flow, and the PHPass randomness fallback is both insecure and broken. The Scrypt/ScryptModified verify() path silently fails across request boundaries because the random salt generated at construction is never embedded in the hash output — a new instance created for login will always return false against a registration-time hash. PHPass's getRandomBytes() fallback updates a local copy of the options map, so its internal state chain is never actually advanced; on environments without /dev/urandom the salt reduces to a predictable MD5(microtime) chain. Both issues were present in the absorbed upstream package but are real defects that affect correctness and security. packages/auth/src/Auth/Hashes/Scrypt.php, packages/auth/src/Auth/Hashes/ScryptModified.php, and packages/auth/src/Auth/Hashes/PHPass.php need the most attention before this code is used in a stateless production context. Important Files Changed
Reviews (3): Last reviewed commit: "Merge origin/main into absorb-auth" | Re-trigger Greptile |
|
@copilot resolve the merge conflicts in this pull request |
Resolved. I merged |
Restores the git-subtree annotation dropped when #13 was squash-merged, so splits fast-forward onto the published mirror (0.6.0) instead of synthesizing a divergent root. git-subtree-dir: packages/auth git-subtree-mainline: 3e145bb git-subtree-split: 76bd615 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The squash-merge of #13 discarded auth's imported history, leaving the package unreachable from its published mirror (0.6.0 = 76bd615). This -s ours merge records the mirror head as a second parent so its objects are present and reachable — the state a non-squashed import would have left — while keeping the current monorepo-ified tree. The subtree annotation lets `split` fast-forward onto the mirror instead of synthesizing a divergent root. git-subtree-dir: packages/auth git-subtree-mainline: 3e145bb git-subtree-split: 76bd615 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
utopia-php/authintopackages/authwith historyTesting
bin/monorepo check auth --fixbin/monorepo test authbin/monorepo validatebin/monorepo split auth --dry-runNotes
#XXXX.