Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jcasbin/casbin-spring-boot-example
Example for casbin-spring-boot-starter
https://github.com/jcasbin/casbin-spring-boot-example
abac acl auth casbin example java jcasbin rbac spring spring-boot springboot starter
Last synced: about 1 month ago
JSON representation
Example for casbin-spring-boot-starter
- Host: GitHub
- URL: https://github.com/jcasbin/casbin-spring-boot-example
- Owner: jcasbin
- License: apache-2.0
- Created: 2022-09-16T14:51:07.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-12-09T12:12:01.000Z (about 1 year ago)
- Last Synced: 2023-12-09T13:25:44.594Z (about 1 year ago)
- Topics: abac, acl, auth, casbin, example, java, jcasbin, rbac, spring, spring-boot, springboot, starter
- Language: Java
- Homepage: https://github.com/jcasbin/casbin-spring-boot-starter
- Size: 70.3 KB
- Stars: 6
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# casbin-spring-boot-example
A simple example of [casbin-spring-boot-starter](https://github.com/jcasbin/casbin-spring-boot-starter).
## Requirement
JDK 17+
## Usage
Run with:
```shell
./gradlew bootRun
```Which will start a server at `http://localhost:8080` with following api:
- `GET /auth/login`: login to system.
Request params:- `username`: `admin` or `user`
- `password`: `pwd`
Example: `GET /auth/login?username=admin&password=pwd`
- `GET /auth/logout`: logout the system.
- `GET /data/admins/all`: available when login with `admin` account.
- `PUT /data/admins/state/{state}`: Change the protected data, available when login with `admin`/`user` account.
- `GET /data/users/all`: available when login with `admin`/`user` account.Special thanks to