Skip to content

Commit 4d2ce7c

Browse files
authored
feat: dynamic casbin storage and 3 new policy management steps
feat: dynamic casbin storage and 3 new policy management steps
2 parents 4b8a9d4 + 14c1918 commit 4d2ce7c

12 files changed

Lines changed: 1586 additions & 27 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bin/

build.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
# Run this script after the system recovers from the fork resource issue.
3+
# It fetches new dependencies, builds, and runs tests.
4+
5+
set -e
6+
cd "$(dirname "$0")"
7+
8+
export GOPRIVATE=github.com/GoCodeAlone/*
9+
10+
echo "==> go mod tidy"
11+
go mod tidy
12+
13+
echo "==> go build"
14+
go build ./...
15+
16+
echo "==> go vet"
17+
go vet ./...
18+
19+
echo "==> go test (race detector)"
20+
go test ./... -v -race -count=1

go.mod

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ go 1.26
55
require (
66
github.com/GoCodeAlone/workflow v0.2.2
77
github.com/casbin/casbin/v2 v2.104.0
8+
github.com/casbin/gorm-adapter/v3 v3.24.0
9+
gorm.io/driver/mysql v1.5.7
10+
gorm.io/driver/postgres v1.5.11
11+
gorm.io/driver/sqlite v1.5.7
12+
gorm.io/gorm v1.25.12
813
)
914

1015
require (
@@ -74,10 +79,15 @@ require (
7479
github.com/fatih/color v1.18.0 // indirect
7580
github.com/felixge/httpsnoop v1.0.4 // indirect
7681
github.com/fsnotify/fsnotify v1.9.0 // indirect
82+
github.com/glebarez/go-sqlite v1.20.3 // indirect
83+
github.com/glebarez/sqlite v1.7.0 // indirect
7784
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
7885
github.com/go-logr/logr v1.4.3 // indirect
7986
github.com/go-logr/stdr v1.2.2 // indirect
87+
github.com/go-sql-driver/mysql v1.7.1 // indirect
8088
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
89+
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
90+
github.com/golang-sql/sqlexp v0.1.0 // indirect
8191
github.com/golang/snappy v0.0.4 // indirect
8292
github.com/golobby/cast v1.3.3 // indirect
8393
github.com/google/s2a-go v0.1.9 // indirect
@@ -109,10 +119,14 @@ require (
109119
github.com/jcmturner/gofork v1.7.6 // indirect
110120
github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect
111121
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
122+
github.com/jinzhu/inflection v1.0.0 // indirect
123+
github.com/jinzhu/now v1.1.5 // indirect
112124
github.com/json-iterator/go v1.1.12 // indirect
113125
github.com/klauspost/compress v1.18.3 // indirect
114126
github.com/mattn/go-colorable v0.1.14 // indirect
115127
github.com/mattn/go-isatty v0.0.20 // indirect
128+
github.com/mattn/go-sqlite3 v1.14.22 // indirect
129+
github.com/microsoft/go-mssqldb v1.6.0 // indirect
116130
github.com/mitchellh/go-homedir v1.1.0 // indirect
117131
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
118132
github.com/mitchellh/mapstructure v1.5.0 // indirect
@@ -169,6 +183,8 @@ require (
169183
google.golang.org/grpc v1.79.1 // indirect
170184
google.golang.org/protobuf v1.36.11 // indirect
171185
gopkg.in/yaml.v3 v3.0.1 // indirect
186+
gorm.io/driver/sqlserver v1.5.3 // indirect
187+
gorm.io/plugin/dbresolver v1.3.0 // indirect
172188
modernc.org/libc v1.67.6 // indirect
173189
modernc.org/mathutil v1.7.1 // indirect
174190
modernc.org/memory v1.11.0 // indirect

go.sum

Lines changed: 98 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)