-
-
Notifications
You must be signed in to change notification settings - Fork 0
Version 6.0 - Major Architecture Refactoring and Enhanced Documentation #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
byjg
wants to merge
18
commits into
master
Choose a base branch
from
6.0
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
…dencies; annotate overridden methods
…tensible field mapping; add new mappers (`ClosureMapper`, `PasswordSha1Mapper`, `UserIdGeneratorMapper`) and processors (`PassThroughEntityProcessor`, `ClosureEntityProcessor`); update dependencies and increase type safety across the codebase.
…mentations, enhance type hinting, support custom ID generation via `UniqueIdGeneratorInterface`, update test cases, and adjust dependencies for compatibility.
…sswords are hashed or preserved correctly during save and update operations, and validate user login functionality.
…aseExecutor|DbDriverInterface` for improved type clarity.
…` for custom key generation, update related methods and tests, replace deprecated messages, enhance type safety, and align with new mapper conventions.
- Created comprehensive documentation in /docs folder with 12 markdown files - Added sidebar_position to all docs following the order in README.md - Fixed inaccurate code examples in README.md to match current implementation - Updated README with links to all documentation sections - Fixed example.php to use correct API (UsersAnyDataset constructor, SessionContext) - Organized docs with proper Docusaurus frontmatter and features - Added detailed guides for: * Getting started and installation * User management (CRUD operations) * Authentication methods (session and JWT) * Session context and storage options * User properties (custom key-value data) * Database storage and schema customization * Password validation and generation * JWT token authentication * Custom fields and extending UserModel * Mappers and entity processors * Complete working examples - Removed duplicate and outdated information from README - Added feature list and improved organization - All code examples now reflect actual API usage
Consolidated duplicate content and improved documentation structure: README.md changes: - Removed duplicate installation examples - Simplified Basic Usage to single example - Removed detailed sections (now in specific docs) - Replaced with Features section linking to docs - Simplified Dependencies section docs/getting-started.md changes: - Removed duplicate Key Features list - Simplified Quick Example code docs/authentication.md changes: - Added cross-reference to Password Validation docs/custom-fields.md changes: - Added clarity on when to use vs Database Storage Benefits: - Single source of truth for each concept - Clear navigation through cross-references - Better maintainability
- Removed text descriptions from Dependencies section - Now shows only mermaid flowchart with project dependencies - Dependencies sourced from composer.json: * byjg/authuser --> byjg/micro-orm * byjg/authuser --> byjg/cache-engine * byjg/authuser --> byjg/jwt-wrapper - Section remains as last section before footer
Removed dependencies section and related information from installation documentation.
…recate `SessionContext` usage, and clarify differences for security and scalability.
Claude/6.0 011 c us fn wv7 y75 uh4 q9vfc px
…cross codebase, remove redundant interfaces and exceptions, and adjust related tests and documentation.
… `getByUsername`, and `getByLoginField` into a single `get` method, update all references, adjust tests, and update documentation accordingly.
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.
This major release introduces significant architectural improvements to the PHP AuthUser library, transitioning from closure-based field mapping to a more robust
MapperFunctionInterfacesystem. The release also includescomprehensive Docusaurus documentation, password validation features, and updated dependencies.
🎯 Major Changes
1. Mapper System Refactoring
MapperFunctionInterfacefor better extensibility and type safetyPasswordSha1Mapper- SHA-1 password hashing (with deprecation notice)UserIdGeneratorMapper- Custom user ID generationClosureMapper- Backward compatibility wrapper for legacy closuresPassThroughEntityProcessor- No-op processorClosureEntityProcessor- Closure-based entity processing2. Password Validation System
PasswordDefinitionclass with configurable password policies:3. Database Layer Improvements
UsersDBDatasetconstructor now acceptsDatabaseExecutororDbDriverInterfaceDbDriverInterfacetoDatabaseExecutorfor backward compatibility4. JWT Authentication Prioritization
SessionContextmarked as deprecated (legacy support maintained)5. Comprehensive Documentation
6. Dependency Updates
byjg/micro-orm: ^6.0byjg/cache-engine: ^6.0byjg/jwt-wrapper: ^6.0UserDefinition::defineClosureForUpdate()→defineMapperForUpdate()ClosuretoMapperFunctionInterface|string$def->defineMapperForUpdate('field', new ClosureMapper($closure))or use mapper class namesUserDefinition::defineClosureForSelect()→defineMapperForSelect()ClosuretoMapperFunctionInterface|stringUserDefinition::getClosureForUpdate()→getMapperForUpdate()ClosuretoMapperFunctionInterface|stringUserDefinition::defineGenerateKeyClosure()removedInvalidArgumentExceptiondefineGenerateKey(MapperFunctionInterface|string)insteadUserDefinition::existsClosure()→existsMapper()UserDefinition::beforeInsert/beforeUpdateClosuretoEntityProcessorInterfacenew ClosureEntityProcessor($closure)UsersDBDatasetconstructor parameter orderDbDriverInterface→DatabaseExecutor|DbDriverInterfacebyjg/micro-orm,byjg/cache-engine,byjg/jwt-wrapperall require version 6.0✨ New Features
📚 Documentation
All documentation is now available in the
/docsfolder and ready for Docusaurus deployment:🔄 Backward Compatibility
Legacy methods are maintained with deprecation notices:
defineClosureForUpdate()- wraps closure inClosureMapperdefineClosureForSelect()- wraps closure inClosureMappergetClosureForUpdate()- returns closure wrapper for mappersexistsClosure()- callsexistsMapper()internallyUsersDBDatasetauto-convertsDbDriverInterfacetoDatabaseExecutor🧪 Testing
PasswordDefinitionvalidation and generation📦 Installation