实现 jwt、密码加密、casbin 的接入

This commit is contained in:
2025-05-27 15:46:25 +08:00
parent 81594a8972
commit 37b4055924
43 changed files with 618 additions and 325 deletions

View File

@ -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"

View 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)