Skip to content

Support more languages of Casbin like Go Casbin in the editor #129

@hsluoyz

Description

@hsluoyz

We want to use the Casbin editor (this repo) to invoke different languages of Casbin libraries (like Go Casbin, jCasbin, Node-Casbin, PyCasbin, etc.)

How to do this?

Step-1: The editor code in the browser first calls the Casdoor HTTP API of the Casdoor official demo site: https://door.casdoor.com/ (see docs: https://casdoor.org/docs/permission/exposed-casbin-apis).

Step-2: The Casdoor backend (in Go) will call the Casbin CLI (like casbin-go-cli, casbin-java-cli, etc.) via shell/CMD locally:

Image

Step-3: The Casbin CLI will call the Casbin library of its language. Like casbin-go-cli will call Go Casbin via lib. casbin-java-cli will call jCasbin via lib, etc.

The Step-1 and Step-2 are already completed. The remaining part is Step-3: we need to make a new casbin-xxx-cli for each language, to integrate that language of Casbin into the web editor.

When you implement a new casbin-xxx-cli, you can refer to existing code like casbin-go-cli, casbin-java-cli, etc. For example, you learn how casbin-java-cli calls into jCasbin, you will know how casbin-rust-cli should call into Casbin-RS.

The code quality of the new casbin-xxx-cli will be guaranteed by its own test cases and also the result of this Casbin editor (both web UI and the editor's test cases).

See what we have got now: https://editor.casbin.org/

Image

Now we already have the following remote Casbin engines:

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

Node-Casbin Easy Tasks

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions