tlyyxjz commented on issue #61:
URL: 
https://github.com/apache/casbin-dashboard/issues/61#issuecomment-5537162402

   Hi @hsluoyz, following up on this (five years in, still open 🙂).
   
   I've built 
[casbin-config-doctor](https://github.com/tlyyxjz/casbin-config-doctor), a 
diagnostics tool that covers a large part of what this issue asks for — syntax 
checks plus the *semantics* layer beyond syntax:
   
   - **model syntax/structure**: required sections present and non-empty
   - **matcher semantics**: cross-checks every `r.xxx` / `p.xxx` against 
`request_definition` / `policy_definition`; catches garbage matchers like `m = 
r.sub == p.sub22222 && r.obj11111 == ppppppp && r..act == p.act,,,,,,,,,,` (all 
five defect classes reported with reasons — this exact example is from 
casbin-editor#162)
   - **policy semantics**: token count vs `policy_definition`, duplicate rules, 
dead `g` assignments (role has no `p` rule → grant silently does nothing), 
orphan `p` rules (subject unreachable via `g` → never allows anyone), domain 
mismatches, role inheritance cycles
   
   It's currently a Python CLI (zero-dependency, exit-code friendly for CI) 
with an [online demo](https://tlyyxjz.github.io/casbin-doctor-demo/). For the 
dashboard you mentioned two integration paths: frontend (codemirror) or backend 
(Go enforcer). A third option is porting Doctor's rule set — the checks are 
pure string/structure analysis, no enforcer needed, so they'd port cleanly to 
JS for immediate feedback while typing, before ever running an enforcer 
round-trip.
   
   **Question:** is the dashboard team still interested in this feature, and if 
so which integration path would you prefer? If useful, I'm happy to (a) 
contribute the rule set as a reference for whichever path you pick, or (b) hear 
what checks you'd consider must-have vs nice-to-have so I can prioritize 
Doctor's roadmap around real needs.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to