| Abhay Kumar | 40252eb | 2025-10-13 13:25:53 +0000 | [diff] [blame^] | 1 | // Code generated by protoc-gen-gogo. DO NOT EDIT. |
| 2 | // source: auth.proto |
| 3 | |
| 4 | package authpb |
| 5 | |
| 6 | import ( |
| 7 | fmt "fmt" |
| 8 | io "io" |
| 9 | math "math" |
| 10 | math_bits "math/bits" |
| 11 | |
| 12 | _ "github.com/gogo/protobuf/gogoproto" |
| 13 | proto "github.com/golang/protobuf/proto" |
| 14 | ) |
| 15 | |
| 16 | // Reference imports to suppress errors if they are not otherwise used. |
| 17 | var _ = proto.Marshal |
| 18 | var _ = fmt.Errorf |
| 19 | var _ = math.Inf |
| 20 | |
| 21 | // This is a compile-time assertion to ensure that this generated file |
| 22 | // is compatible with the proto package it is being compiled against. |
| 23 | // A compilation error at this line likely means your copy of the |
| 24 | // proto package needs to be updated. |
| 25 | const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package |
| 26 | |
| 27 | type Permission_Type int32 |
| 28 | |
| 29 | const ( |
| 30 | READ Permission_Type = 0 |
| 31 | WRITE Permission_Type = 1 |
| 32 | READWRITE Permission_Type = 2 |
| 33 | ) |
| 34 | |
| 35 | var Permission_Type_name = map[int32]string{ |
| 36 | 0: "READ", |
| 37 | 1: "WRITE", |
| 38 | 2: "READWRITE", |
| 39 | } |
| 40 | |
| 41 | var Permission_Type_value = map[string]int32{ |
| 42 | "READ": 0, |
| 43 | "WRITE": 1, |
| 44 | "READWRITE": 2, |
| 45 | } |
| 46 | |
| 47 | func (x Permission_Type) String() string { |
| 48 | return proto.EnumName(Permission_Type_name, int32(x)) |
| 49 | } |
| 50 | |
| 51 | func (Permission_Type) EnumDescriptor() ([]byte, []int) { |
| 52 | return fileDescriptor_8bbd6f3875b0e874, []int{2, 0} |
| 53 | } |
| 54 | |
| 55 | type UserAddOptions struct { |
| 56 | NoPassword bool `protobuf:"varint,1,opt,name=no_password,json=noPassword,proto3" json:"no_password,omitempty"` |
| 57 | XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| 58 | XXX_unrecognized []byte `json:"-"` |
| 59 | XXX_sizecache int32 `json:"-"` |
| 60 | } |
| 61 | |
| 62 | func (m *UserAddOptions) Reset() { *m = UserAddOptions{} } |
| 63 | func (m *UserAddOptions) String() string { return proto.CompactTextString(m) } |
| 64 | func (*UserAddOptions) ProtoMessage() {} |
| 65 | func (*UserAddOptions) Descriptor() ([]byte, []int) { |
| 66 | return fileDescriptor_8bbd6f3875b0e874, []int{0} |
| 67 | } |
| 68 | func (m *UserAddOptions) XXX_Unmarshal(b []byte) error { |
| 69 | return m.Unmarshal(b) |
| 70 | } |
| 71 | func (m *UserAddOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| 72 | if deterministic { |
| 73 | return xxx_messageInfo_UserAddOptions.Marshal(b, m, deterministic) |
| 74 | } else { |
| 75 | b = b[:cap(b)] |
| 76 | n, err := m.MarshalToSizedBuffer(b) |
| 77 | if err != nil { |
| 78 | return nil, err |
| 79 | } |
| 80 | return b[:n], nil |
| 81 | } |
| 82 | } |
| 83 | func (m *UserAddOptions) XXX_Merge(src proto.Message) { |
| 84 | xxx_messageInfo_UserAddOptions.Merge(m, src) |
| 85 | } |
| 86 | func (m *UserAddOptions) XXX_Size() int { |
| 87 | return m.Size() |
| 88 | } |
| 89 | func (m *UserAddOptions) XXX_DiscardUnknown() { |
| 90 | xxx_messageInfo_UserAddOptions.DiscardUnknown(m) |
| 91 | } |
| 92 | |
| 93 | var xxx_messageInfo_UserAddOptions proto.InternalMessageInfo |
| 94 | |
| 95 | // User is a single entry in the bucket authUsers |
| 96 | type User struct { |
| 97 | Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` |
| 98 | Password []byte `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` |
| 99 | Roles []string `protobuf:"bytes,3,rep,name=roles,proto3" json:"roles,omitempty"` |
| 100 | Options *UserAddOptions `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"` |
| 101 | XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| 102 | XXX_unrecognized []byte `json:"-"` |
| 103 | XXX_sizecache int32 `json:"-"` |
| 104 | } |
| 105 | |
| 106 | func (m *User) Reset() { *m = User{} } |
| 107 | func (m *User) String() string { return proto.CompactTextString(m) } |
| 108 | func (*User) ProtoMessage() {} |
| 109 | func (*User) Descriptor() ([]byte, []int) { |
| 110 | return fileDescriptor_8bbd6f3875b0e874, []int{1} |
| 111 | } |
| 112 | func (m *User) XXX_Unmarshal(b []byte) error { |
| 113 | return m.Unmarshal(b) |
| 114 | } |
| 115 | func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| 116 | if deterministic { |
| 117 | return xxx_messageInfo_User.Marshal(b, m, deterministic) |
| 118 | } else { |
| 119 | b = b[:cap(b)] |
| 120 | n, err := m.MarshalToSizedBuffer(b) |
| 121 | if err != nil { |
| 122 | return nil, err |
| 123 | } |
| 124 | return b[:n], nil |
| 125 | } |
| 126 | } |
| 127 | func (m *User) XXX_Merge(src proto.Message) { |
| 128 | xxx_messageInfo_User.Merge(m, src) |
| 129 | } |
| 130 | func (m *User) XXX_Size() int { |
| 131 | return m.Size() |
| 132 | } |
| 133 | func (m *User) XXX_DiscardUnknown() { |
| 134 | xxx_messageInfo_User.DiscardUnknown(m) |
| 135 | } |
| 136 | |
| 137 | var xxx_messageInfo_User proto.InternalMessageInfo |
| 138 | |
| 139 | // Permission is a single entity |
| 140 | type Permission struct { |
| 141 | PermType Permission_Type `protobuf:"varint,1,opt,name=permType,proto3,enum=authpb.Permission_Type" json:"permType,omitempty"` |
| 142 | Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` |
| 143 | RangeEnd []byte `protobuf:"bytes,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` |
| 144 | XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| 145 | XXX_unrecognized []byte `json:"-"` |
| 146 | XXX_sizecache int32 `json:"-"` |
| 147 | } |
| 148 | |
| 149 | func (m *Permission) Reset() { *m = Permission{} } |
| 150 | func (m *Permission) String() string { return proto.CompactTextString(m) } |
| 151 | func (*Permission) ProtoMessage() {} |
| 152 | func (*Permission) Descriptor() ([]byte, []int) { |
| 153 | return fileDescriptor_8bbd6f3875b0e874, []int{2} |
| 154 | } |
| 155 | func (m *Permission) XXX_Unmarshal(b []byte) error { |
| 156 | return m.Unmarshal(b) |
| 157 | } |
| 158 | func (m *Permission) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| 159 | if deterministic { |
| 160 | return xxx_messageInfo_Permission.Marshal(b, m, deterministic) |
| 161 | } else { |
| 162 | b = b[:cap(b)] |
| 163 | n, err := m.MarshalToSizedBuffer(b) |
| 164 | if err != nil { |
| 165 | return nil, err |
| 166 | } |
| 167 | return b[:n], nil |
| 168 | } |
| 169 | } |
| 170 | func (m *Permission) XXX_Merge(src proto.Message) { |
| 171 | xxx_messageInfo_Permission.Merge(m, src) |
| 172 | } |
| 173 | func (m *Permission) XXX_Size() int { |
| 174 | return m.Size() |
| 175 | } |
| 176 | func (m *Permission) XXX_DiscardUnknown() { |
| 177 | xxx_messageInfo_Permission.DiscardUnknown(m) |
| 178 | } |
| 179 | |
| 180 | var xxx_messageInfo_Permission proto.InternalMessageInfo |
| 181 | |
| 182 | // Role is a single entry in the bucket authRoles |
| 183 | type Role struct { |
| 184 | Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` |
| 185 | KeyPermission []*Permission `protobuf:"bytes,2,rep,name=keyPermission,proto3" json:"keyPermission,omitempty"` |
| 186 | XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| 187 | XXX_unrecognized []byte `json:"-"` |
| 188 | XXX_sizecache int32 `json:"-"` |
| 189 | } |
| 190 | |
| 191 | func (m *Role) Reset() { *m = Role{} } |
| 192 | func (m *Role) String() string { return proto.CompactTextString(m) } |
| 193 | func (*Role) ProtoMessage() {} |
| 194 | func (*Role) Descriptor() ([]byte, []int) { |
| 195 | return fileDescriptor_8bbd6f3875b0e874, []int{3} |
| 196 | } |
| 197 | func (m *Role) XXX_Unmarshal(b []byte) error { |
| 198 | return m.Unmarshal(b) |
| 199 | } |
| 200 | func (m *Role) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| 201 | if deterministic { |
| 202 | return xxx_messageInfo_Role.Marshal(b, m, deterministic) |
| 203 | } else { |
| 204 | b = b[:cap(b)] |
| 205 | n, err := m.MarshalToSizedBuffer(b) |
| 206 | if err != nil { |
| 207 | return nil, err |
| 208 | } |
| 209 | return b[:n], nil |
| 210 | } |
| 211 | } |
| 212 | func (m *Role) XXX_Merge(src proto.Message) { |
| 213 | xxx_messageInfo_Role.Merge(m, src) |
| 214 | } |
| 215 | func (m *Role) XXX_Size() int { |
| 216 | return m.Size() |
| 217 | } |
| 218 | func (m *Role) XXX_DiscardUnknown() { |
| 219 | xxx_messageInfo_Role.DiscardUnknown(m) |
| 220 | } |
| 221 | |
| 222 | var xxx_messageInfo_Role proto.InternalMessageInfo |
| 223 | |
| 224 | func init() { |
| 225 | proto.RegisterEnum("authpb.Permission_Type", Permission_Type_name, Permission_Type_value) |
| 226 | proto.RegisterType((*UserAddOptions)(nil), "authpb.UserAddOptions") |
| 227 | proto.RegisterType((*User)(nil), "authpb.User") |
| 228 | proto.RegisterType((*Permission)(nil), "authpb.Permission") |
| 229 | proto.RegisterType((*Role)(nil), "authpb.Role") |
| 230 | } |
| 231 | |
| 232 | func init() { proto.RegisterFile("auth.proto", fileDescriptor_8bbd6f3875b0e874) } |
| 233 | |
| 234 | var fileDescriptor_8bbd6f3875b0e874 = []byte{ |
| 235 | // 359 bytes of a gzipped FileDescriptorProto |
| 236 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xcf, 0x4e, 0xc2, 0x40, |
| 237 | 0x10, 0xc6, 0xbb, 0xb4, 0x60, 0x3b, 0x08, 0x21, 0x1b, 0xa2, 0x0d, 0xc6, 0xda, 0xf4, 0xd4, 0x78, |
| 238 | 0x68, 0x15, 0x0e, 0x7a, 0xc5, 0xc8, 0xc1, 0x93, 0x64, 0x83, 0x31, 0xf1, 0x42, 0x8a, 0xdd, 0xd4, |
| 239 | 0x06, 0xd8, 0x6d, 0xda, 0xaa, 0xe1, 0xe2, 0x73, 0x78, 0xf0, 0x81, 0x38, 0xf2, 0x08, 0x82, 0x2f, |
| 240 | 0x62, 0xba, 0xcb, 0x9f, 0x10, 0x3d, 0xed, 0x37, 0xdf, 0x7c, 0x33, 0xfb, 0xcb, 0x2e, 0x40, 0xf0, |
| 241 | 0x9a, 0xbf, 0x78, 0x49, 0xca, 0x73, 0x8e, 0x2b, 0x85, 0x4e, 0x46, 0xad, 0x66, 0xc4, 0x23, 0x2e, |
| 242 | 0x2c, 0xbf, 0x50, 0xb2, 0xeb, 0x5c, 0x42, 0xfd, 0x21, 0xa3, 0x69, 0x37, 0x0c, 0xef, 0x93, 0x3c, |
| 243 | 0xe6, 0x2c, 0xc3, 0x67, 0x50, 0x65, 0x7c, 0x98, 0x04, 0x59, 0xf6, 0xce, 0xd3, 0xd0, 0x44, 0x36, |
| 244 | 0x72, 0x75, 0x02, 0x8c, 0xf7, 0xd7, 0x8e, 0xf3, 0x01, 0x5a, 0x31, 0x82, 0x31, 0x68, 0x2c, 0x98, |
| 245 | 0x52, 0x91, 0x38, 0x24, 0x42, 0xe3, 0x16, 0xe8, 0xdb, 0xc9, 0x92, 0xf0, 0xb7, 0x35, 0x6e, 0x42, |
| 246 | 0x39, 0xe5, 0x13, 0x9a, 0x99, 0xaa, 0xad, 0xba, 0x06, 0x91, 0x05, 0xbe, 0x80, 0x03, 0x2e, 0x6f, |
| 247 | 0x36, 0x35, 0x1b, 0xb9, 0xd5, 0xf6, 0x91, 0x27, 0x81, 0xbd, 0x7d, 0x2e, 0xb2, 0x89, 0x39, 0x5f, |
| 248 | 0x08, 0xa0, 0x4f, 0xd3, 0x69, 0x9c, 0x65, 0x31, 0x67, 0xb8, 0x03, 0x7a, 0x42, 0xd3, 0xe9, 0x60, |
| 249 | 0x96, 0x48, 0x94, 0x7a, 0xfb, 0x78, 0xb3, 0x61, 0x97, 0xf2, 0x8a, 0x36, 0xd9, 0x06, 0x71, 0x03, |
| 250 | 0xd4, 0x31, 0x9d, 0xad, 0x11, 0x0b, 0x89, 0x4f, 0xc0, 0x48, 0x03, 0x16, 0xd1, 0x21, 0x65, 0xa1, |
| 251 | 0xa9, 0x4a, 0x74, 0x61, 0xf4, 0x58, 0xe8, 0x9c, 0x83, 0x26, 0xc6, 0x74, 0xd0, 0x48, 0xaf, 0x7b, |
| 252 | 0xdb, 0x50, 0xb0, 0x01, 0xe5, 0x47, 0x72, 0x37, 0xe8, 0x35, 0x10, 0xae, 0x81, 0x51, 0x98, 0xb2, |
| 253 | 0x2c, 0x39, 0x03, 0xd0, 0x08, 0x9f, 0xd0, 0x7f, 0x9f, 0xe7, 0x1a, 0x6a, 0x63, 0x3a, 0xdb, 0x61, |
| 254 | 0x99, 0x25, 0x5b, 0x75, 0xab, 0x6d, 0xfc, 0x17, 0x98, 0xec, 0x07, 0x6f, 0xae, 0xe6, 0x4b, 0x4b, |
| 255 | 0x59, 0x2c, 0x2d, 0x65, 0xbe, 0xb2, 0xd0, 0x62, 0x65, 0xa1, 0xef, 0x95, 0x85, 0x3e, 0x7f, 0x2c, |
| 256 | 0xe5, 0xe9, 0x34, 0xe2, 0x1e, 0xcd, 0x9f, 0x43, 0x2f, 0xe6, 0x7e, 0x71, 0xfa, 0x41, 0x12, 0xfb, |
| 257 | 0x6f, 0x1d, 0x5f, 0xae, 0x1c, 0x55, 0xc4, 0x3f, 0x77, 0x7e, 0x03, 0x00, 0x00, 0xff, 0xff, 0x61, |
| 258 | 0x5a, 0xfe, 0x48, 0x13, 0x02, 0x00, 0x00, |
| 259 | } |
| 260 | |
| 261 | func (m *UserAddOptions) Marshal() (dAtA []byte, err error) { |
| 262 | size := m.Size() |
| 263 | dAtA = make([]byte, size) |
| 264 | n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| 265 | if err != nil { |
| 266 | return nil, err |
| 267 | } |
| 268 | return dAtA[:n], nil |
| 269 | } |
| 270 | |
| 271 | func (m *UserAddOptions) MarshalTo(dAtA []byte) (int, error) { |
| 272 | size := m.Size() |
| 273 | return m.MarshalToSizedBuffer(dAtA[:size]) |
| 274 | } |
| 275 | |
| 276 | func (m *UserAddOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| 277 | i := len(dAtA) |
| 278 | _ = i |
| 279 | var l int |
| 280 | _ = l |
| 281 | if m.XXX_unrecognized != nil { |
| 282 | i -= len(m.XXX_unrecognized) |
| 283 | copy(dAtA[i:], m.XXX_unrecognized) |
| 284 | } |
| 285 | if m.NoPassword { |
| 286 | i-- |
| 287 | if m.NoPassword { |
| 288 | dAtA[i] = 1 |
| 289 | } else { |
| 290 | dAtA[i] = 0 |
| 291 | } |
| 292 | i-- |
| 293 | dAtA[i] = 0x8 |
| 294 | } |
| 295 | return len(dAtA) - i, nil |
| 296 | } |
| 297 | |
| 298 | func (m *User) Marshal() (dAtA []byte, err error) { |
| 299 | size := m.Size() |
| 300 | dAtA = make([]byte, size) |
| 301 | n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| 302 | if err != nil { |
| 303 | return nil, err |
| 304 | } |
| 305 | return dAtA[:n], nil |
| 306 | } |
| 307 | |
| 308 | func (m *User) MarshalTo(dAtA []byte) (int, error) { |
| 309 | size := m.Size() |
| 310 | return m.MarshalToSizedBuffer(dAtA[:size]) |
| 311 | } |
| 312 | |
| 313 | func (m *User) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| 314 | i := len(dAtA) |
| 315 | _ = i |
| 316 | var l int |
| 317 | _ = l |
| 318 | if m.XXX_unrecognized != nil { |
| 319 | i -= len(m.XXX_unrecognized) |
| 320 | copy(dAtA[i:], m.XXX_unrecognized) |
| 321 | } |
| 322 | if m.Options != nil { |
| 323 | { |
| 324 | size, err := m.Options.MarshalToSizedBuffer(dAtA[:i]) |
| 325 | if err != nil { |
| 326 | return 0, err |
| 327 | } |
| 328 | i -= size |
| 329 | i = encodeVarintAuth(dAtA, i, uint64(size)) |
| 330 | } |
| 331 | i-- |
| 332 | dAtA[i] = 0x22 |
| 333 | } |
| 334 | if len(m.Roles) > 0 { |
| 335 | for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- { |
| 336 | i -= len(m.Roles[iNdEx]) |
| 337 | copy(dAtA[i:], m.Roles[iNdEx]) |
| 338 | i = encodeVarintAuth(dAtA, i, uint64(len(m.Roles[iNdEx]))) |
| 339 | i-- |
| 340 | dAtA[i] = 0x1a |
| 341 | } |
| 342 | } |
| 343 | if len(m.Password) > 0 { |
| 344 | i -= len(m.Password) |
| 345 | copy(dAtA[i:], m.Password) |
| 346 | i = encodeVarintAuth(dAtA, i, uint64(len(m.Password))) |
| 347 | i-- |
| 348 | dAtA[i] = 0x12 |
| 349 | } |
| 350 | if len(m.Name) > 0 { |
| 351 | i -= len(m.Name) |
| 352 | copy(dAtA[i:], m.Name) |
| 353 | i = encodeVarintAuth(dAtA, i, uint64(len(m.Name))) |
| 354 | i-- |
| 355 | dAtA[i] = 0xa |
| 356 | } |
| 357 | return len(dAtA) - i, nil |
| 358 | } |
| 359 | |
| 360 | func (m *Permission) Marshal() (dAtA []byte, err error) { |
| 361 | size := m.Size() |
| 362 | dAtA = make([]byte, size) |
| 363 | n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| 364 | if err != nil { |
| 365 | return nil, err |
| 366 | } |
| 367 | return dAtA[:n], nil |
| 368 | } |
| 369 | |
| 370 | func (m *Permission) MarshalTo(dAtA []byte) (int, error) { |
| 371 | size := m.Size() |
| 372 | return m.MarshalToSizedBuffer(dAtA[:size]) |
| 373 | } |
| 374 | |
| 375 | func (m *Permission) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| 376 | i := len(dAtA) |
| 377 | _ = i |
| 378 | var l int |
| 379 | _ = l |
| 380 | if m.XXX_unrecognized != nil { |
| 381 | i -= len(m.XXX_unrecognized) |
| 382 | copy(dAtA[i:], m.XXX_unrecognized) |
| 383 | } |
| 384 | if len(m.RangeEnd) > 0 { |
| 385 | i -= len(m.RangeEnd) |
| 386 | copy(dAtA[i:], m.RangeEnd) |
| 387 | i = encodeVarintAuth(dAtA, i, uint64(len(m.RangeEnd))) |
| 388 | i-- |
| 389 | dAtA[i] = 0x1a |
| 390 | } |
| 391 | if len(m.Key) > 0 { |
| 392 | i -= len(m.Key) |
| 393 | copy(dAtA[i:], m.Key) |
| 394 | i = encodeVarintAuth(dAtA, i, uint64(len(m.Key))) |
| 395 | i-- |
| 396 | dAtA[i] = 0x12 |
| 397 | } |
| 398 | if m.PermType != 0 { |
| 399 | i = encodeVarintAuth(dAtA, i, uint64(m.PermType)) |
| 400 | i-- |
| 401 | dAtA[i] = 0x8 |
| 402 | } |
| 403 | return len(dAtA) - i, nil |
| 404 | } |
| 405 | |
| 406 | func (m *Role) Marshal() (dAtA []byte, err error) { |
| 407 | size := m.Size() |
| 408 | dAtA = make([]byte, size) |
| 409 | n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| 410 | if err != nil { |
| 411 | return nil, err |
| 412 | } |
| 413 | return dAtA[:n], nil |
| 414 | } |
| 415 | |
| 416 | func (m *Role) MarshalTo(dAtA []byte) (int, error) { |
| 417 | size := m.Size() |
| 418 | return m.MarshalToSizedBuffer(dAtA[:size]) |
| 419 | } |
| 420 | |
| 421 | func (m *Role) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| 422 | i := len(dAtA) |
| 423 | _ = i |
| 424 | var l int |
| 425 | _ = l |
| 426 | if m.XXX_unrecognized != nil { |
| 427 | i -= len(m.XXX_unrecognized) |
| 428 | copy(dAtA[i:], m.XXX_unrecognized) |
| 429 | } |
| 430 | if len(m.KeyPermission) > 0 { |
| 431 | for iNdEx := len(m.KeyPermission) - 1; iNdEx >= 0; iNdEx-- { |
| 432 | { |
| 433 | size, err := m.KeyPermission[iNdEx].MarshalToSizedBuffer(dAtA[:i]) |
| 434 | if err != nil { |
| 435 | return 0, err |
| 436 | } |
| 437 | i -= size |
| 438 | i = encodeVarintAuth(dAtA, i, uint64(size)) |
| 439 | } |
| 440 | i-- |
| 441 | dAtA[i] = 0x12 |
| 442 | } |
| 443 | } |
| 444 | if len(m.Name) > 0 { |
| 445 | i -= len(m.Name) |
| 446 | copy(dAtA[i:], m.Name) |
| 447 | i = encodeVarintAuth(dAtA, i, uint64(len(m.Name))) |
| 448 | i-- |
| 449 | dAtA[i] = 0xa |
| 450 | } |
| 451 | return len(dAtA) - i, nil |
| 452 | } |
| 453 | |
| 454 | func encodeVarintAuth(dAtA []byte, offset int, v uint64) int { |
| 455 | offset -= sovAuth(v) |
| 456 | base := offset |
| 457 | for v >= 1<<7 { |
| 458 | dAtA[offset] = uint8(v&0x7f | 0x80) |
| 459 | v >>= 7 |
| 460 | offset++ |
| 461 | } |
| 462 | dAtA[offset] = uint8(v) |
| 463 | return base |
| 464 | } |
| 465 | func (m *UserAddOptions) Size() (n int) { |
| 466 | if m == nil { |
| 467 | return 0 |
| 468 | } |
| 469 | var l int |
| 470 | _ = l |
| 471 | if m.NoPassword { |
| 472 | n += 2 |
| 473 | } |
| 474 | if m.XXX_unrecognized != nil { |
| 475 | n += len(m.XXX_unrecognized) |
| 476 | } |
| 477 | return n |
| 478 | } |
| 479 | |
| 480 | func (m *User) Size() (n int) { |
| 481 | if m == nil { |
| 482 | return 0 |
| 483 | } |
| 484 | var l int |
| 485 | _ = l |
| 486 | l = len(m.Name) |
| 487 | if l > 0 { |
| 488 | n += 1 + l + sovAuth(uint64(l)) |
| 489 | } |
| 490 | l = len(m.Password) |
| 491 | if l > 0 { |
| 492 | n += 1 + l + sovAuth(uint64(l)) |
| 493 | } |
| 494 | if len(m.Roles) > 0 { |
| 495 | for _, s := range m.Roles { |
| 496 | l = len(s) |
| 497 | n += 1 + l + sovAuth(uint64(l)) |
| 498 | } |
| 499 | } |
| 500 | if m.Options != nil { |
| 501 | l = m.Options.Size() |
| 502 | n += 1 + l + sovAuth(uint64(l)) |
| 503 | } |
| 504 | if m.XXX_unrecognized != nil { |
| 505 | n += len(m.XXX_unrecognized) |
| 506 | } |
| 507 | return n |
| 508 | } |
| 509 | |
| 510 | func (m *Permission) Size() (n int) { |
| 511 | if m == nil { |
| 512 | return 0 |
| 513 | } |
| 514 | var l int |
| 515 | _ = l |
| 516 | if m.PermType != 0 { |
| 517 | n += 1 + sovAuth(uint64(m.PermType)) |
| 518 | } |
| 519 | l = len(m.Key) |
| 520 | if l > 0 { |
| 521 | n += 1 + l + sovAuth(uint64(l)) |
| 522 | } |
| 523 | l = len(m.RangeEnd) |
| 524 | if l > 0 { |
| 525 | n += 1 + l + sovAuth(uint64(l)) |
| 526 | } |
| 527 | if m.XXX_unrecognized != nil { |
| 528 | n += len(m.XXX_unrecognized) |
| 529 | } |
| 530 | return n |
| 531 | } |
| 532 | |
| 533 | func (m *Role) Size() (n int) { |
| 534 | if m == nil { |
| 535 | return 0 |
| 536 | } |
| 537 | var l int |
| 538 | _ = l |
| 539 | l = len(m.Name) |
| 540 | if l > 0 { |
| 541 | n += 1 + l + sovAuth(uint64(l)) |
| 542 | } |
| 543 | if len(m.KeyPermission) > 0 { |
| 544 | for _, e := range m.KeyPermission { |
| 545 | l = e.Size() |
| 546 | n += 1 + l + sovAuth(uint64(l)) |
| 547 | } |
| 548 | } |
| 549 | if m.XXX_unrecognized != nil { |
| 550 | n += len(m.XXX_unrecognized) |
| 551 | } |
| 552 | return n |
| 553 | } |
| 554 | |
| 555 | func sovAuth(x uint64) (n int) { |
| 556 | return (math_bits.Len64(x|1) + 6) / 7 |
| 557 | } |
| 558 | func sozAuth(x uint64) (n int) { |
| 559 | return sovAuth(uint64((x << 1) ^ uint64((int64(x) >> 63)))) |
| 560 | } |
| 561 | func (m *UserAddOptions) Unmarshal(dAtA []byte) error { |
| 562 | l := len(dAtA) |
| 563 | iNdEx := 0 |
| 564 | for iNdEx < l { |
| 565 | preIndex := iNdEx |
| 566 | var wire uint64 |
| 567 | for shift := uint(0); ; shift += 7 { |
| 568 | if shift >= 64 { |
| 569 | return ErrIntOverflowAuth |
| 570 | } |
| 571 | if iNdEx >= l { |
| 572 | return io.ErrUnexpectedEOF |
| 573 | } |
| 574 | b := dAtA[iNdEx] |
| 575 | iNdEx++ |
| 576 | wire |= uint64(b&0x7F) << shift |
| 577 | if b < 0x80 { |
| 578 | break |
| 579 | } |
| 580 | } |
| 581 | fieldNum := int32(wire >> 3) |
| 582 | wireType := int(wire & 0x7) |
| 583 | if wireType == 4 { |
| 584 | return fmt.Errorf("proto: UserAddOptions: wiretype end group for non-group") |
| 585 | } |
| 586 | if fieldNum <= 0 { |
| 587 | return fmt.Errorf("proto: UserAddOptions: illegal tag %d (wire type %d)", fieldNum, wire) |
| 588 | } |
| 589 | switch fieldNum { |
| 590 | case 1: |
| 591 | if wireType != 0 { |
| 592 | return fmt.Errorf("proto: wrong wireType = %d for field NoPassword", wireType) |
| 593 | } |
| 594 | var v int |
| 595 | for shift := uint(0); ; shift += 7 { |
| 596 | if shift >= 64 { |
| 597 | return ErrIntOverflowAuth |
| 598 | } |
| 599 | if iNdEx >= l { |
| 600 | return io.ErrUnexpectedEOF |
| 601 | } |
| 602 | b := dAtA[iNdEx] |
| 603 | iNdEx++ |
| 604 | v |= int(b&0x7F) << shift |
| 605 | if b < 0x80 { |
| 606 | break |
| 607 | } |
| 608 | } |
| 609 | m.NoPassword = bool(v != 0) |
| 610 | default: |
| 611 | iNdEx = preIndex |
| 612 | skippy, err := skipAuth(dAtA[iNdEx:]) |
| 613 | if err != nil { |
| 614 | return err |
| 615 | } |
| 616 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 617 | return ErrInvalidLengthAuth |
| 618 | } |
| 619 | if (iNdEx + skippy) > l { |
| 620 | return io.ErrUnexpectedEOF |
| 621 | } |
| 622 | m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) |
| 623 | iNdEx += skippy |
| 624 | } |
| 625 | } |
| 626 | |
| 627 | if iNdEx > l { |
| 628 | return io.ErrUnexpectedEOF |
| 629 | } |
| 630 | return nil |
| 631 | } |
| 632 | func (m *User) Unmarshal(dAtA []byte) error { |
| 633 | l := len(dAtA) |
| 634 | iNdEx := 0 |
| 635 | for iNdEx < l { |
| 636 | preIndex := iNdEx |
| 637 | var wire uint64 |
| 638 | for shift := uint(0); ; shift += 7 { |
| 639 | if shift >= 64 { |
| 640 | return ErrIntOverflowAuth |
| 641 | } |
| 642 | if iNdEx >= l { |
| 643 | return io.ErrUnexpectedEOF |
| 644 | } |
| 645 | b := dAtA[iNdEx] |
| 646 | iNdEx++ |
| 647 | wire |= uint64(b&0x7F) << shift |
| 648 | if b < 0x80 { |
| 649 | break |
| 650 | } |
| 651 | } |
| 652 | fieldNum := int32(wire >> 3) |
| 653 | wireType := int(wire & 0x7) |
| 654 | if wireType == 4 { |
| 655 | return fmt.Errorf("proto: User: wiretype end group for non-group") |
| 656 | } |
| 657 | if fieldNum <= 0 { |
| 658 | return fmt.Errorf("proto: User: illegal tag %d (wire type %d)", fieldNum, wire) |
| 659 | } |
| 660 | switch fieldNum { |
| 661 | case 1: |
| 662 | if wireType != 2 { |
| 663 | return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) |
| 664 | } |
| 665 | var byteLen int |
| 666 | for shift := uint(0); ; shift += 7 { |
| 667 | if shift >= 64 { |
| 668 | return ErrIntOverflowAuth |
| 669 | } |
| 670 | if iNdEx >= l { |
| 671 | return io.ErrUnexpectedEOF |
| 672 | } |
| 673 | b := dAtA[iNdEx] |
| 674 | iNdEx++ |
| 675 | byteLen |= int(b&0x7F) << shift |
| 676 | if b < 0x80 { |
| 677 | break |
| 678 | } |
| 679 | } |
| 680 | if byteLen < 0 { |
| 681 | return ErrInvalidLengthAuth |
| 682 | } |
| 683 | postIndex := iNdEx + byteLen |
| 684 | if postIndex < 0 { |
| 685 | return ErrInvalidLengthAuth |
| 686 | } |
| 687 | if postIndex > l { |
| 688 | return io.ErrUnexpectedEOF |
| 689 | } |
| 690 | m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) |
| 691 | if m.Name == nil { |
| 692 | m.Name = []byte{} |
| 693 | } |
| 694 | iNdEx = postIndex |
| 695 | case 2: |
| 696 | if wireType != 2 { |
| 697 | return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) |
| 698 | } |
| 699 | var byteLen int |
| 700 | for shift := uint(0); ; shift += 7 { |
| 701 | if shift >= 64 { |
| 702 | return ErrIntOverflowAuth |
| 703 | } |
| 704 | if iNdEx >= l { |
| 705 | return io.ErrUnexpectedEOF |
| 706 | } |
| 707 | b := dAtA[iNdEx] |
| 708 | iNdEx++ |
| 709 | byteLen |= int(b&0x7F) << shift |
| 710 | if b < 0x80 { |
| 711 | break |
| 712 | } |
| 713 | } |
| 714 | if byteLen < 0 { |
| 715 | return ErrInvalidLengthAuth |
| 716 | } |
| 717 | postIndex := iNdEx + byteLen |
| 718 | if postIndex < 0 { |
| 719 | return ErrInvalidLengthAuth |
| 720 | } |
| 721 | if postIndex > l { |
| 722 | return io.ErrUnexpectedEOF |
| 723 | } |
| 724 | m.Password = append(m.Password[:0], dAtA[iNdEx:postIndex]...) |
| 725 | if m.Password == nil { |
| 726 | m.Password = []byte{} |
| 727 | } |
| 728 | iNdEx = postIndex |
| 729 | case 3: |
| 730 | if wireType != 2 { |
| 731 | return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) |
| 732 | } |
| 733 | var stringLen uint64 |
| 734 | for shift := uint(0); ; shift += 7 { |
| 735 | if shift >= 64 { |
| 736 | return ErrIntOverflowAuth |
| 737 | } |
| 738 | if iNdEx >= l { |
| 739 | return io.ErrUnexpectedEOF |
| 740 | } |
| 741 | b := dAtA[iNdEx] |
| 742 | iNdEx++ |
| 743 | stringLen |= uint64(b&0x7F) << shift |
| 744 | if b < 0x80 { |
| 745 | break |
| 746 | } |
| 747 | } |
| 748 | intStringLen := int(stringLen) |
| 749 | if intStringLen < 0 { |
| 750 | return ErrInvalidLengthAuth |
| 751 | } |
| 752 | postIndex := iNdEx + intStringLen |
| 753 | if postIndex < 0 { |
| 754 | return ErrInvalidLengthAuth |
| 755 | } |
| 756 | if postIndex > l { |
| 757 | return io.ErrUnexpectedEOF |
| 758 | } |
| 759 | m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) |
| 760 | iNdEx = postIndex |
| 761 | case 4: |
| 762 | if wireType != 2 { |
| 763 | return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) |
| 764 | } |
| 765 | var msglen int |
| 766 | for shift := uint(0); ; shift += 7 { |
| 767 | if shift >= 64 { |
| 768 | return ErrIntOverflowAuth |
| 769 | } |
| 770 | if iNdEx >= l { |
| 771 | return io.ErrUnexpectedEOF |
| 772 | } |
| 773 | b := dAtA[iNdEx] |
| 774 | iNdEx++ |
| 775 | msglen |= int(b&0x7F) << shift |
| 776 | if b < 0x80 { |
| 777 | break |
| 778 | } |
| 779 | } |
| 780 | if msglen < 0 { |
| 781 | return ErrInvalidLengthAuth |
| 782 | } |
| 783 | postIndex := iNdEx + msglen |
| 784 | if postIndex < 0 { |
| 785 | return ErrInvalidLengthAuth |
| 786 | } |
| 787 | if postIndex > l { |
| 788 | return io.ErrUnexpectedEOF |
| 789 | } |
| 790 | if m.Options == nil { |
| 791 | m.Options = &UserAddOptions{} |
| 792 | } |
| 793 | if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 794 | return err |
| 795 | } |
| 796 | iNdEx = postIndex |
| 797 | default: |
| 798 | iNdEx = preIndex |
| 799 | skippy, err := skipAuth(dAtA[iNdEx:]) |
| 800 | if err != nil { |
| 801 | return err |
| 802 | } |
| 803 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 804 | return ErrInvalidLengthAuth |
| 805 | } |
| 806 | if (iNdEx + skippy) > l { |
| 807 | return io.ErrUnexpectedEOF |
| 808 | } |
| 809 | m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) |
| 810 | iNdEx += skippy |
| 811 | } |
| 812 | } |
| 813 | |
| 814 | if iNdEx > l { |
| 815 | return io.ErrUnexpectedEOF |
| 816 | } |
| 817 | return nil |
| 818 | } |
| 819 | func (m *Permission) Unmarshal(dAtA []byte) error { |
| 820 | l := len(dAtA) |
| 821 | iNdEx := 0 |
| 822 | for iNdEx < l { |
| 823 | preIndex := iNdEx |
| 824 | var wire uint64 |
| 825 | for shift := uint(0); ; shift += 7 { |
| 826 | if shift >= 64 { |
| 827 | return ErrIntOverflowAuth |
| 828 | } |
| 829 | if iNdEx >= l { |
| 830 | return io.ErrUnexpectedEOF |
| 831 | } |
| 832 | b := dAtA[iNdEx] |
| 833 | iNdEx++ |
| 834 | wire |= uint64(b&0x7F) << shift |
| 835 | if b < 0x80 { |
| 836 | break |
| 837 | } |
| 838 | } |
| 839 | fieldNum := int32(wire >> 3) |
| 840 | wireType := int(wire & 0x7) |
| 841 | if wireType == 4 { |
| 842 | return fmt.Errorf("proto: Permission: wiretype end group for non-group") |
| 843 | } |
| 844 | if fieldNum <= 0 { |
| 845 | return fmt.Errorf("proto: Permission: illegal tag %d (wire type %d)", fieldNum, wire) |
| 846 | } |
| 847 | switch fieldNum { |
| 848 | case 1: |
| 849 | if wireType != 0 { |
| 850 | return fmt.Errorf("proto: wrong wireType = %d for field PermType", wireType) |
| 851 | } |
| 852 | m.PermType = 0 |
| 853 | for shift := uint(0); ; shift += 7 { |
| 854 | if shift >= 64 { |
| 855 | return ErrIntOverflowAuth |
| 856 | } |
| 857 | if iNdEx >= l { |
| 858 | return io.ErrUnexpectedEOF |
| 859 | } |
| 860 | b := dAtA[iNdEx] |
| 861 | iNdEx++ |
| 862 | m.PermType |= Permission_Type(b&0x7F) << shift |
| 863 | if b < 0x80 { |
| 864 | break |
| 865 | } |
| 866 | } |
| 867 | case 2: |
| 868 | if wireType != 2 { |
| 869 | return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
| 870 | } |
| 871 | var byteLen int |
| 872 | for shift := uint(0); ; shift += 7 { |
| 873 | if shift >= 64 { |
| 874 | return ErrIntOverflowAuth |
| 875 | } |
| 876 | if iNdEx >= l { |
| 877 | return io.ErrUnexpectedEOF |
| 878 | } |
| 879 | b := dAtA[iNdEx] |
| 880 | iNdEx++ |
| 881 | byteLen |= int(b&0x7F) << shift |
| 882 | if b < 0x80 { |
| 883 | break |
| 884 | } |
| 885 | } |
| 886 | if byteLen < 0 { |
| 887 | return ErrInvalidLengthAuth |
| 888 | } |
| 889 | postIndex := iNdEx + byteLen |
| 890 | if postIndex < 0 { |
| 891 | return ErrInvalidLengthAuth |
| 892 | } |
| 893 | if postIndex > l { |
| 894 | return io.ErrUnexpectedEOF |
| 895 | } |
| 896 | m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) |
| 897 | if m.Key == nil { |
| 898 | m.Key = []byte{} |
| 899 | } |
| 900 | iNdEx = postIndex |
| 901 | case 3: |
| 902 | if wireType != 2 { |
| 903 | return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) |
| 904 | } |
| 905 | var byteLen int |
| 906 | for shift := uint(0); ; shift += 7 { |
| 907 | if shift >= 64 { |
| 908 | return ErrIntOverflowAuth |
| 909 | } |
| 910 | if iNdEx >= l { |
| 911 | return io.ErrUnexpectedEOF |
| 912 | } |
| 913 | b := dAtA[iNdEx] |
| 914 | iNdEx++ |
| 915 | byteLen |= int(b&0x7F) << shift |
| 916 | if b < 0x80 { |
| 917 | break |
| 918 | } |
| 919 | } |
| 920 | if byteLen < 0 { |
| 921 | return ErrInvalidLengthAuth |
| 922 | } |
| 923 | postIndex := iNdEx + byteLen |
| 924 | if postIndex < 0 { |
| 925 | return ErrInvalidLengthAuth |
| 926 | } |
| 927 | if postIndex > l { |
| 928 | return io.ErrUnexpectedEOF |
| 929 | } |
| 930 | m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) |
| 931 | if m.RangeEnd == nil { |
| 932 | m.RangeEnd = []byte{} |
| 933 | } |
| 934 | iNdEx = postIndex |
| 935 | default: |
| 936 | iNdEx = preIndex |
| 937 | skippy, err := skipAuth(dAtA[iNdEx:]) |
| 938 | if err != nil { |
| 939 | return err |
| 940 | } |
| 941 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 942 | return ErrInvalidLengthAuth |
| 943 | } |
| 944 | if (iNdEx + skippy) > l { |
| 945 | return io.ErrUnexpectedEOF |
| 946 | } |
| 947 | m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) |
| 948 | iNdEx += skippy |
| 949 | } |
| 950 | } |
| 951 | |
| 952 | if iNdEx > l { |
| 953 | return io.ErrUnexpectedEOF |
| 954 | } |
| 955 | return nil |
| 956 | } |
| 957 | func (m *Role) Unmarshal(dAtA []byte) error { |
| 958 | l := len(dAtA) |
| 959 | iNdEx := 0 |
| 960 | for iNdEx < l { |
| 961 | preIndex := iNdEx |
| 962 | var wire uint64 |
| 963 | for shift := uint(0); ; shift += 7 { |
| 964 | if shift >= 64 { |
| 965 | return ErrIntOverflowAuth |
| 966 | } |
| 967 | if iNdEx >= l { |
| 968 | return io.ErrUnexpectedEOF |
| 969 | } |
| 970 | b := dAtA[iNdEx] |
| 971 | iNdEx++ |
| 972 | wire |= uint64(b&0x7F) << shift |
| 973 | if b < 0x80 { |
| 974 | break |
| 975 | } |
| 976 | } |
| 977 | fieldNum := int32(wire >> 3) |
| 978 | wireType := int(wire & 0x7) |
| 979 | if wireType == 4 { |
| 980 | return fmt.Errorf("proto: Role: wiretype end group for non-group") |
| 981 | } |
| 982 | if fieldNum <= 0 { |
| 983 | return fmt.Errorf("proto: Role: illegal tag %d (wire type %d)", fieldNum, wire) |
| 984 | } |
| 985 | switch fieldNum { |
| 986 | case 1: |
| 987 | if wireType != 2 { |
| 988 | return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) |
| 989 | } |
| 990 | var byteLen int |
| 991 | for shift := uint(0); ; shift += 7 { |
| 992 | if shift >= 64 { |
| 993 | return ErrIntOverflowAuth |
| 994 | } |
| 995 | if iNdEx >= l { |
| 996 | return io.ErrUnexpectedEOF |
| 997 | } |
| 998 | b := dAtA[iNdEx] |
| 999 | iNdEx++ |
| 1000 | byteLen |= int(b&0x7F) << shift |
| 1001 | if b < 0x80 { |
| 1002 | break |
| 1003 | } |
| 1004 | } |
| 1005 | if byteLen < 0 { |
| 1006 | return ErrInvalidLengthAuth |
| 1007 | } |
| 1008 | postIndex := iNdEx + byteLen |
| 1009 | if postIndex < 0 { |
| 1010 | return ErrInvalidLengthAuth |
| 1011 | } |
| 1012 | if postIndex > l { |
| 1013 | return io.ErrUnexpectedEOF |
| 1014 | } |
| 1015 | m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) |
| 1016 | if m.Name == nil { |
| 1017 | m.Name = []byte{} |
| 1018 | } |
| 1019 | iNdEx = postIndex |
| 1020 | case 2: |
| 1021 | if wireType != 2 { |
| 1022 | return fmt.Errorf("proto: wrong wireType = %d for field KeyPermission", wireType) |
| 1023 | } |
| 1024 | var msglen int |
| 1025 | for shift := uint(0); ; shift += 7 { |
| 1026 | if shift >= 64 { |
| 1027 | return ErrIntOverflowAuth |
| 1028 | } |
| 1029 | if iNdEx >= l { |
| 1030 | return io.ErrUnexpectedEOF |
| 1031 | } |
| 1032 | b := dAtA[iNdEx] |
| 1033 | iNdEx++ |
| 1034 | msglen |= int(b&0x7F) << shift |
| 1035 | if b < 0x80 { |
| 1036 | break |
| 1037 | } |
| 1038 | } |
| 1039 | if msglen < 0 { |
| 1040 | return ErrInvalidLengthAuth |
| 1041 | } |
| 1042 | postIndex := iNdEx + msglen |
| 1043 | if postIndex < 0 { |
| 1044 | return ErrInvalidLengthAuth |
| 1045 | } |
| 1046 | if postIndex > l { |
| 1047 | return io.ErrUnexpectedEOF |
| 1048 | } |
| 1049 | m.KeyPermission = append(m.KeyPermission, &Permission{}) |
| 1050 | if err := m.KeyPermission[len(m.KeyPermission)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1051 | return err |
| 1052 | } |
| 1053 | iNdEx = postIndex |
| 1054 | default: |
| 1055 | iNdEx = preIndex |
| 1056 | skippy, err := skipAuth(dAtA[iNdEx:]) |
| 1057 | if err != nil { |
| 1058 | return err |
| 1059 | } |
| 1060 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1061 | return ErrInvalidLengthAuth |
| 1062 | } |
| 1063 | if (iNdEx + skippy) > l { |
| 1064 | return io.ErrUnexpectedEOF |
| 1065 | } |
| 1066 | m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) |
| 1067 | iNdEx += skippy |
| 1068 | } |
| 1069 | } |
| 1070 | |
| 1071 | if iNdEx > l { |
| 1072 | return io.ErrUnexpectedEOF |
| 1073 | } |
| 1074 | return nil |
| 1075 | } |
| 1076 | func skipAuth(dAtA []byte) (n int, err error) { |
| 1077 | l := len(dAtA) |
| 1078 | iNdEx := 0 |
| 1079 | depth := 0 |
| 1080 | for iNdEx < l { |
| 1081 | var wire uint64 |
| 1082 | for shift := uint(0); ; shift += 7 { |
| 1083 | if shift >= 64 { |
| 1084 | return 0, ErrIntOverflowAuth |
| 1085 | } |
| 1086 | if iNdEx >= l { |
| 1087 | return 0, io.ErrUnexpectedEOF |
| 1088 | } |
| 1089 | b := dAtA[iNdEx] |
| 1090 | iNdEx++ |
| 1091 | wire |= (uint64(b) & 0x7F) << shift |
| 1092 | if b < 0x80 { |
| 1093 | break |
| 1094 | } |
| 1095 | } |
| 1096 | wireType := int(wire & 0x7) |
| 1097 | switch wireType { |
| 1098 | case 0: |
| 1099 | for shift := uint(0); ; shift += 7 { |
| 1100 | if shift >= 64 { |
| 1101 | return 0, ErrIntOverflowAuth |
| 1102 | } |
| 1103 | if iNdEx >= l { |
| 1104 | return 0, io.ErrUnexpectedEOF |
| 1105 | } |
| 1106 | iNdEx++ |
| 1107 | if dAtA[iNdEx-1] < 0x80 { |
| 1108 | break |
| 1109 | } |
| 1110 | } |
| 1111 | case 1: |
| 1112 | iNdEx += 8 |
| 1113 | case 2: |
| 1114 | var length int |
| 1115 | for shift := uint(0); ; shift += 7 { |
| 1116 | if shift >= 64 { |
| 1117 | return 0, ErrIntOverflowAuth |
| 1118 | } |
| 1119 | if iNdEx >= l { |
| 1120 | return 0, io.ErrUnexpectedEOF |
| 1121 | } |
| 1122 | b := dAtA[iNdEx] |
| 1123 | iNdEx++ |
| 1124 | length |= (int(b) & 0x7F) << shift |
| 1125 | if b < 0x80 { |
| 1126 | break |
| 1127 | } |
| 1128 | } |
| 1129 | if length < 0 { |
| 1130 | return 0, ErrInvalidLengthAuth |
| 1131 | } |
| 1132 | iNdEx += length |
| 1133 | case 3: |
| 1134 | depth++ |
| 1135 | case 4: |
| 1136 | if depth == 0 { |
| 1137 | return 0, ErrUnexpectedEndOfGroupAuth |
| 1138 | } |
| 1139 | depth-- |
| 1140 | case 5: |
| 1141 | iNdEx += 4 |
| 1142 | default: |
| 1143 | return 0, fmt.Errorf("proto: illegal wireType %d", wireType) |
| 1144 | } |
| 1145 | if iNdEx < 0 { |
| 1146 | return 0, ErrInvalidLengthAuth |
| 1147 | } |
| 1148 | if depth == 0 { |
| 1149 | return iNdEx, nil |
| 1150 | } |
| 1151 | } |
| 1152 | return 0, io.ErrUnexpectedEOF |
| 1153 | } |
| 1154 | |
| 1155 | var ( |
| 1156 | ErrInvalidLengthAuth = fmt.Errorf("proto: negative length found during unmarshaling") |
| 1157 | ErrIntOverflowAuth = fmt.Errorf("proto: integer overflow") |
| 1158 | ErrUnexpectedEndOfGroupAuth = fmt.Errorf("proto: unexpected end of group") |
| 1159 | ) |