Skip to content

Initial release of Brammo/Auth plugin for CakePHP 5.x

Choose a tag to compare

@brammo brammo released this 17 Nov 07:49
· 23 commits to master since this release

Added

  • Initial release of Brammo/Auth plugin for CakePHP 5.x
  • Complete authentication system with login/logout functionality
  • User authentication using CakePHP Authentication library
  • Configurable authentication routes (/login, /logout)
  • Flexible configuration system via config/auth.php
  • Support for multiple authentication methods:
    • Session-based authentication
    • Form-based authentication
    • Cookie-based authentication (Remember Me)
  • Password hashing with bcrypt (default)
  • Support for legacy password hashers (fallback configuration)
  • Password rehashing on login when needed
  • Custom login redirect support (query parameter or configuration)
  • Plugin bootstrap with automatic configuration loading
  • User entity with:
    • Hidden password field in JSON output
    • Mass-assignable fields (email, password, name)
    • Proper field accessibility
  • UsersTable with:
    • Email validation
    • Unique email constraint
    • Timestamp behavior
    • Validation rules for name, email, password
  • UserController with:
    • Login action with redirect support
    • Logout action
    • Flash messages for authentication errors
    • Unauthenticated access control
  • AuthenticationServiceProvider for service configuration
  • Database migrations:
    • CreateUsers migration (20231101000000)
    • Users table with id, name, email, password, created, modified
    • Unique index on email field
  • Database seeds:
    • UsersSeed with sample admin and test users
  • Comprehensive test suite with 37+ test cases:
    • PluginTest - Plugin bootstrap and routes
    • AuthenticationServiceProviderTest - Service configuration
    • UserControllerTest - Login/logout functionality
    • UserTest - Entity behavior
    • UsersTableTest - Table operations and validation
  • Full PHPUnit configuration
  • Test fixtures for Users table
  • Test application structure for integration testing
  • Code style checking with CakePHP CodeSniffer
  • Comprehensive documentation:
    • Installation and setup guide
    • Configuration examples
    • Usage examples
    • API documentation
    • Troubleshooting guide
    • Migration documentation