github.com/infraboard/keyauth@v0.8.1/apps/policy/pb/request.proto (about) 1 syntax = "proto3"; 2 3 package infraboard.keyauth.policy; 4 option go_package = "github.com/infraboard/keyauth/apps/policy"; 5 6 import "apps/policy/pb/enum.proto"; 7 import "github.com/infraboard/mcube/pb/page/page.proto"; 8 9 // CreatePolicyRequest 创建策略的请求 10 message CreatePolicyRequest { 11 // 范围 12 // @gotags: bson:"namespace_id" json:"namespace_id" validate:"lte=120" 13 string namespace_id = 1; 14 // 用户 15 // @gotags: bson:"account" json:"account" validate:"required,lte=120" 16 string account = 2; 17 // 角色名称 18 // @gotags: bson:"role_id" json:"role_id" validate:"required,lte=40" 19 string role_id = 3; 20 // 范围控制 21 // @gotags: bson:"scope" json:"scope" 22 string scope = 4; 23 // 策略过期时间 24 // @gotags: bson:"expired_time" json:"expired_time" 25 int64 expired_time = 5; 26 // 策略的类型 27 // @gotags: bson:"type" json:"type" 28 PolicyType type = 6; 29 // 策略所属域 30 // @gotags: bson:"domain" json:"domain" 31 string domain = 7; 32 // 创建者ID 33 // @gotags: bson:"creater" json:"creater" 34 string creater = 8; 35 } 36 37 // QueryPolicyRequest 获取子账号列表 38 message QueryPolicyRequest { 39 // @gotags: bson:"page" json:"page" 40 infraboard.mcube.page.PageRequest page = 1; 41 // @gotags: json:"account,omitempty" 42 string account = 2; 43 // @gotags: json:"role_id,omitempty" 44 string role_id = 3; 45 // @gotags: json:"namespace_id,omitempty" 46 string namespace_id = 4; 47 // @gotags: json:"type,omitempty" 48 PolicyType type = 5; 49 // @gotags: json:"with_role,omitempty" 50 bool with_role = 6; 51 // @gotags: json:"with_namespace,omitempty" 52 bool with_namespace = 7; 53 // @gotags: json:"domain" 54 string domain = 8; 55 } 56 57 // DescribePolicyRequest todo 58 message DescribePolicyRequest { 59 // @gotags: json:"id" 60 string id = 1; 61 } 62 63 // DeletePolicyRequest todo 64 message DeletePolicyRequest { 65 // @gotags: json:"id" 66 string id = 1; 67 // @gotags: json:"account,omitempty" 68 string account = 2; 69 // @gotags: json:"role_id,omitempty" 70 string role_id = 3; 71 // @gotags: json:"namespace_id,omitempty" 72 string namespace_id = 4; 73 // @gotags: json:"type,omitempty" 74 PolicyType type = 5; 75 // @gotags: json:"domain" 76 string domain = 6; 77 }