mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-16 23:41:43 +00:00
fix(auth_v2): match request paths with keyMatch so obj patterns span segments
Use keyMatch instead of keyMatch2 in the Casbin matcher so a "/*" or "/scim/v2/*" obj pattern unambiguously spans path separators - a require_permission check on a multi-level route like /api/v1/models now matches the granting policy rather than risking a 403. keyMatch is the canonical trailing-wildcard route matcher; the anchored act matcher is unchanged, so a "GET" policy still cannot grant "GETX".
This commit is contained in:
parent
a7f9d5d6b9
commit
e989016c2d
1 changed files with 1 additions and 1 deletions
|
|
@ -54,7 +54,7 @@ g = _, _
|
|||
e = some(where (p.eft == allow))
|
||||
|
||||
[matchers]
|
||||
m = g(r.sub, p.sub) && keyMatch2(r.obj, p.obj) && regexMatch(r.act, "^(" + p.act + ")$")
|
||||
m = g(r.sub, p.sub) && keyMatch(r.obj, p.obj) && regexMatch(r.act, "^(" + p.act + ")$")
|
||||
"""
|
||||
|
||||
_DEFAULT_GROUPING: List[Tuple[str, str]] = [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue