Skip to content

feat: upgrade casbin to v3 - #76

Merged
hsluoyz merged 1 commit into
apache:masterfrom
shushenghong:feat/upgrade-casbin-v3
Aug 5, 2026
Merged

feat: upgrade casbin to v3#76
hsluoyz merged 1 commit into
apache:masterfrom
shushenghong:feat/upgrade-casbin-v3

Conversation

@shushenghong

@shushenghong shushenghong commented May 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Casbin v3 is a breaking-change major release: imports move from
github.com/casbin/casbin/v2/... to v3/..., and several Enforcer
methods (GetPolicy, HasPolicy, GetAllRoles, ...) gain an error
return value. Per Go module semantic import versioning, downstream
users importing the v2-based adapter cannot transparently consume
the v3-based one, so this adapter must also bump its major.

Changes:
- go.mod: module path v4 -> v5; casbin/v2 v2.71.1 -> casbin/v3 v3.10.0;
  refresh transitive deps (drop Knetic/govaluate, add
  bmatcuk/doublestar/v4, casbin/govaluate v1.3.0, google/uuid).
- adapter.go: switch model/persist imports from casbin/v2 to v3
  (Adapter / BatchAdapter / FilteredAdapter / UpdatableAdapter
  interface signatures are otherwise unchanged).
- adapter_test.go: switch casbin & util imports to v3; adapt
  testGetPolicy / testGetPolicyWithoutOrder helpers to the new
  GetPolicy() ([][]string, error) signature.
- README.md: bump install command and example imports to v5 / v3.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@hsluoyz hsluoyz changed the title feat: upgrade casbin to v3 and bump module path to v5 feat: upgrade casbin to v3 Aug 5, 2026
@hsluoyz
hsluoyz merged commit d53dfa8 into apache:master Aug 5, 2026
hsluoyz pushed a commit that referenced this pull request Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants