Repository navigation
Releases
Released version 3.2.8
- Security: CookieStorage no longer lets the token from the cookie become the identity of the logged-in user unless an authenticator implementing IdentityHandler exchanges it for the real identity in
wakeupIdentity(). The storage now hands over a TokenIdentity, and if it reachesUserunexchanged, anInvalidStateExceptiontells you to implement the handler. Applications using cookie storage the documented way, withwakeupIdentity()loading the user by the token, need no change. - Permission –
isAllowed($role, $resource)without a privilege now respects a deny of a single privilege on a parent resource, even when the resource itself allows some other privilege. - User – when
wakeupIdentity()orgetGuestIdentity()throws (a database outage, say), the next call tries again instead of working with half-loaded state.
Released version 3.2.7
✨ New Features
- PHP 8.6 is now supported
🐛 Bug Fixes
- The authenticator defined by
security: users:in NEON is now autowired to services that requireNette\Security\Authenticator
Released version 3.2.6
✨ New Features
- Hashed passwords in
SimpleAuthenticator– stored passwords may now be crypt-format hashes (anythingpassword_hash()produces) and can be freely mixed with plain-text ones. The format is detected automatically, so hashes just work in thesecurity: users:config section with no extra option. A hash whose algorithm the PHP build doesn't know fails closed instead of being compared as plain text, and plain-text comparison is timing-safe. Passwords::bcrypt()andPasswords::argon2id()– name the algorithm instead of jugglingPASSWORD_*constants and options arrays:Passwords::bcrypt(12)orPasswords::argon2id(memoryCost: 65536). Omitted parameters keep PHP's defaults, andargon2id()fails with a clear exception on builds without Argon2 support.- ACL rules in the configuration – the new
rulessection lets you define permissions declaratively next to your roles and resources:Each rule issecurity: rules: allow: - [guest, article, view] - [registered, comment, [add, edit]] - [admin] deny: - [banned, comment, add]
[role(s), resource(s), privilege(s)]; an omitted or null item means "all", and a bare string grants or revokes everything for that role. Malformed rules are rejected at config time, not at runtime.
🐛 Bug Fixes
logout()no longer touches the storage when there is nothing to change, so logging out a guest doesn't needlessly regenerate the session ID or overwrite the logout reason. A stored authentication vetoed bywakeupIdentity()(a revoked token, say) is still properly cleared.Permission::isAllowed()now saves and restores the queried role and resource, making it re-entrant and exception-safe – an assertion callback can callisAllowed()again without corrupting the results of the outer query.
Released version 3.2.5
- fixed compatibility with nette/http 3.4
- Identity: use ctype_digit for stricter numeric ID detection
Released version 3.2.4
-
Guest identity – an
IdentityHandlerauthenticator may now implementgetGuestIdentity(): ?IIdentityto hand anonymous visitors a real identity. When present,getIdentity(),getId()andgetRoles()transparently fall back to it, so guests carry their own roles and data instead of just the$guestRolestring. The guest identity is resolved on read only and never written to storage. -
$persistIdentity – the new
User::$persistIdentityproperty lets you decide what happens to the identity after logout or expiration. It stays available for personalization by default; flip it tofalseandgetIdentity()/getId()returnnullonce the user is no longer logged in. Configurable straight from thesecurity.authenticationDI section. -
SessionStorage no longer refreshes the sliding expiration timestamp once the session has already expired – an expired identity stays expired instead of being silently kept alive for another round
-
Adopted
nette/phpstan-rulesand made static analysis a mandatory part of the build, then resolved the errors it surfaced -
Improved phpDoc types and descriptions across the codebase
Released version 3.2.2
- support for PHP 8.5
- optimized global function calls
Released version 3.2.1
Released version 3.2.0
- requires PHP 8.1
- uses PHP 8.1 features
- removed deprecated IUserStorage (BC break)
Released version 3.1.8 (end of support)
- support for PHP 8.3
- constants are PascalCase
- used #[\SensitiveParameter] to mark sensitive parameters
Released version 3.1.7
- composer: allows nette/utils 4.0