auth.pb.go 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: auth.proto
  3. package authpb
  4. import (
  5. fmt "fmt"
  6. io "io"
  7. math "math"
  8. math_bits "math/bits"
  9. _ "github.com/gogo/protobuf/gogoproto"
  10. proto "github.com/golang/protobuf/proto"
  11. )
  12. // Reference imports to suppress errors if they are not otherwise used.
  13. var _ = proto.Marshal
  14. var _ = fmt.Errorf
  15. var _ = math.Inf
  16. // This is a compile-time assertion to ensure that this generated file
  17. // is compatible with the proto package it is being compiled against.
  18. // A compilation error at this line likely means your copy of the
  19. // proto package needs to be updated.
  20. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  21. type Permission_Type int32
  22. const (
  23. READ Permission_Type = 0
  24. WRITE Permission_Type = 1
  25. READWRITE Permission_Type = 2
  26. )
  27. var Permission_Type_name = map[int32]string{
  28. 0: "READ",
  29. 1: "WRITE",
  30. 2: "READWRITE",
  31. }
  32. var Permission_Type_value = map[string]int32{
  33. "READ": 0,
  34. "WRITE": 1,
  35. "READWRITE": 2,
  36. }
  37. func (x Permission_Type) String() string {
  38. return proto.EnumName(Permission_Type_name, int32(x))
  39. }
  40. func (Permission_Type) EnumDescriptor() ([]byte, []int) {
  41. return fileDescriptor_8bbd6f3875b0e874, []int{1, 0}
  42. }
  43. // User is a single entry in the bucket authUsers
  44. type User struct {
  45. Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  46. Password []byte `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
  47. Roles []string `protobuf:"bytes,3,rep,name=roles,proto3" json:"roles,omitempty"`
  48. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  49. XXX_unrecognized []byte `json:"-"`
  50. XXX_sizecache int32 `json:"-"`
  51. }
  52. func (m *User) Reset() { *m = User{} }
  53. func (m *User) String() string { return proto.CompactTextString(m) }
  54. func (*User) ProtoMessage() {}
  55. func (*User) Descriptor() ([]byte, []int) {
  56. return fileDescriptor_8bbd6f3875b0e874, []int{0}
  57. }
  58. func (m *User) XXX_Unmarshal(b []byte) error {
  59. return m.Unmarshal(b)
  60. }
  61. func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  62. if deterministic {
  63. return xxx_messageInfo_User.Marshal(b, m, deterministic)
  64. } else {
  65. b = b[:cap(b)]
  66. n, err := m.MarshalToSizedBuffer(b)
  67. if err != nil {
  68. return nil, err
  69. }
  70. return b[:n], nil
  71. }
  72. }
  73. func (m *User) XXX_Merge(src proto.Message) {
  74. xxx_messageInfo_User.Merge(m, src)
  75. }
  76. func (m *User) XXX_Size() int {
  77. return m.Size()
  78. }
  79. func (m *User) XXX_DiscardUnknown() {
  80. xxx_messageInfo_User.DiscardUnknown(m)
  81. }
  82. var xxx_messageInfo_User proto.InternalMessageInfo
  83. // Permission is a single entity
  84. type Permission struct {
  85. PermType Permission_Type `protobuf:"varint,1,opt,name=permType,proto3,enum=authpb.Permission_Type" json:"permType,omitempty"`
  86. Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
  87. RangeEnd []byte `protobuf:"bytes,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"`
  88. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  89. XXX_unrecognized []byte `json:"-"`
  90. XXX_sizecache int32 `json:"-"`
  91. }
  92. func (m *Permission) Reset() { *m = Permission{} }
  93. func (m *Permission) String() string { return proto.CompactTextString(m) }
  94. func (*Permission) ProtoMessage() {}
  95. func (*Permission) Descriptor() ([]byte, []int) {
  96. return fileDescriptor_8bbd6f3875b0e874, []int{1}
  97. }
  98. func (m *Permission) XXX_Unmarshal(b []byte) error {
  99. return m.Unmarshal(b)
  100. }
  101. func (m *Permission) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  102. if deterministic {
  103. return xxx_messageInfo_Permission.Marshal(b, m, deterministic)
  104. } else {
  105. b = b[:cap(b)]
  106. n, err := m.MarshalToSizedBuffer(b)
  107. if err != nil {
  108. return nil, err
  109. }
  110. return b[:n], nil
  111. }
  112. }
  113. func (m *Permission) XXX_Merge(src proto.Message) {
  114. xxx_messageInfo_Permission.Merge(m, src)
  115. }
  116. func (m *Permission) XXX_Size() int {
  117. return m.Size()
  118. }
  119. func (m *Permission) XXX_DiscardUnknown() {
  120. xxx_messageInfo_Permission.DiscardUnknown(m)
  121. }
  122. var xxx_messageInfo_Permission proto.InternalMessageInfo
  123. // Role is a single entry in the bucket authRoles
  124. type Role struct {
  125. Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  126. KeyPermission []*Permission `protobuf:"bytes,2,rep,name=keyPermission,proto3" json:"keyPermission,omitempty"`
  127. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  128. XXX_unrecognized []byte `json:"-"`
  129. XXX_sizecache int32 `json:"-"`
  130. }
  131. func (m *Role) Reset() { *m = Role{} }
  132. func (m *Role) String() string { return proto.CompactTextString(m) }
  133. func (*Role) ProtoMessage() {}
  134. func (*Role) Descriptor() ([]byte, []int) {
  135. return fileDescriptor_8bbd6f3875b0e874, []int{2}
  136. }
  137. func (m *Role) XXX_Unmarshal(b []byte) error {
  138. return m.Unmarshal(b)
  139. }
  140. func (m *Role) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  141. if deterministic {
  142. return xxx_messageInfo_Role.Marshal(b, m, deterministic)
  143. } else {
  144. b = b[:cap(b)]
  145. n, err := m.MarshalToSizedBuffer(b)
  146. if err != nil {
  147. return nil, err
  148. }
  149. return b[:n], nil
  150. }
  151. }
  152. func (m *Role) XXX_Merge(src proto.Message) {
  153. xxx_messageInfo_Role.Merge(m, src)
  154. }
  155. func (m *Role) XXX_Size() int {
  156. return m.Size()
  157. }
  158. func (m *Role) XXX_DiscardUnknown() {
  159. xxx_messageInfo_Role.DiscardUnknown(m)
  160. }
  161. var xxx_messageInfo_Role proto.InternalMessageInfo
  162. func init() {
  163. proto.RegisterEnum("authpb.Permission_Type", Permission_Type_name, Permission_Type_value)
  164. proto.RegisterType((*User)(nil), "authpb.User")
  165. proto.RegisterType((*Permission)(nil), "authpb.Permission")
  166. proto.RegisterType((*Role)(nil), "authpb.Role")
  167. }
  168. func init() { proto.RegisterFile("auth.proto", fileDescriptor_8bbd6f3875b0e874) }
  169. var fileDescriptor_8bbd6f3875b0e874 = []byte{
  170. // 288 bytes of a gzipped FileDescriptorProto
  171. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xc1, 0x4a, 0xc3, 0x30,
  172. 0x1c, 0xc6, 0x9b, 0xb6, 0x1b, 0xed, 0x5f, 0x27, 0x25, 0x0c, 0x0c, 0x13, 0x42, 0xe9, 0xa9, 0x78,
  173. 0xa8, 0xb0, 0x5d, 0xbc, 0x2a, 0xf6, 0x20, 0x78, 0x90, 0x50, 0xf1, 0x28, 0x1d, 0x0d, 0x75, 0x6c,
  174. 0x6d, 0x4a, 0x32, 0x91, 0xbe, 0x89, 0x07, 0x1f, 0x68, 0xc7, 0x3d, 0x82, 0xab, 0x2f, 0x22, 0x4d,
  175. 0x64, 0x43, 0xdc, 0xed, 0xfb, 0xbe, 0xff, 0x97, 0xe4, 0x97, 0x3f, 0x40, 0xfe, 0xb6, 0x7e, 0x4d,
  176. 0x1a, 0x29, 0xd6, 0x02, 0x0f, 0x7b, 0xdd, 0xcc, 0x27, 0xe3, 0x52, 0x94, 0x42, 0x47, 0x57, 0xbd,
  177. 0x32, 0xd3, 0xe8, 0x01, 0xdc, 0x27, 0xc5, 0x25, 0xc6, 0xe0, 0xd6, 0x79, 0xc5, 0x09, 0x0a, 0x51,
  178. 0x7c, 0xca, 0xb4, 0xc6, 0x13, 0xf0, 0x9a, 0x5c, 0xa9, 0x77, 0x21, 0x0b, 0x62, 0xeb, 0x7c, 0xef,
  179. 0xf1, 0x18, 0x06, 0x52, 0xac, 0xb8, 0x22, 0x4e, 0xe8, 0xc4, 0x3e, 0x33, 0x26, 0xfa, 0x44, 0x00,
  180. 0x8f, 0x5c, 0x56, 0x0b, 0xa5, 0x16, 0xa2, 0xc6, 0x33, 0xf0, 0x1a, 0x2e, 0xab, 0xac, 0x6d, 0xcc,
  181. 0xc5, 0x67, 0xd3, 0xf3, 0xc4, 0xd0, 0x24, 0x87, 0x56, 0xd2, 0x8f, 0xd9, 0xbe, 0x88, 0x03, 0x70,
  182. 0x96, 0xbc, 0xfd, 0x7d, 0xb0, 0x97, 0xf8, 0x02, 0x7c, 0x99, 0xd7, 0x25, 0x7f, 0xe1, 0x75, 0x41,
  183. 0x1c, 0x03, 0xa2, 0x83, 0xb4, 0x2e, 0xa2, 0x4b, 0x70, 0xf5, 0x31, 0x0f, 0x5c, 0x96, 0xde, 0xdc,
  184. 0x05, 0x16, 0xf6, 0x61, 0xf0, 0xcc, 0xee, 0xb3, 0x34, 0x40, 0x78, 0x04, 0x7e, 0x1f, 0x1a, 0x6b,
  185. 0x47, 0x19, 0xb8, 0x4c, 0xac, 0xf8, 0xd1, 0xcf, 0x5e, 0xc3, 0x68, 0xc9, 0xdb, 0x03, 0x16, 0xb1,
  186. 0x43, 0x27, 0x3e, 0x99, 0xe2, 0xff, 0xc0, 0xec, 0x6f, 0xf1, 0x96, 0x6c, 0x76, 0xd4, 0xda, 0xee,
  187. 0xa8, 0xb5, 0xe9, 0x28, 0xda, 0x76, 0x14, 0x7d, 0x75, 0x14, 0x7d, 0x7c, 0x53, 0x6b, 0x3e, 0xd4,
  188. 0x3b, 0x9e, 0xfd, 0x04, 0x00, 0x00, 0xff, 0xff, 0xcc, 0x76, 0x8d, 0x4f, 0x8f, 0x01, 0x00, 0x00,
  189. }
  190. func (m *User) Marshal() (dAtA []byte, err error) {
  191. size := m.Size()
  192. dAtA = make([]byte, size)
  193. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  194. if err != nil {
  195. return nil, err
  196. }
  197. return dAtA[:n], nil
  198. }
  199. func (m *User) MarshalTo(dAtA []byte) (int, error) {
  200. size := m.Size()
  201. return m.MarshalToSizedBuffer(dAtA[:size])
  202. }
  203. func (m *User) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  204. i := len(dAtA)
  205. _ = i
  206. var l int
  207. _ = l
  208. if m.XXX_unrecognized != nil {
  209. i -= len(m.XXX_unrecognized)
  210. copy(dAtA[i:], m.XXX_unrecognized)
  211. }
  212. if len(m.Roles) > 0 {
  213. for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- {
  214. i -= len(m.Roles[iNdEx])
  215. copy(dAtA[i:], m.Roles[iNdEx])
  216. i = encodeVarintAuth(dAtA, i, uint64(len(m.Roles[iNdEx])))
  217. i--
  218. dAtA[i] = 0x1a
  219. }
  220. }
  221. if len(m.Password) > 0 {
  222. i -= len(m.Password)
  223. copy(dAtA[i:], m.Password)
  224. i = encodeVarintAuth(dAtA, i, uint64(len(m.Password)))
  225. i--
  226. dAtA[i] = 0x12
  227. }
  228. if len(m.Name) > 0 {
  229. i -= len(m.Name)
  230. copy(dAtA[i:], m.Name)
  231. i = encodeVarintAuth(dAtA, i, uint64(len(m.Name)))
  232. i--
  233. dAtA[i] = 0xa
  234. }
  235. return len(dAtA) - i, nil
  236. }
  237. func (m *Permission) Marshal() (dAtA []byte, err error) {
  238. size := m.Size()
  239. dAtA = make([]byte, size)
  240. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  241. if err != nil {
  242. return nil, err
  243. }
  244. return dAtA[:n], nil
  245. }
  246. func (m *Permission) MarshalTo(dAtA []byte) (int, error) {
  247. size := m.Size()
  248. return m.MarshalToSizedBuffer(dAtA[:size])
  249. }
  250. func (m *Permission) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  251. i := len(dAtA)
  252. _ = i
  253. var l int
  254. _ = l
  255. if m.XXX_unrecognized != nil {
  256. i -= len(m.XXX_unrecognized)
  257. copy(dAtA[i:], m.XXX_unrecognized)
  258. }
  259. if len(m.RangeEnd) > 0 {
  260. i -= len(m.RangeEnd)
  261. copy(dAtA[i:], m.RangeEnd)
  262. i = encodeVarintAuth(dAtA, i, uint64(len(m.RangeEnd)))
  263. i--
  264. dAtA[i] = 0x1a
  265. }
  266. if len(m.Key) > 0 {
  267. i -= len(m.Key)
  268. copy(dAtA[i:], m.Key)
  269. i = encodeVarintAuth(dAtA, i, uint64(len(m.Key)))
  270. i--
  271. dAtA[i] = 0x12
  272. }
  273. if m.PermType != 0 {
  274. i = encodeVarintAuth(dAtA, i, uint64(m.PermType))
  275. i--
  276. dAtA[i] = 0x8
  277. }
  278. return len(dAtA) - i, nil
  279. }
  280. func (m *Role) Marshal() (dAtA []byte, err error) {
  281. size := m.Size()
  282. dAtA = make([]byte, size)
  283. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  284. if err != nil {
  285. return nil, err
  286. }
  287. return dAtA[:n], nil
  288. }
  289. func (m *Role) MarshalTo(dAtA []byte) (int, error) {
  290. size := m.Size()
  291. return m.MarshalToSizedBuffer(dAtA[:size])
  292. }
  293. func (m *Role) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  294. i := len(dAtA)
  295. _ = i
  296. var l int
  297. _ = l
  298. if m.XXX_unrecognized != nil {
  299. i -= len(m.XXX_unrecognized)
  300. copy(dAtA[i:], m.XXX_unrecognized)
  301. }
  302. if len(m.KeyPermission) > 0 {
  303. for iNdEx := len(m.KeyPermission) - 1; iNdEx >= 0; iNdEx-- {
  304. {
  305. size, err := m.KeyPermission[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  306. if err != nil {
  307. return 0, err
  308. }
  309. i -= size
  310. i = encodeVarintAuth(dAtA, i, uint64(size))
  311. }
  312. i--
  313. dAtA[i] = 0x12
  314. }
  315. }
  316. if len(m.Name) > 0 {
  317. i -= len(m.Name)
  318. copy(dAtA[i:], m.Name)
  319. i = encodeVarintAuth(dAtA, i, uint64(len(m.Name)))
  320. i--
  321. dAtA[i] = 0xa
  322. }
  323. return len(dAtA) - i, nil
  324. }
  325. func encodeVarintAuth(dAtA []byte, offset int, v uint64) int {
  326. offset -= sovAuth(v)
  327. base := offset
  328. for v >= 1<<7 {
  329. dAtA[offset] = uint8(v&0x7f | 0x80)
  330. v >>= 7
  331. offset++
  332. }
  333. dAtA[offset] = uint8(v)
  334. return base
  335. }
  336. func (m *User) Size() (n int) {
  337. if m == nil {
  338. return 0
  339. }
  340. var l int
  341. _ = l
  342. l = len(m.Name)
  343. if l > 0 {
  344. n += 1 + l + sovAuth(uint64(l))
  345. }
  346. l = len(m.Password)
  347. if l > 0 {
  348. n += 1 + l + sovAuth(uint64(l))
  349. }
  350. if len(m.Roles) > 0 {
  351. for _, s := range m.Roles {
  352. l = len(s)
  353. n += 1 + l + sovAuth(uint64(l))
  354. }
  355. }
  356. if m.XXX_unrecognized != nil {
  357. n += len(m.XXX_unrecognized)
  358. }
  359. return n
  360. }
  361. func (m *Permission) Size() (n int) {
  362. if m == nil {
  363. return 0
  364. }
  365. var l int
  366. _ = l
  367. if m.PermType != 0 {
  368. n += 1 + sovAuth(uint64(m.PermType))
  369. }
  370. l = len(m.Key)
  371. if l > 0 {
  372. n += 1 + l + sovAuth(uint64(l))
  373. }
  374. l = len(m.RangeEnd)
  375. if l > 0 {
  376. n += 1 + l + sovAuth(uint64(l))
  377. }
  378. if m.XXX_unrecognized != nil {
  379. n += len(m.XXX_unrecognized)
  380. }
  381. return n
  382. }
  383. func (m *Role) Size() (n int) {
  384. if m == nil {
  385. return 0
  386. }
  387. var l int
  388. _ = l
  389. l = len(m.Name)
  390. if l > 0 {
  391. n += 1 + l + sovAuth(uint64(l))
  392. }
  393. if len(m.KeyPermission) > 0 {
  394. for _, e := range m.KeyPermission {
  395. l = e.Size()
  396. n += 1 + l + sovAuth(uint64(l))
  397. }
  398. }
  399. if m.XXX_unrecognized != nil {
  400. n += len(m.XXX_unrecognized)
  401. }
  402. return n
  403. }
  404. func sovAuth(x uint64) (n int) {
  405. return (math_bits.Len64(x|1) + 6) / 7
  406. }
  407. func sozAuth(x uint64) (n int) {
  408. return sovAuth(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  409. }
  410. func (m *User) Unmarshal(dAtA []byte) error {
  411. l := len(dAtA)
  412. iNdEx := 0
  413. for iNdEx < l {
  414. preIndex := iNdEx
  415. var wire uint64
  416. for shift := uint(0); ; shift += 7 {
  417. if shift >= 64 {
  418. return ErrIntOverflowAuth
  419. }
  420. if iNdEx >= l {
  421. return io.ErrUnexpectedEOF
  422. }
  423. b := dAtA[iNdEx]
  424. iNdEx++
  425. wire |= uint64(b&0x7F) << shift
  426. if b < 0x80 {
  427. break
  428. }
  429. }
  430. fieldNum := int32(wire >> 3)
  431. wireType := int(wire & 0x7)
  432. if wireType == 4 {
  433. return fmt.Errorf("proto: User: wiretype end group for non-group")
  434. }
  435. if fieldNum <= 0 {
  436. return fmt.Errorf("proto: User: illegal tag %d (wire type %d)", fieldNum, wire)
  437. }
  438. switch fieldNum {
  439. case 1:
  440. if wireType != 2 {
  441. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  442. }
  443. var byteLen int
  444. for shift := uint(0); ; shift += 7 {
  445. if shift >= 64 {
  446. return ErrIntOverflowAuth
  447. }
  448. if iNdEx >= l {
  449. return io.ErrUnexpectedEOF
  450. }
  451. b := dAtA[iNdEx]
  452. iNdEx++
  453. byteLen |= int(b&0x7F) << shift
  454. if b < 0x80 {
  455. break
  456. }
  457. }
  458. if byteLen < 0 {
  459. return ErrInvalidLengthAuth
  460. }
  461. postIndex := iNdEx + byteLen
  462. if postIndex < 0 {
  463. return ErrInvalidLengthAuth
  464. }
  465. if postIndex > l {
  466. return io.ErrUnexpectedEOF
  467. }
  468. m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...)
  469. if m.Name == nil {
  470. m.Name = []byte{}
  471. }
  472. iNdEx = postIndex
  473. case 2:
  474. if wireType != 2 {
  475. return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType)
  476. }
  477. var byteLen int
  478. for shift := uint(0); ; shift += 7 {
  479. if shift >= 64 {
  480. return ErrIntOverflowAuth
  481. }
  482. if iNdEx >= l {
  483. return io.ErrUnexpectedEOF
  484. }
  485. b := dAtA[iNdEx]
  486. iNdEx++
  487. byteLen |= int(b&0x7F) << shift
  488. if b < 0x80 {
  489. break
  490. }
  491. }
  492. if byteLen < 0 {
  493. return ErrInvalidLengthAuth
  494. }
  495. postIndex := iNdEx + byteLen
  496. if postIndex < 0 {
  497. return ErrInvalidLengthAuth
  498. }
  499. if postIndex > l {
  500. return io.ErrUnexpectedEOF
  501. }
  502. m.Password = append(m.Password[:0], dAtA[iNdEx:postIndex]...)
  503. if m.Password == nil {
  504. m.Password = []byte{}
  505. }
  506. iNdEx = postIndex
  507. case 3:
  508. if wireType != 2 {
  509. return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType)
  510. }
  511. var stringLen uint64
  512. for shift := uint(0); ; shift += 7 {
  513. if shift >= 64 {
  514. return ErrIntOverflowAuth
  515. }
  516. if iNdEx >= l {
  517. return io.ErrUnexpectedEOF
  518. }
  519. b := dAtA[iNdEx]
  520. iNdEx++
  521. stringLen |= uint64(b&0x7F) << shift
  522. if b < 0x80 {
  523. break
  524. }
  525. }
  526. intStringLen := int(stringLen)
  527. if intStringLen < 0 {
  528. return ErrInvalidLengthAuth
  529. }
  530. postIndex := iNdEx + intStringLen
  531. if postIndex < 0 {
  532. return ErrInvalidLengthAuth
  533. }
  534. if postIndex > l {
  535. return io.ErrUnexpectedEOF
  536. }
  537. m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex]))
  538. iNdEx = postIndex
  539. default:
  540. iNdEx = preIndex
  541. skippy, err := skipAuth(dAtA[iNdEx:])
  542. if err != nil {
  543. return err
  544. }
  545. if skippy < 0 {
  546. return ErrInvalidLengthAuth
  547. }
  548. if (iNdEx + skippy) < 0 {
  549. return ErrInvalidLengthAuth
  550. }
  551. if (iNdEx + skippy) > l {
  552. return io.ErrUnexpectedEOF
  553. }
  554. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  555. iNdEx += skippy
  556. }
  557. }
  558. if iNdEx > l {
  559. return io.ErrUnexpectedEOF
  560. }
  561. return nil
  562. }
  563. func (m *Permission) Unmarshal(dAtA []byte) error {
  564. l := len(dAtA)
  565. iNdEx := 0
  566. for iNdEx < l {
  567. preIndex := iNdEx
  568. var wire uint64
  569. for shift := uint(0); ; shift += 7 {
  570. if shift >= 64 {
  571. return ErrIntOverflowAuth
  572. }
  573. if iNdEx >= l {
  574. return io.ErrUnexpectedEOF
  575. }
  576. b := dAtA[iNdEx]
  577. iNdEx++
  578. wire |= uint64(b&0x7F) << shift
  579. if b < 0x80 {
  580. break
  581. }
  582. }
  583. fieldNum := int32(wire >> 3)
  584. wireType := int(wire & 0x7)
  585. if wireType == 4 {
  586. return fmt.Errorf("proto: Permission: wiretype end group for non-group")
  587. }
  588. if fieldNum <= 0 {
  589. return fmt.Errorf("proto: Permission: illegal tag %d (wire type %d)", fieldNum, wire)
  590. }
  591. switch fieldNum {
  592. case 1:
  593. if wireType != 0 {
  594. return fmt.Errorf("proto: wrong wireType = %d for field PermType", wireType)
  595. }
  596. m.PermType = 0
  597. for shift := uint(0); ; shift += 7 {
  598. if shift >= 64 {
  599. return ErrIntOverflowAuth
  600. }
  601. if iNdEx >= l {
  602. return io.ErrUnexpectedEOF
  603. }
  604. b := dAtA[iNdEx]
  605. iNdEx++
  606. m.PermType |= Permission_Type(b&0x7F) << shift
  607. if b < 0x80 {
  608. break
  609. }
  610. }
  611. case 2:
  612. if wireType != 2 {
  613. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  614. }
  615. var byteLen int
  616. for shift := uint(0); ; shift += 7 {
  617. if shift >= 64 {
  618. return ErrIntOverflowAuth
  619. }
  620. if iNdEx >= l {
  621. return io.ErrUnexpectedEOF
  622. }
  623. b := dAtA[iNdEx]
  624. iNdEx++
  625. byteLen |= int(b&0x7F) << shift
  626. if b < 0x80 {
  627. break
  628. }
  629. }
  630. if byteLen < 0 {
  631. return ErrInvalidLengthAuth
  632. }
  633. postIndex := iNdEx + byteLen
  634. if postIndex < 0 {
  635. return ErrInvalidLengthAuth
  636. }
  637. if postIndex > l {
  638. return io.ErrUnexpectedEOF
  639. }
  640. m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
  641. if m.Key == nil {
  642. m.Key = []byte{}
  643. }
  644. iNdEx = postIndex
  645. case 3:
  646. if wireType != 2 {
  647. return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType)
  648. }
  649. var byteLen int
  650. for shift := uint(0); ; shift += 7 {
  651. if shift >= 64 {
  652. return ErrIntOverflowAuth
  653. }
  654. if iNdEx >= l {
  655. return io.ErrUnexpectedEOF
  656. }
  657. b := dAtA[iNdEx]
  658. iNdEx++
  659. byteLen |= int(b&0x7F) << shift
  660. if b < 0x80 {
  661. break
  662. }
  663. }
  664. if byteLen < 0 {
  665. return ErrInvalidLengthAuth
  666. }
  667. postIndex := iNdEx + byteLen
  668. if postIndex < 0 {
  669. return ErrInvalidLengthAuth
  670. }
  671. if postIndex > l {
  672. return io.ErrUnexpectedEOF
  673. }
  674. m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...)
  675. if m.RangeEnd == nil {
  676. m.RangeEnd = []byte{}
  677. }
  678. iNdEx = postIndex
  679. default:
  680. iNdEx = preIndex
  681. skippy, err := skipAuth(dAtA[iNdEx:])
  682. if err != nil {
  683. return err
  684. }
  685. if skippy < 0 {
  686. return ErrInvalidLengthAuth
  687. }
  688. if (iNdEx + skippy) < 0 {
  689. return ErrInvalidLengthAuth
  690. }
  691. if (iNdEx + skippy) > l {
  692. return io.ErrUnexpectedEOF
  693. }
  694. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  695. iNdEx += skippy
  696. }
  697. }
  698. if iNdEx > l {
  699. return io.ErrUnexpectedEOF
  700. }
  701. return nil
  702. }
  703. func (m *Role) Unmarshal(dAtA []byte) error {
  704. l := len(dAtA)
  705. iNdEx := 0
  706. for iNdEx < l {
  707. preIndex := iNdEx
  708. var wire uint64
  709. for shift := uint(0); ; shift += 7 {
  710. if shift >= 64 {
  711. return ErrIntOverflowAuth
  712. }
  713. if iNdEx >= l {
  714. return io.ErrUnexpectedEOF
  715. }
  716. b := dAtA[iNdEx]
  717. iNdEx++
  718. wire |= uint64(b&0x7F) << shift
  719. if b < 0x80 {
  720. break
  721. }
  722. }
  723. fieldNum := int32(wire >> 3)
  724. wireType := int(wire & 0x7)
  725. if wireType == 4 {
  726. return fmt.Errorf("proto: Role: wiretype end group for non-group")
  727. }
  728. if fieldNum <= 0 {
  729. return fmt.Errorf("proto: Role: illegal tag %d (wire type %d)", fieldNum, wire)
  730. }
  731. switch fieldNum {
  732. case 1:
  733. if wireType != 2 {
  734. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  735. }
  736. var byteLen int
  737. for shift := uint(0); ; shift += 7 {
  738. if shift >= 64 {
  739. return ErrIntOverflowAuth
  740. }
  741. if iNdEx >= l {
  742. return io.ErrUnexpectedEOF
  743. }
  744. b := dAtA[iNdEx]
  745. iNdEx++
  746. byteLen |= int(b&0x7F) << shift
  747. if b < 0x80 {
  748. break
  749. }
  750. }
  751. if byteLen < 0 {
  752. return ErrInvalidLengthAuth
  753. }
  754. postIndex := iNdEx + byteLen
  755. if postIndex < 0 {
  756. return ErrInvalidLengthAuth
  757. }
  758. if postIndex > l {
  759. return io.ErrUnexpectedEOF
  760. }
  761. m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...)
  762. if m.Name == nil {
  763. m.Name = []byte{}
  764. }
  765. iNdEx = postIndex
  766. case 2:
  767. if wireType != 2 {
  768. return fmt.Errorf("proto: wrong wireType = %d for field KeyPermission", wireType)
  769. }
  770. var msglen int
  771. for shift := uint(0); ; shift += 7 {
  772. if shift >= 64 {
  773. return ErrIntOverflowAuth
  774. }
  775. if iNdEx >= l {
  776. return io.ErrUnexpectedEOF
  777. }
  778. b := dAtA[iNdEx]
  779. iNdEx++
  780. msglen |= int(b&0x7F) << shift
  781. if b < 0x80 {
  782. break
  783. }
  784. }
  785. if msglen < 0 {
  786. return ErrInvalidLengthAuth
  787. }
  788. postIndex := iNdEx + msglen
  789. if postIndex < 0 {
  790. return ErrInvalidLengthAuth
  791. }
  792. if postIndex > l {
  793. return io.ErrUnexpectedEOF
  794. }
  795. m.KeyPermission = append(m.KeyPermission, &Permission{})
  796. if err := m.KeyPermission[len(m.KeyPermission)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  797. return err
  798. }
  799. iNdEx = postIndex
  800. default:
  801. iNdEx = preIndex
  802. skippy, err := skipAuth(dAtA[iNdEx:])
  803. if err != nil {
  804. return err
  805. }
  806. if skippy < 0 {
  807. return ErrInvalidLengthAuth
  808. }
  809. if (iNdEx + skippy) < 0 {
  810. return ErrInvalidLengthAuth
  811. }
  812. if (iNdEx + skippy) > l {
  813. return io.ErrUnexpectedEOF
  814. }
  815. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  816. iNdEx += skippy
  817. }
  818. }
  819. if iNdEx > l {
  820. return io.ErrUnexpectedEOF
  821. }
  822. return nil
  823. }
  824. func skipAuth(dAtA []byte) (n int, err error) {
  825. l := len(dAtA)
  826. iNdEx := 0
  827. for iNdEx < l {
  828. var wire uint64
  829. for shift := uint(0); ; shift += 7 {
  830. if shift >= 64 {
  831. return 0, ErrIntOverflowAuth
  832. }
  833. if iNdEx >= l {
  834. return 0, io.ErrUnexpectedEOF
  835. }
  836. b := dAtA[iNdEx]
  837. iNdEx++
  838. wire |= (uint64(b) & 0x7F) << shift
  839. if b < 0x80 {
  840. break
  841. }
  842. }
  843. wireType := int(wire & 0x7)
  844. switch wireType {
  845. case 0:
  846. for shift := uint(0); ; shift += 7 {
  847. if shift >= 64 {
  848. return 0, ErrIntOverflowAuth
  849. }
  850. if iNdEx >= l {
  851. return 0, io.ErrUnexpectedEOF
  852. }
  853. iNdEx++
  854. if dAtA[iNdEx-1] < 0x80 {
  855. break
  856. }
  857. }
  858. return iNdEx, nil
  859. case 1:
  860. iNdEx += 8
  861. return iNdEx, nil
  862. case 2:
  863. var length int
  864. for shift := uint(0); ; shift += 7 {
  865. if shift >= 64 {
  866. return 0, ErrIntOverflowAuth
  867. }
  868. if iNdEx >= l {
  869. return 0, io.ErrUnexpectedEOF
  870. }
  871. b := dAtA[iNdEx]
  872. iNdEx++
  873. length |= (int(b) & 0x7F) << shift
  874. if b < 0x80 {
  875. break
  876. }
  877. }
  878. if length < 0 {
  879. return 0, ErrInvalidLengthAuth
  880. }
  881. iNdEx += length
  882. if iNdEx < 0 {
  883. return 0, ErrInvalidLengthAuth
  884. }
  885. return iNdEx, nil
  886. case 3:
  887. for {
  888. var innerWire uint64
  889. var start int = iNdEx
  890. for shift := uint(0); ; shift += 7 {
  891. if shift >= 64 {
  892. return 0, ErrIntOverflowAuth
  893. }
  894. if iNdEx >= l {
  895. return 0, io.ErrUnexpectedEOF
  896. }
  897. b := dAtA[iNdEx]
  898. iNdEx++
  899. innerWire |= (uint64(b) & 0x7F) << shift
  900. if b < 0x80 {
  901. break
  902. }
  903. }
  904. innerWireType := int(innerWire & 0x7)
  905. if innerWireType == 4 {
  906. break
  907. }
  908. next, err := skipAuth(dAtA[start:])
  909. if err != nil {
  910. return 0, err
  911. }
  912. iNdEx = start + next
  913. if iNdEx < 0 {
  914. return 0, ErrInvalidLengthAuth
  915. }
  916. }
  917. return iNdEx, nil
  918. case 4:
  919. return iNdEx, nil
  920. case 5:
  921. iNdEx += 4
  922. return iNdEx, nil
  923. default:
  924. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  925. }
  926. }
  927. panic("unreachable")
  928. }
  929. var (
  930. ErrInvalidLengthAuth = fmt.Errorf("proto: negative length found during unmarshaling")
  931. ErrIntOverflowAuth = fmt.Errorf("proto: integer overflow")
  932. )