实现 jwt、密码加密、casbin 的接入
This commit is contained in:
@ -1,15 +1,28 @@
|
||||
# https://goframe.org/docs/web/server-config-file-template
|
||||
# Server configuration.
|
||||
server:
|
||||
address: ":8000"
|
||||
openapiPath: "/api.json"
|
||||
swaggerPath: "/swagger"
|
||||
|
||||
# https://goframe.org/docs/core/glog-config
|
||||
# Logger configuration.
|
||||
logger:
|
||||
level : "all"
|
||||
stdout: true
|
||||
|
||||
# https://goframe.org/docs/core/gdb-config-file
|
||||
# Database configuration.
|
||||
database:
|
||||
logger:
|
||||
level: "all"
|
||||
stdout: true
|
||||
default:
|
||||
link: "mysql:root:12345678@tcp(127.0.0.1:3306)/test"
|
||||
link: "mysql:root:MSms0427@tcp(127.0.0.1:3306)/dealxuetest?loc=Local&charset=utf8mb4"
|
||||
debug: true
|
||||
|
||||
# Redis configuration.
|
||||
redis:
|
||||
default:
|
||||
address: "127.0.0.1:6379"
|
||||
|
||||
# Casbin model
|
||||
casbin:
|
||||
modelPath: "./manifest/config/rbac_model.conf"
|
||||
14
manifest/config/rbac_model.conf
Normal file
14
manifest/config/rbac_model.conf
Normal file
@ -0,0 +1,14 @@
|
||||
[request_definition]
|
||||
r = sub, obj, act
|
||||
|
||||
[policy_definition]
|
||||
p = sub, obj, act, desc
|
||||
|
||||
[role_definition]
|
||||
g = _, _
|
||||
|
||||
[policy_effect]
|
||||
e = some(where (p.eft == allow))
|
||||
|
||||
[matchers]
|
||||
m = g(r.sub, p.sub) && keyMatch2(r.obj, p.obj) && regexMatch(r.act, p.act)
|
||||
Reference in New Issue
Block a user