auth.pb.go 22 KB

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