From 79648be3c51d1d6840254f0d6fdecebf4f1d21d5 Mon Sep 17 00:00:00 2001 From: Matrix-X Date: Sat, 13 Aug 2022 23:32:42 +0800 Subject: [PATCH] feature(rbac): permission module --- authorization/rbac/models/module.go | 132 ++++++++++++++++++++++++ authorization/rbac/models/permission.go | 48 ++++----- authorization/rbac/models/role.go | 22 ++++ database/tag/tagGroup.go | 22 ++++ go.mod | 8 +- go.sum | 33 ++---- 6 files changed, 206 insertions(+), 59 deletions(-) create mode 100644 authorization/rbac/models/module.go diff --git a/authorization/rbac/models/module.go b/authorization/rbac/models/module.go new file mode 100644 index 0000000..b34c0e6 --- /dev/null +++ b/authorization/rbac/models/module.go @@ -0,0 +1,132 @@ +package models + +import ( + "errors" + "github.com/ArtisanCloud/PowerLibs/v2/database" + fmt2 "github.com/ArtisanCloud/PowerLibs/v2/fmt" + "github.com/ArtisanCloud/PowerLibs/v2/object" + "github.com/ArtisanCloud/PowerLibs/v2/security" + "gorm.io/gorm" +) + +// TableName overrides the table name used by PermissionModule to `profiles` +func (mdl *PermissionModule) TableName() string { + return mdl.GetTableName(true) +} + +// PermissionModule 数据表结构 +type PermissionModule struct { + *database.PowerCompactModel + + Parent *PermissionModule `gorm:"ForeignKey:ParentID;references:UniqueID" json:"parent"` + Children []*PermissionModule `gorm:"ForeignKey:ParentID;references:UniqueID" json:"children"` + Permissions []*Permission `gorm:"ForeignKey:ModuleID;references:UniqueID" json:"permissions"` + + UniqueID string `gorm:"column:index_permission_module_id;index:,unique" json:"permissionModuleID"` + Name string `gorm:"column:name" json:"name"` + Description string `gorm:"column:description" json:"description"` + ParentID *string `gorm:"column:parent_id;index" json:"parentID"` +} + +const TABLE_NAME_PERMISSION_MODULE = "rbac_permission_modules" + +const PERMISSION_MODULE_UNIQUE_ID = "index_permission_module_id" + +func NewPermissionModule(mapObject *object.Collection) *PermissionModule { + + if mapObject == nil { + mapObject = object.NewCollection(&object.HashMap{}) + } + + newPermissionModule := &PermissionModule{ + PowerCompactModel: database.NewPowerCompactModel(), + Name: mapObject.GetString("name", ""), + Description: mapObject.GetString("description", ""), + ParentID: mapObject.GetStringPointer("parentID", ""), + } + newPermissionModule.UniqueID = newPermissionModule.GetComposedUniqueID() + + return newPermissionModule + +} + +// 获取当前 Model 的数据库表名称 +func (mdl *PermissionModule) GetTableName(needFull bool) string { + tableName := TABLE_NAME_PERMISSION_MODULE + if needFull { + tableName = "public." + tableName + } + return tableName +} + +func (mdl *PermissionModule) GetForeignKey() string { + return "index_permission_module_id" +} + +func (mdl *PermissionModule) GetForeignValue() string { + return mdl.UniqueID +} + +func (mdl *PermissionModule) GetComposedUniqueID() string { + + strKey := *mdl.ParentID + "-" + mdl.Name + fmt2.Dump(strKey) + hashKey := security.HashStringData(strKey) + + return hashKey +} + +func (mdl *PermissionModule) GetGroupList(db *gorm.DB, conditions *map[string]interface{}, preloads []string) (permissionModules []*PermissionModule, err error) { + permissionModules = []*PermissionModule{} + + if preloads == nil { + preloads = []string{"Permissions"} + } + + if conditions == nil { + conditions = &map[string]interface{}{} + } + if _, ok := (*conditions)["parent_id"]; !ok { + (*conditions)["parent_id"] = "" + } + + db = db.Debug() + err = database.GetAllList(db, conditions, &permissionModules, preloads) + if err != nil { + return nil, err + } + + for _, module := range permissionModules { + (*conditions)["parent_id"] = &module.UniqueID + children, err := mdl.GetGroupList(db, conditions, preloads) + if err != nil { + return nil, err + } + + module.Children = children + } + + return permissionModules, err +} + +func (mdl *PermissionModule) CheckPermissionModuleNameAvailable(db *gorm.DB) (err error) { + + result := db. + //Debug(). + Where("name", mdl.Name). + Where("index_permission_module_id != ?", mdl.UniqueID). + Where("parent_id = ?", mdl.ParentID). + First(&PermissionModule{}) + + if result.Error != nil && errors.Is(result.Error, gorm.ErrRecordNotFound) { + return nil + } + + if result.Error != nil { + return result.Error + } + + err = errors.New("permission module name is not available") + + return err +} diff --git a/authorization/rbac/models/permission.go b/authorization/rbac/models/permission.go index 0d9784e..391e8f1 100644 --- a/authorization/rbac/models/permission.go +++ b/authorization/rbac/models/permission.go @@ -1,8 +1,8 @@ package models import ( + "errors" "github.com/ArtisanCloud/PowerLibs/v2/database" - fmt2 "github.com/ArtisanCloud/PowerLibs/v2/fmt" "github.com/ArtisanCloud/PowerLibs/v2/object" "github.com/ArtisanCloud/PowerLibs/v2/security" "gorm.io/gorm" @@ -17,16 +17,14 @@ func (mdl *Permission) TableName() string { type Permission struct { *database.PowerCompactModel - Parent *Permission `gorm:"ForeignKey:ParentID;references:UniqueID" json:"parent"` - Children []*Permission `gorm:"ForeignKey:ParentID;references:UniqueID" json:"children"` + PermissionModule *PermissionModule `gorm:"ForeignKey:ModuleID;references:UniqueID" json:"permissionModule"` UniqueID string `gorm:"column:index_permission_id;index:,unique" json:"permissionID"` SubjectAlias string `gorm:"column:subject_alias" json:"subjectAlias"` SubjectValue string `gorm:"column:subject_value; not null;" json:"subjectValue"` Action string `gorm:"column:action; not null;" json:"action"` Description string `gorm:"column:description" json:"description"` - ParentID *string `gorm:"column:parent_id;index" json:"parentID"` - Type int8 `gorm:"column:type" json:"type"` + ModuleID *string `gorm:"column:module_id" json:"moduleID"` } const TABLE_NAME_PERMISSION = "rbac_permissions" @@ -48,8 +46,7 @@ func NewPermission(mapObject *object.Collection) *Permission { SubjectValue: mapObject.GetString("subjectValue", ""), Action: mapObject.GetString("action", ""), Description: mapObject.GetString("description", ""), - ParentID: mapObject.GetStringPointer("parentID", ""), - Type: mapObject.GetInt8("type", PERMISSION_TYPE_NORMAL), + ModuleID: mapObject.GetStringPointer("moduleID", ""), } newPermission.UniqueID = newPermission.GetComposedUniqueID() @@ -76,35 +73,30 @@ func (mdl *Permission) GetForeignValue() string { func (mdl *Permission) GetComposedUniqueID() string { - strKey := "" - if mdl.Type == PERMISSION_TYPE_MODULE { - strKey = *mdl.ParentID + "-" + mdl.Action + "-" + - mdl.SubjectAlias + mdl.SubjectValue - } else { - strKey = *mdl.ParentID + "-" + mdl.Action + "-" + - mdl.SubjectAlias + mdl.SubjectValue - } - fmt2.Dump(strKey) + strKey := *mdl.ModuleID + "-" + mdl.Action + "-" + mdl.SubjectValue + //fmt2.Dump(strKey) hashKey := security.HashStringData(strKey) return hashKey } -func (mdl *Permission) GetGroupList(db *gorm.DB, conditions *map[string]interface{}, preloads []string) (groupedPermissions map[string]*Permission, err error) { - permissions := []*Permission{} +func (mdl *Permission) CheckPermissionModuleNameAvailable(db *gorm.DB) (err error) { + + result := db. + //Debug(). + Where("subject_alias", mdl.SubjectAlias). + Where("index_permission_id != ?", mdl.UniqueID). + First(&Permission{}) - err = database.GetAllList(db, conditions, &permissions, preloads) - if err != nil { - return nil, err + if result.Error != nil && errors.Is(result.Error, gorm.ErrRecordNotFound) { + return nil } - for _, permission := range permissions { - if permission.ParentID != nil { - groupedPermissions[*permission.ParentID] = permission - } else { - groupedPermissions["unGrouped"] = permission - } + if result.Error != nil { + return result.Error } - return groupedPermissions, err + err = errors.New("permission name is not available") + + return err } diff --git a/authorization/rbac/models/role.go b/authorization/rbac/models/role.go index 7074634..4ff0157 100644 --- a/authorization/rbac/models/role.go +++ b/authorization/rbac/models/role.go @@ -4,6 +4,7 @@ import ( "github.com/ArtisanCloud/PowerLibs/v2/database" "github.com/ArtisanCloud/PowerLibs/v2/object" "github.com/ArtisanCloud/PowerLibs/v2/security" + "github.com/pkg/errors" "gorm.io/gorm" ) @@ -129,3 +130,24 @@ func (mdl *Role) GetTreeList(db *gorm.DB, conditions *map[string]interface{}, pr return roles, err } + +func (mdl *Role) CheckRoleNameAvailable(db *gorm.DB) (err error) { + + result := db. + //Debug(). + Where("name", mdl.Name). + Where("index_role_id != ?", mdl.UniqueID). + First(&Role{}) + + if result.Error != nil && errors.Is(result.Error, gorm.ErrRecordNotFound) { + return nil + } + + if result.Error != nil { + return result.Error + } + + err = errors.New("role name is not available") + + return err +} diff --git a/database/tag/tagGroup.go b/database/tag/tagGroup.go index 3d1d276..6300cdd 100644 --- a/database/tag/tagGroup.go +++ b/database/tag/tagGroup.go @@ -95,6 +95,28 @@ func (mdl *TagGroup) GetComposedUniqueID() string { return hashKey } +func (mdl *TagGroup) CheckTagGroupNameAvailable(db *gorm.DB) (err error) { + + result := db. + //Debug(). + Where("group_name", mdl.GroupName). + Where("owner_type", mdl.OwnerType). + Where("index_tag_group_id != ?", mdl.UniqueID). + First(&TagGroup{}) + + if result.Error != nil && errors.Is(result.Error, gorm.ErrRecordNotFound) { + return nil + } + + if result.Error != nil { + return result.Error + } + + err = errors.New("tag group name is not available") + + return err +} + /** * Relationships */ diff --git a/go.mod b/go.mod index 559d2ad..aad642e 100644 --- a/go.mod +++ b/go.mod @@ -14,12 +14,8 @@ require ( ) require ( - github.com/getkin/kin-openapi v0.98.0 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/swag v0.22.0 // indirect - github.com/invopop/yaml v0.2.0 // indirect - github.com/josharian/intern v1.0.0 // indirect - github.com/mailru/easyjson v0.7.7 // indirect + github.com/kr/text v0.2.0 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect ) require ( diff --git a/go.sum b/go.sum index 166d28c..5a88e9b 100644 --- a/go.sum +++ b/go.sum @@ -8,6 +8,7 @@ github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -16,17 +17,10 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cu github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/getkin/kin-openapi v0.98.0 h1:lIACvCG9cxmFsEywz+LCoVhcZHFLUy+Nv5QSkb43eAE= -github.com/getkin/kin-openapi v0.98.0/go.mod h1:w4lRPHiyOdwGbOkLIyk+P0qCwlu7TXPCHD/64nSXzgE= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU= github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.22.0 h1:1VXunYCNgapcSzFtcY+eBmrwESlYCnFJZahQRgTRoo8= -github.com/go-openapi/swag v0.22.0/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= @@ -66,15 +60,11 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/guonaihong/gout v0.2.12 h1:ZNtg0Nq6yzlBNgDhFF2YaRdngZCIPuijgaA0s+rCvfY= github.com/guonaihong/gout v0.2.12/go.mod h1:25bJRA+9fErgSvEUF5UAazc9dME+VdkjrFu7yrrVQUg= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/invopop/yaml v0.1.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= -github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= -github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= @@ -82,25 +72,21 @@ github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= @@ -147,10 +133,9 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= @@ -237,8 +222,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= @@ -246,14 +232,11 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/gorm v1.23.6 h1:KFLdNgri4ExFFGTRGGFWON2P1ZN28+9SJRN8voOoYe0=