Skip to content

Releases

Released version 3.2.8

Choose a tag to compare

@dg dg released this 18 Nov 23:28
  • 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 reaches User unexchanged, an InvalidStateException tells you to implement the handler. Applications using cookie storage the documented way, with wakeupIdentity() 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() or getGuestIdentity() throws (a database outage, say), the next call tries again instead of working with half-loaded state.

Released version 3.2.7

Choose a tag to compare

@dg dg released this 22 Oct 02:40

✨ New Features

  • PHP 8.6 is now supported

🐛 Bug Fixes

  • The authenticator defined by security: users: in NEON is now autowired to services that require Nette\Security\Authenticator

Released version 3.2.6

Choose a tag to compare

@dg dg released this 24 Jul 23:44

✨ New Features

  • Hashed passwords in SimpleAuthenticator – stored passwords may now be crypt-format hashes (anything password_hash() produces) and can be freely mixed with plain-text ones. The format is detected automatically, so hashes just work in the security: 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() and Passwords::argon2id() – name the algorithm instead of juggling PASSWORD_* constants and options arrays: Passwords::bcrypt(12) or Passwords::argon2id(memoryCost: 65536). Omitted parameters keep PHP's defaults, and argon2id() fails with a clear exception on builds without Argon2 support.
  • ACL rules in the configuration – the new rules section lets you define permissions declaratively next to your roles and resources:
    security:
        rules:
            allow:
                - [guest, article, view]
                - [registered, comment, [add, edit]]
                - [admin]
            deny:
                - [banned, comment, add]
    Each rule is [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 by wakeupIdentity() (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 call isAllowed() again without corrupting the results of the outer query.

Released version 3.2.5

Choose a tag to compare

@dg dg released this 15 Jun 05:44
  • fixed compatibility with nette/http 3.4
  • Identity: use ctype_digit for stricter numeric ID detection

Released version 3.2.4

Choose a tag to compare

@dg dg released this 11 May 21:19
  • Guest identity – an IdentityHandler authenticator may now implement getGuestIdentity(): ?IIdentity to hand anonymous visitors a real identity. When present, getIdentity(), getId() and getRoles() transparently fall back to it, so guests carry their own roles and data instead of just the $guestRole string. The guest identity is resolved on read only and never written to storage.

  • $persistIdentity – the new User::$persistIdentity property lets you decide what happens to the identity after logout or expiration. It stays available for personalization by default; flip it to false and getIdentity()/getId() return null once the user is no longer logged in. Configurable straight from the security.authentication DI 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-rules and 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

Choose a tag to compare

@dg dg released this 30 Oct 22:52
  • support for PHP 8.5
  • optimized global function calls

Released version 3.2.1

Choose a tag to compare

@dg dg released this 04 Nov 12:31
  • support for PHP 8.4
  • SecurityExtension: password can be dynamic #74
  • $user => $username #73

Released version 3.2.0

Choose a tag to compare

@dg dg released this 21 Jan 20:47
  • requires PHP 8.1
  • uses PHP 8.1 features
  • removed deprecated IUserStorage (BC break)

Released version 3.1.8 (end of support)

Choose a tag to compare

@dg dg released this 18 Oct 17:07
  • support for PHP 8.3
  • constants are PascalCase
  • used #[\SensitiveParameter] to mark sensitive parameters

Released version 3.1.7

Choose a tag to compare

@dg dg released this 02 Feb 10:58
  • composer: allows nette/utils 4.0
⌂ 换网址