...

Source file src/go.etcd.io/etcd/api/v3/authpb/auth.pb.go

Documentation: go.etcd.io/etcd/api/v3/authpb

     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  	// 338 bytes of a gzipped FileDescriptorProto
   236  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xcf, 0x4e, 0xea, 0x40,
   237  	0x14, 0xc6, 0x3b, 0xb4, 0x70, 0xdb, 0xc3, 0x85, 0x90, 0x13, 0x72, 0x6f, 0x83, 0x49, 0x6d, 0xba,
   238  	0x6a, 0x5c, 0x54, 0x85, 0x8d, 0x5b, 0x8c, 0x2c, 0x5c, 0x49, 0x26, 0x18, 0x97, 0xa4, 0xa4, 0x13,
   239  	0x24, 0xc0, 0x4c, 0x33, 0x83, 0x31, 0x6c, 0x7c, 0x0e, 0x17, 0x3e, 0x10, 0x4b, 0x1e, 0x41, 0xf0,
   240  	0x45, 0x4c, 0x67, 0xf8, 0x13, 0xa2, 0xbb, 0xef, 0x7c, 0xe7, 0xfb, 0x66, 0x7e, 0x99, 0x01, 0x48,
   241  	0x5f, 0x16, 0xcf, 0x49, 0x2e, 0xc5, 0x42, 0x60, 0xa5, 0xd0, 0xf9, 0xa8, 0xd5, 0x1c, 0x8b, 0xb1,
   242  	0xd0, 0xd6, 0x65, 0xa1, 0xcc, 0x36, 0xba, 0x86, 0xfa, 0xa3, 0x62, 0xb2, 0x9b, 0x65, 0x0f, 0xf9,
   243  	0x62, 0x22, 0xb8, 0xc2, 0x73, 0xa8, 0x72, 0x31, 0xcc, 0x53, 0xa5, 0x5e, 0x85, 0xcc, 0x7c, 0x12,
   244  	0x92, 0xd8, 0xa5, 0xc0, 0x45, 0x7f, 0xe7, 0x44, 0x6f, 0xe0, 0x14, 0x15, 0x44, 0x70, 0x78, 0x3a,
   245  	0x67, 0x3a, 0xf1, 0x97, 0x6a, 0x8d, 0x2d, 0x70, 0x0f, 0xcd, 0x92, 0xf6, 0x0f, 0x33, 0x36, 0xa1,
   246  	0x2c, 0xc5, 0x8c, 0x29, 0xdf, 0x0e, 0xed, 0xd8, 0xa3, 0x66, 0xc0, 0x2b, 0xf8, 0x23, 0xcc, 0xcd,
   247  	0xbe, 0x13, 0x92, 0xb8, 0xda, 0xfe, 0x97, 0x18, 0xe0, 0xe4, 0x94, 0x8b, 0xee, 0x63, 0xd1, 0x07,
   248  	0x01, 0xe8, 0x33, 0x39, 0x9f, 0x28, 0x35, 0x11, 0x1c, 0x3b, 0xe0, 0xe6, 0x4c, 0xce, 0x07, 0xcb,
   249  	0xdc, 0xa0, 0xd4, 0xdb, 0xff, 0xf7, 0x27, 0x1c, 0x53, 0x49, 0xb1, 0xa6, 0x87, 0x20, 0x36, 0xc0,
   250  	0x9e, 0xb2, 0xe5, 0x0e, 0xb1, 0x90, 0x78, 0x06, 0x9e, 0x4c, 0xf9, 0x98, 0x0d, 0x19, 0xcf, 0x7c,
   251  	0xdb, 0xa0, 0x6b, 0xa3, 0xc7, 0xb3, 0xe8, 0x02, 0x1c, 0x5d, 0x73, 0xc1, 0xa1, 0xbd, 0xee, 0x5d,
   252  	0xc3, 0x42, 0x0f, 0xca, 0x4f, 0xf4, 0x7e, 0xd0, 0x6b, 0x10, 0xac, 0x81, 0x57, 0x98, 0x66, 0x2c,
   253  	0x45, 0x03, 0x70, 0xa8, 0x98, 0xb1, 0x5f, 0x9f, 0xe7, 0x06, 0x6a, 0x53, 0xb6, 0x3c, 0x62, 0xf9,
   254  	0xa5, 0xd0, 0x8e, 0xab, 0x6d, 0xfc, 0x09, 0x4c, 0x4f, 0x83, 0xb7, 0xfe, 0x6a, 0x13, 0x58, 0xeb,
   255  	0x4d, 0x60, 0xad, 0xb6, 0x01, 0x59, 0x6f, 0x03, 0xf2, 0xb9, 0x0d, 0xc8, 0xfb, 0x57, 0x60, 0x8d,
   256  	0x2a, 0xfa, 0x23, 0x3b, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x61, 0x66, 0xc6, 0x9d, 0xf4, 0x01,
   257  	0x00, 0x00,
   258  }
   259  
   260  func (m *UserAddOptions) Marshal() (dAtA []byte, err error) {
   261  	size := m.Size()
   262  	dAtA = make([]byte, size)
   263  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   264  	if err != nil {
   265  		return nil, err
   266  	}
   267  	return dAtA[:n], nil
   268  }
   269  
   270  func (m *UserAddOptions) MarshalTo(dAtA []byte) (int, error) {
   271  	size := m.Size()
   272  	return m.MarshalToSizedBuffer(dAtA[:size])
   273  }
   274  
   275  func (m *UserAddOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   276  	i := len(dAtA)
   277  	_ = i
   278  	var l int
   279  	_ = l
   280  	if m.XXX_unrecognized != nil {
   281  		i -= len(m.XXX_unrecognized)
   282  		copy(dAtA[i:], m.XXX_unrecognized)
   283  	}
   284  	if m.NoPassword {
   285  		i--
   286  		if m.NoPassword {
   287  			dAtA[i] = 1
   288  		} else {
   289  			dAtA[i] = 0
   290  		}
   291  		i--
   292  		dAtA[i] = 0x8
   293  	}
   294  	return len(dAtA) - i, nil
   295  }
   296  
   297  func (m *User) Marshal() (dAtA []byte, err error) {
   298  	size := m.Size()
   299  	dAtA = make([]byte, size)
   300  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   301  	if err != nil {
   302  		return nil, err
   303  	}
   304  	return dAtA[:n], nil
   305  }
   306  
   307  func (m *User) MarshalTo(dAtA []byte) (int, error) {
   308  	size := m.Size()
   309  	return m.MarshalToSizedBuffer(dAtA[:size])
   310  }
   311  
   312  func (m *User) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   313  	i := len(dAtA)
   314  	_ = i
   315  	var l int
   316  	_ = l
   317  	if m.XXX_unrecognized != nil {
   318  		i -= len(m.XXX_unrecognized)
   319  		copy(dAtA[i:], m.XXX_unrecognized)
   320  	}
   321  	if m.Options != nil {
   322  		{
   323  			size, err := m.Options.MarshalToSizedBuffer(dAtA[:i])
   324  			if err != nil {
   325  				return 0, err
   326  			}
   327  			i -= size
   328  			i = encodeVarintAuth(dAtA, i, uint64(size))
   329  		}
   330  		i--
   331  		dAtA[i] = 0x22
   332  	}
   333  	if len(m.Roles) > 0 {
   334  		for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- {
   335  			i -= len(m.Roles[iNdEx])
   336  			copy(dAtA[i:], m.Roles[iNdEx])
   337  			i = encodeVarintAuth(dAtA, i, uint64(len(m.Roles[iNdEx])))
   338  			i--
   339  			dAtA[i] = 0x1a
   340  		}
   341  	}
   342  	if len(m.Password) > 0 {
   343  		i -= len(m.Password)
   344  		copy(dAtA[i:], m.Password)
   345  		i = encodeVarintAuth(dAtA, i, uint64(len(m.Password)))
   346  		i--
   347  		dAtA[i] = 0x12
   348  	}
   349  	if len(m.Name) > 0 {
   350  		i -= len(m.Name)
   351  		copy(dAtA[i:], m.Name)
   352  		i = encodeVarintAuth(dAtA, i, uint64(len(m.Name)))
   353  		i--
   354  		dAtA[i] = 0xa
   355  	}
   356  	return len(dAtA) - i, nil
   357  }
   358  
   359  func (m *Permission) Marshal() (dAtA []byte, err error) {
   360  	size := m.Size()
   361  	dAtA = make([]byte, size)
   362  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   363  	if err != nil {
   364  		return nil, err
   365  	}
   366  	return dAtA[:n], nil
   367  }
   368  
   369  func (m *Permission) MarshalTo(dAtA []byte) (int, error) {
   370  	size := m.Size()
   371  	return m.MarshalToSizedBuffer(dAtA[:size])
   372  }
   373  
   374  func (m *Permission) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   375  	i := len(dAtA)
   376  	_ = i
   377  	var l int
   378  	_ = l
   379  	if m.XXX_unrecognized != nil {
   380  		i -= len(m.XXX_unrecognized)
   381  		copy(dAtA[i:], m.XXX_unrecognized)
   382  	}
   383  	if len(m.RangeEnd) > 0 {
   384  		i -= len(m.RangeEnd)
   385  		copy(dAtA[i:], m.RangeEnd)
   386  		i = encodeVarintAuth(dAtA, i, uint64(len(m.RangeEnd)))
   387  		i--
   388  		dAtA[i] = 0x1a
   389  	}
   390  	if len(m.Key) > 0 {
   391  		i -= len(m.Key)
   392  		copy(dAtA[i:], m.Key)
   393  		i = encodeVarintAuth(dAtA, i, uint64(len(m.Key)))
   394  		i--
   395  		dAtA[i] = 0x12
   396  	}
   397  	if m.PermType != 0 {
   398  		i = encodeVarintAuth(dAtA, i, uint64(m.PermType))
   399  		i--
   400  		dAtA[i] = 0x8
   401  	}
   402  	return len(dAtA) - i, nil
   403  }
   404  
   405  func (m *Role) Marshal() (dAtA []byte, err error) {
   406  	size := m.Size()
   407  	dAtA = make([]byte, size)
   408  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   409  	if err != nil {
   410  		return nil, err
   411  	}
   412  	return dAtA[:n], nil
   413  }
   414  
   415  func (m *Role) MarshalTo(dAtA []byte) (int, error) {
   416  	size := m.Size()
   417  	return m.MarshalToSizedBuffer(dAtA[:size])
   418  }
   419  
   420  func (m *Role) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   421  	i := len(dAtA)
   422  	_ = i
   423  	var l int
   424  	_ = l
   425  	if m.XXX_unrecognized != nil {
   426  		i -= len(m.XXX_unrecognized)
   427  		copy(dAtA[i:], m.XXX_unrecognized)
   428  	}
   429  	if len(m.KeyPermission) > 0 {
   430  		for iNdEx := len(m.KeyPermission) - 1; iNdEx >= 0; iNdEx-- {
   431  			{
   432  				size, err := m.KeyPermission[iNdEx].MarshalToSizedBuffer(dAtA[:i])
   433  				if err != nil {
   434  					return 0, err
   435  				}
   436  				i -= size
   437  				i = encodeVarintAuth(dAtA, i, uint64(size))
   438  			}
   439  			i--
   440  			dAtA[i] = 0x12
   441  		}
   442  	}
   443  	if len(m.Name) > 0 {
   444  		i -= len(m.Name)
   445  		copy(dAtA[i:], m.Name)
   446  		i = encodeVarintAuth(dAtA, i, uint64(len(m.Name)))
   447  		i--
   448  		dAtA[i] = 0xa
   449  	}
   450  	return len(dAtA) - i, nil
   451  }
   452  
   453  func encodeVarintAuth(dAtA []byte, offset int, v uint64) int {
   454  	offset -= sovAuth(v)
   455  	base := offset
   456  	for v >= 1<<7 {
   457  		dAtA[offset] = uint8(v&0x7f | 0x80)
   458  		v >>= 7
   459  		offset++
   460  	}
   461  	dAtA[offset] = uint8(v)
   462  	return base
   463  }
   464  func (m *UserAddOptions) Size() (n int) {
   465  	if m == nil {
   466  		return 0
   467  	}
   468  	var l int
   469  	_ = l
   470  	if m.NoPassword {
   471  		n += 2
   472  	}
   473  	if m.XXX_unrecognized != nil {
   474  		n += len(m.XXX_unrecognized)
   475  	}
   476  	return n
   477  }
   478  
   479  func (m *User) Size() (n int) {
   480  	if m == nil {
   481  		return 0
   482  	}
   483  	var l int
   484  	_ = l
   485  	l = len(m.Name)
   486  	if l > 0 {
   487  		n += 1 + l + sovAuth(uint64(l))
   488  	}
   489  	l = len(m.Password)
   490  	if l > 0 {
   491  		n += 1 + l + sovAuth(uint64(l))
   492  	}
   493  	if len(m.Roles) > 0 {
   494  		for _, s := range m.Roles {
   495  			l = len(s)
   496  			n += 1 + l + sovAuth(uint64(l))
   497  		}
   498  	}
   499  	if m.Options != nil {
   500  		l = m.Options.Size()
   501  		n += 1 + l + sovAuth(uint64(l))
   502  	}
   503  	if m.XXX_unrecognized != nil {
   504  		n += len(m.XXX_unrecognized)
   505  	}
   506  	return n
   507  }
   508  
   509  func (m *Permission) Size() (n int) {
   510  	if m == nil {
   511  		return 0
   512  	}
   513  	var l int
   514  	_ = l
   515  	if m.PermType != 0 {
   516  		n += 1 + sovAuth(uint64(m.PermType))
   517  	}
   518  	l = len(m.Key)
   519  	if l > 0 {
   520  		n += 1 + l + sovAuth(uint64(l))
   521  	}
   522  	l = len(m.RangeEnd)
   523  	if l > 0 {
   524  		n += 1 + l + sovAuth(uint64(l))
   525  	}
   526  	if m.XXX_unrecognized != nil {
   527  		n += len(m.XXX_unrecognized)
   528  	}
   529  	return n
   530  }
   531  
   532  func (m *Role) Size() (n int) {
   533  	if m == nil {
   534  		return 0
   535  	}
   536  	var l int
   537  	_ = l
   538  	l = len(m.Name)
   539  	if l > 0 {
   540  		n += 1 + l + sovAuth(uint64(l))
   541  	}
   542  	if len(m.KeyPermission) > 0 {
   543  		for _, e := range m.KeyPermission {
   544  			l = e.Size()
   545  			n += 1 + l + sovAuth(uint64(l))
   546  		}
   547  	}
   548  	if m.XXX_unrecognized != nil {
   549  		n += len(m.XXX_unrecognized)
   550  	}
   551  	return n
   552  }
   553  
   554  func sovAuth(x uint64) (n int) {
   555  	return (math_bits.Len64(x|1) + 6) / 7
   556  }
   557  func sozAuth(x uint64) (n int) {
   558  	return sovAuth(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   559  }
   560  func (m *UserAddOptions) Unmarshal(dAtA []byte) error {
   561  	l := len(dAtA)
   562  	iNdEx := 0
   563  	for iNdEx < l {
   564  		preIndex := iNdEx
   565  		var wire uint64
   566  		for shift := uint(0); ; shift += 7 {
   567  			if shift >= 64 {
   568  				return ErrIntOverflowAuth
   569  			}
   570  			if iNdEx >= l {
   571  				return io.ErrUnexpectedEOF
   572  			}
   573  			b := dAtA[iNdEx]
   574  			iNdEx++
   575  			wire |= uint64(b&0x7F) << shift
   576  			if b < 0x80 {
   577  				break
   578  			}
   579  		}
   580  		fieldNum := int32(wire >> 3)
   581  		wireType := int(wire & 0x7)
   582  		if wireType == 4 {
   583  			return fmt.Errorf("proto: UserAddOptions: wiretype end group for non-group")
   584  		}
   585  		if fieldNum <= 0 {
   586  			return fmt.Errorf("proto: UserAddOptions: illegal tag %d (wire type %d)", fieldNum, wire)
   587  		}
   588  		switch fieldNum {
   589  		case 1:
   590  			if wireType != 0 {
   591  				return fmt.Errorf("proto: wrong wireType = %d for field NoPassword", wireType)
   592  			}
   593  			var v int
   594  			for shift := uint(0); ; shift += 7 {
   595  				if shift >= 64 {
   596  					return ErrIntOverflowAuth
   597  				}
   598  				if iNdEx >= l {
   599  					return io.ErrUnexpectedEOF
   600  				}
   601  				b := dAtA[iNdEx]
   602  				iNdEx++
   603  				v |= int(b&0x7F) << shift
   604  				if b < 0x80 {
   605  					break
   606  				}
   607  			}
   608  			m.NoPassword = bool(v != 0)
   609  		default:
   610  			iNdEx = preIndex
   611  			skippy, err := skipAuth(dAtA[iNdEx:])
   612  			if err != nil {
   613  				return err
   614  			}
   615  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   616  				return ErrInvalidLengthAuth
   617  			}
   618  			if (iNdEx + skippy) > l {
   619  				return io.ErrUnexpectedEOF
   620  			}
   621  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
   622  			iNdEx += skippy
   623  		}
   624  	}
   625  
   626  	if iNdEx > l {
   627  		return io.ErrUnexpectedEOF
   628  	}
   629  	return nil
   630  }
   631  func (m *User) Unmarshal(dAtA []byte) error {
   632  	l := len(dAtA)
   633  	iNdEx := 0
   634  	for iNdEx < l {
   635  		preIndex := iNdEx
   636  		var wire uint64
   637  		for shift := uint(0); ; shift += 7 {
   638  			if shift >= 64 {
   639  				return ErrIntOverflowAuth
   640  			}
   641  			if iNdEx >= l {
   642  				return io.ErrUnexpectedEOF
   643  			}
   644  			b := dAtA[iNdEx]
   645  			iNdEx++
   646  			wire |= uint64(b&0x7F) << shift
   647  			if b < 0x80 {
   648  				break
   649  			}
   650  		}
   651  		fieldNum := int32(wire >> 3)
   652  		wireType := int(wire & 0x7)
   653  		if wireType == 4 {
   654  			return fmt.Errorf("proto: User: wiretype end group for non-group")
   655  		}
   656  		if fieldNum <= 0 {
   657  			return fmt.Errorf("proto: User: illegal tag %d (wire type %d)", fieldNum, wire)
   658  		}
   659  		switch fieldNum {
   660  		case 1:
   661  			if wireType != 2 {
   662  				return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
   663  			}
   664  			var byteLen int
   665  			for shift := uint(0); ; shift += 7 {
   666  				if shift >= 64 {
   667  					return ErrIntOverflowAuth
   668  				}
   669  				if iNdEx >= l {
   670  					return io.ErrUnexpectedEOF
   671  				}
   672  				b := dAtA[iNdEx]
   673  				iNdEx++
   674  				byteLen |= int(b&0x7F) << shift
   675  				if b < 0x80 {
   676  					break
   677  				}
   678  			}
   679  			if byteLen < 0 {
   680  				return ErrInvalidLengthAuth
   681  			}
   682  			postIndex := iNdEx + byteLen
   683  			if postIndex < 0 {
   684  				return ErrInvalidLengthAuth
   685  			}
   686  			if postIndex > l {
   687  				return io.ErrUnexpectedEOF
   688  			}
   689  			m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...)
   690  			if m.Name == nil {
   691  				m.Name = []byte{}
   692  			}
   693  			iNdEx = postIndex
   694  		case 2:
   695  			if wireType != 2 {
   696  				return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType)
   697  			}
   698  			var byteLen int
   699  			for shift := uint(0); ; shift += 7 {
   700  				if shift >= 64 {
   701  					return ErrIntOverflowAuth
   702  				}
   703  				if iNdEx >= l {
   704  					return io.ErrUnexpectedEOF
   705  				}
   706  				b := dAtA[iNdEx]
   707  				iNdEx++
   708  				byteLen |= int(b&0x7F) << shift
   709  				if b < 0x80 {
   710  					break
   711  				}
   712  			}
   713  			if byteLen < 0 {
   714  				return ErrInvalidLengthAuth
   715  			}
   716  			postIndex := iNdEx + byteLen
   717  			if postIndex < 0 {
   718  				return ErrInvalidLengthAuth
   719  			}
   720  			if postIndex > l {
   721  				return io.ErrUnexpectedEOF
   722  			}
   723  			m.Password = append(m.Password[:0], dAtA[iNdEx:postIndex]...)
   724  			if m.Password == nil {
   725  				m.Password = []byte{}
   726  			}
   727  			iNdEx = postIndex
   728  		case 3:
   729  			if wireType != 2 {
   730  				return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType)
   731  			}
   732  			var stringLen uint64
   733  			for shift := uint(0); ; shift += 7 {
   734  				if shift >= 64 {
   735  					return ErrIntOverflowAuth
   736  				}
   737  				if iNdEx >= l {
   738  					return io.ErrUnexpectedEOF
   739  				}
   740  				b := dAtA[iNdEx]
   741  				iNdEx++
   742  				stringLen |= uint64(b&0x7F) << shift
   743  				if b < 0x80 {
   744  					break
   745  				}
   746  			}
   747  			intStringLen := int(stringLen)
   748  			if intStringLen < 0 {
   749  				return ErrInvalidLengthAuth
   750  			}
   751  			postIndex := iNdEx + intStringLen
   752  			if postIndex < 0 {
   753  				return ErrInvalidLengthAuth
   754  			}
   755  			if postIndex > l {
   756  				return io.ErrUnexpectedEOF
   757  			}
   758  			m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex]))
   759  			iNdEx = postIndex
   760  		case 4:
   761  			if wireType != 2 {
   762  				return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType)
   763  			}
   764  			var msglen int
   765  			for shift := uint(0); ; shift += 7 {
   766  				if shift >= 64 {
   767  					return ErrIntOverflowAuth
   768  				}
   769  				if iNdEx >= l {
   770  					return io.ErrUnexpectedEOF
   771  				}
   772  				b := dAtA[iNdEx]
   773  				iNdEx++
   774  				msglen |= int(b&0x7F) << shift
   775  				if b < 0x80 {
   776  					break
   777  				}
   778  			}
   779  			if msglen < 0 {
   780  				return ErrInvalidLengthAuth
   781  			}
   782  			postIndex := iNdEx + msglen
   783  			if postIndex < 0 {
   784  				return ErrInvalidLengthAuth
   785  			}
   786  			if postIndex > l {
   787  				return io.ErrUnexpectedEOF
   788  			}
   789  			if m.Options == nil {
   790  				m.Options = &UserAddOptions{}
   791  			}
   792  			if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   793  				return err
   794  			}
   795  			iNdEx = postIndex
   796  		default:
   797  			iNdEx = preIndex
   798  			skippy, err := skipAuth(dAtA[iNdEx:])
   799  			if err != nil {
   800  				return err
   801  			}
   802  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   803  				return ErrInvalidLengthAuth
   804  			}
   805  			if (iNdEx + skippy) > l {
   806  				return io.ErrUnexpectedEOF
   807  			}
   808  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
   809  			iNdEx += skippy
   810  		}
   811  	}
   812  
   813  	if iNdEx > l {
   814  		return io.ErrUnexpectedEOF
   815  	}
   816  	return nil
   817  }
   818  func (m *Permission) Unmarshal(dAtA []byte) error {
   819  	l := len(dAtA)
   820  	iNdEx := 0
   821  	for iNdEx < l {
   822  		preIndex := iNdEx
   823  		var wire uint64
   824  		for shift := uint(0); ; shift += 7 {
   825  			if shift >= 64 {
   826  				return ErrIntOverflowAuth
   827  			}
   828  			if iNdEx >= l {
   829  				return io.ErrUnexpectedEOF
   830  			}
   831  			b := dAtA[iNdEx]
   832  			iNdEx++
   833  			wire |= uint64(b&0x7F) << shift
   834  			if b < 0x80 {
   835  				break
   836  			}
   837  		}
   838  		fieldNum := int32(wire >> 3)
   839  		wireType := int(wire & 0x7)
   840  		if wireType == 4 {
   841  			return fmt.Errorf("proto: Permission: wiretype end group for non-group")
   842  		}
   843  		if fieldNum <= 0 {
   844  			return fmt.Errorf("proto: Permission: illegal tag %d (wire type %d)", fieldNum, wire)
   845  		}
   846  		switch fieldNum {
   847  		case 1:
   848  			if wireType != 0 {
   849  				return fmt.Errorf("proto: wrong wireType = %d for field PermType", wireType)
   850  			}
   851  			m.PermType = 0
   852  			for shift := uint(0); ; shift += 7 {
   853  				if shift >= 64 {
   854  					return ErrIntOverflowAuth
   855  				}
   856  				if iNdEx >= l {
   857  					return io.ErrUnexpectedEOF
   858  				}
   859  				b := dAtA[iNdEx]
   860  				iNdEx++
   861  				m.PermType |= Permission_Type(b&0x7F) << shift
   862  				if b < 0x80 {
   863  					break
   864  				}
   865  			}
   866  		case 2:
   867  			if wireType != 2 {
   868  				return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
   869  			}
   870  			var byteLen int
   871  			for shift := uint(0); ; shift += 7 {
   872  				if shift >= 64 {
   873  					return ErrIntOverflowAuth
   874  				}
   875  				if iNdEx >= l {
   876  					return io.ErrUnexpectedEOF
   877  				}
   878  				b := dAtA[iNdEx]
   879  				iNdEx++
   880  				byteLen |= int(b&0x7F) << shift
   881  				if b < 0x80 {
   882  					break
   883  				}
   884  			}
   885  			if byteLen < 0 {
   886  				return ErrInvalidLengthAuth
   887  			}
   888  			postIndex := iNdEx + byteLen
   889  			if postIndex < 0 {
   890  				return ErrInvalidLengthAuth
   891  			}
   892  			if postIndex > l {
   893  				return io.ErrUnexpectedEOF
   894  			}
   895  			m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
   896  			if m.Key == nil {
   897  				m.Key = []byte{}
   898  			}
   899  			iNdEx = postIndex
   900  		case 3:
   901  			if wireType != 2 {
   902  				return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType)
   903  			}
   904  			var byteLen int
   905  			for shift := uint(0); ; shift += 7 {
   906  				if shift >= 64 {
   907  					return ErrIntOverflowAuth
   908  				}
   909  				if iNdEx >= l {
   910  					return io.ErrUnexpectedEOF
   911  				}
   912  				b := dAtA[iNdEx]
   913  				iNdEx++
   914  				byteLen |= int(b&0x7F) << shift
   915  				if b < 0x80 {
   916  					break
   917  				}
   918  			}
   919  			if byteLen < 0 {
   920  				return ErrInvalidLengthAuth
   921  			}
   922  			postIndex := iNdEx + byteLen
   923  			if postIndex < 0 {
   924  				return ErrInvalidLengthAuth
   925  			}
   926  			if postIndex > l {
   927  				return io.ErrUnexpectedEOF
   928  			}
   929  			m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...)
   930  			if m.RangeEnd == nil {
   931  				m.RangeEnd = []byte{}
   932  			}
   933  			iNdEx = postIndex
   934  		default:
   935  			iNdEx = preIndex
   936  			skippy, err := skipAuth(dAtA[iNdEx:])
   937  			if err != nil {
   938  				return err
   939  			}
   940  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   941  				return ErrInvalidLengthAuth
   942  			}
   943  			if (iNdEx + skippy) > l {
   944  				return io.ErrUnexpectedEOF
   945  			}
   946  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
   947  			iNdEx += skippy
   948  		}
   949  	}
   950  
   951  	if iNdEx > l {
   952  		return io.ErrUnexpectedEOF
   953  	}
   954  	return nil
   955  }
   956  func (m *Role) Unmarshal(dAtA []byte) error {
   957  	l := len(dAtA)
   958  	iNdEx := 0
   959  	for iNdEx < l {
   960  		preIndex := iNdEx
   961  		var wire uint64
   962  		for shift := uint(0); ; shift += 7 {
   963  			if shift >= 64 {
   964  				return ErrIntOverflowAuth
   965  			}
   966  			if iNdEx >= l {
   967  				return io.ErrUnexpectedEOF
   968  			}
   969  			b := dAtA[iNdEx]
   970  			iNdEx++
   971  			wire |= uint64(b&0x7F) << shift
   972  			if b < 0x80 {
   973  				break
   974  			}
   975  		}
   976  		fieldNum := int32(wire >> 3)
   977  		wireType := int(wire & 0x7)
   978  		if wireType == 4 {
   979  			return fmt.Errorf("proto: Role: wiretype end group for non-group")
   980  		}
   981  		if fieldNum <= 0 {
   982  			return fmt.Errorf("proto: Role: illegal tag %d (wire type %d)", fieldNum, wire)
   983  		}
   984  		switch fieldNum {
   985  		case 1:
   986  			if wireType != 2 {
   987  				return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
   988  			}
   989  			var byteLen int
   990  			for shift := uint(0); ; shift += 7 {
   991  				if shift >= 64 {
   992  					return ErrIntOverflowAuth
   993  				}
   994  				if iNdEx >= l {
   995  					return io.ErrUnexpectedEOF
   996  				}
   997  				b := dAtA[iNdEx]
   998  				iNdEx++
   999  				byteLen |= int(b&0x7F) << shift
  1000  				if b < 0x80 {
  1001  					break
  1002  				}
  1003  			}
  1004  			if byteLen < 0 {
  1005  				return ErrInvalidLengthAuth
  1006  			}
  1007  			postIndex := iNdEx + byteLen
  1008  			if postIndex < 0 {
  1009  				return ErrInvalidLengthAuth
  1010  			}
  1011  			if postIndex > l {
  1012  				return io.ErrUnexpectedEOF
  1013  			}
  1014  			m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...)
  1015  			if m.Name == nil {
  1016  				m.Name = []byte{}
  1017  			}
  1018  			iNdEx = postIndex
  1019  		case 2:
  1020  			if wireType != 2 {
  1021  				return fmt.Errorf("proto: wrong wireType = %d for field KeyPermission", wireType)
  1022  			}
  1023  			var msglen int
  1024  			for shift := uint(0); ; shift += 7 {
  1025  				if shift >= 64 {
  1026  					return ErrIntOverflowAuth
  1027  				}
  1028  				if iNdEx >= l {
  1029  					return io.ErrUnexpectedEOF
  1030  				}
  1031  				b := dAtA[iNdEx]
  1032  				iNdEx++
  1033  				msglen |= int(b&0x7F) << shift
  1034  				if b < 0x80 {
  1035  					break
  1036  				}
  1037  			}
  1038  			if msglen < 0 {
  1039  				return ErrInvalidLengthAuth
  1040  			}
  1041  			postIndex := iNdEx + msglen
  1042  			if postIndex < 0 {
  1043  				return ErrInvalidLengthAuth
  1044  			}
  1045  			if postIndex > l {
  1046  				return io.ErrUnexpectedEOF
  1047  			}
  1048  			m.KeyPermission = append(m.KeyPermission, &Permission{})
  1049  			if err := m.KeyPermission[len(m.KeyPermission)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1050  				return err
  1051  			}
  1052  			iNdEx = postIndex
  1053  		default:
  1054  			iNdEx = preIndex
  1055  			skippy, err := skipAuth(dAtA[iNdEx:])
  1056  			if err != nil {
  1057  				return err
  1058  			}
  1059  			if (skippy < 0) || (iNdEx+skippy) < 0 {
  1060  				return ErrInvalidLengthAuth
  1061  			}
  1062  			if (iNdEx + skippy) > l {
  1063  				return io.ErrUnexpectedEOF
  1064  			}
  1065  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1066  			iNdEx += skippy
  1067  		}
  1068  	}
  1069  
  1070  	if iNdEx > l {
  1071  		return io.ErrUnexpectedEOF
  1072  	}
  1073  	return nil
  1074  }
  1075  func skipAuth(dAtA []byte) (n int, err error) {
  1076  	l := len(dAtA)
  1077  	iNdEx := 0
  1078  	depth := 0
  1079  	for iNdEx < l {
  1080  		var wire uint64
  1081  		for shift := uint(0); ; shift += 7 {
  1082  			if shift >= 64 {
  1083  				return 0, ErrIntOverflowAuth
  1084  			}
  1085  			if iNdEx >= l {
  1086  				return 0, io.ErrUnexpectedEOF
  1087  			}
  1088  			b := dAtA[iNdEx]
  1089  			iNdEx++
  1090  			wire |= (uint64(b) & 0x7F) << shift
  1091  			if b < 0x80 {
  1092  				break
  1093  			}
  1094  		}
  1095  		wireType := int(wire & 0x7)
  1096  		switch wireType {
  1097  		case 0:
  1098  			for shift := uint(0); ; shift += 7 {
  1099  				if shift >= 64 {
  1100  					return 0, ErrIntOverflowAuth
  1101  				}
  1102  				if iNdEx >= l {
  1103  					return 0, io.ErrUnexpectedEOF
  1104  				}
  1105  				iNdEx++
  1106  				if dAtA[iNdEx-1] < 0x80 {
  1107  					break
  1108  				}
  1109  			}
  1110  		case 1:
  1111  			iNdEx += 8
  1112  		case 2:
  1113  			var length int
  1114  			for shift := uint(0); ; shift += 7 {
  1115  				if shift >= 64 {
  1116  					return 0, ErrIntOverflowAuth
  1117  				}
  1118  				if iNdEx >= l {
  1119  					return 0, io.ErrUnexpectedEOF
  1120  				}
  1121  				b := dAtA[iNdEx]
  1122  				iNdEx++
  1123  				length |= (int(b) & 0x7F) << shift
  1124  				if b < 0x80 {
  1125  					break
  1126  				}
  1127  			}
  1128  			if length < 0 {
  1129  				return 0, ErrInvalidLengthAuth
  1130  			}
  1131  			iNdEx += length
  1132  		case 3:
  1133  			depth++
  1134  		case 4:
  1135  			if depth == 0 {
  1136  				return 0, ErrUnexpectedEndOfGroupAuth
  1137  			}
  1138  			depth--
  1139  		case 5:
  1140  			iNdEx += 4
  1141  		default:
  1142  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  1143  		}
  1144  		if iNdEx < 0 {
  1145  			return 0, ErrInvalidLengthAuth
  1146  		}
  1147  		if depth == 0 {
  1148  			return iNdEx, nil
  1149  		}
  1150  	}
  1151  	return 0, io.ErrUnexpectedEOF
  1152  }
  1153  
  1154  var (
  1155  	ErrInvalidLengthAuth        = fmt.Errorf("proto: negative length found during unmarshaling")
  1156  	ErrIntOverflowAuth          = fmt.Errorf("proto: integer overflow")
  1157  	ErrUnexpectedEndOfGroupAuth = fmt.Errorf("proto: unexpected end of group")
  1158  )
  1159  

View as plain text