Skip to content

refactor: remove get_enforcer() #468

Closed

Description

@uniqueg

Since the enforcer cache (#450, PR #454), get_enforcer() (in foca.security.access_control.enforcement) returns the enforcer shared by the threads of an app instance, which may be updated while a caller uses it; locked_enforcer() is the safe way to use it. FOCA 0.18.0 is not released yet, so remove get_enforcer() now instead of deprecating it (maintainer decision, 2026-10-24: "We're still moving fast with small apps. No need to deprecate and then remove 3 days later").

Acceptance criteria

  • get_enforcer() is removed from foca.security.access_control.enforcement, its exports and the API reference (EnforcerCache.get_enforcer(), used internally, may stay).
  • Tests use locked_enforcer() instead; coverage stays at 100%.
  • docs/access-control.md and docs/migration-0.18.md tell callers to use locked_enforcer().

Activity

  1. added this to the v0.18.0 milestone on Oct 24, 2026
  2. added
    priority: medium
    status: in progress
    type flag: breaking change
    type: maintenance
    workload: hours
    on Oct 24, 2026
  3. removed
    status: in progress
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumtype flag: breaking changetype: maintenanceworkload: hours

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions