|
|
@@ -72,8 +72,9 @@ func (*User) Descriptor() ([]byte, []int) { return fileDescriptorAuth, []int{0}
|
|
|
|
|
|
// Permission is a single entity
|
|
|
type Permission struct {
|
|
|
- Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
|
|
- PermType Permission_Type `protobuf:"varint,2,opt,name=permType,proto3,enum=authpb.Permission_Type" json:"permType,omitempty"`
|
|
|
+ PermType Permission_Type `protobuf:"varint,1,opt,name=permType,proto3,enum=authpb.Permission_Type" json:"permType,omitempty"`
|
|
|
+ Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
|
|
|
+ RangeEnd []byte `protobuf:"bytes,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"`
|
|
|
}
|
|
|
|
|
|
func (m *Permission) Reset() { *m = Permission{} }
|
|
|
@@ -158,16 +159,22 @@ func (m *Permission) MarshalTo(data []byte) (int, error) {
|
|
|
_ = i
|
|
|
var l int
|
|
|
_ = l
|
|
|
+ if m.PermType != 0 {
|
|
|
+ data[i] = 0x8
|
|
|
+ i++
|
|
|
+ i = encodeVarintAuth(data, i, uint64(m.PermType))
|
|
|
+ }
|
|
|
if len(m.Key) > 0 {
|
|
|
- data[i] = 0xa
|
|
|
+ data[i] = 0x12
|
|
|
i++
|
|
|
i = encodeVarintAuth(data, i, uint64(len(m.Key)))
|
|
|
i += copy(data[i:], m.Key)
|
|
|
}
|
|
|
- if m.PermType != 0 {
|
|
|
- data[i] = 0x10
|
|
|
+ if len(m.RangeEnd) > 0 {
|
|
|
+ data[i] = 0x1a
|
|
|
i++
|
|
|
- i = encodeVarintAuth(data, i, uint64(m.PermType))
|
|
|
+ i = encodeVarintAuth(data, i, uint64(len(m.RangeEnd)))
|
|
|
+ i += copy(data[i:], m.RangeEnd)
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -258,12 +265,16 @@ func (m *User) Size() (n int) {
|
|
|
func (m *Permission) Size() (n int) {
|
|
|
var l int
|
|
|
_ = l
|
|
|
+ if m.PermType != 0 {
|
|
|
+ n += 1 + sovAuth(uint64(m.PermType))
|
|
|
+ }
|
|
|
l = len(m.Key)
|
|
|
if l > 0 {
|
|
|
n += 1 + l + sovAuth(uint64(l))
|
|
|
}
|
|
|
- if m.PermType != 0 {
|
|
|
- n += 1 + sovAuth(uint64(m.PermType))
|
|
|
+ l = len(m.RangeEnd)
|
|
|
+ if l > 0 {
|
|
|
+ n += 1 + l + sovAuth(uint64(l))
|
|
|
}
|
|
|
return n
|
|
|
}
|
|
|
@@ -468,6 +479,25 @@ func (m *Permission) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
switch fieldNum {
|
|
|
case 1:
|
|
|
+ if wireType != 0 {
|
|
|
+ return fmt.Errorf("proto: wrong wireType = %d for field PermType", wireType)
|
|
|
+ }
|
|
|
+ m.PermType = 0
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowAuth
|
|
|
+ }
|
|
|
+ if iNdEx >= l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ m.PermType |= (Permission_Type(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ case 2:
|
|
|
if wireType != 2 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
|
|
|
}
|
|
|
@@ -498,11 +528,11 @@ func (m *Permission) Unmarshal(data []byte) error {
|
|
|
m.Key = []byte{}
|
|
|
}
|
|
|
iNdEx = postIndex
|
|
|
- case 2:
|
|
|
- if wireType != 0 {
|
|
|
- return fmt.Errorf("proto: wrong wireType = %d for field PermType", wireType)
|
|
|
+ case 3:
|
|
|
+ if wireType != 2 {
|
|
|
+ return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType)
|
|
|
}
|
|
|
- m.PermType = 0
|
|
|
+ var byteLen int
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
if shift >= 64 {
|
|
|
return ErrIntOverflowAuth
|
|
|
@@ -512,11 +542,23 @@ func (m *Permission) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
b := data[iNdEx]
|
|
|
iNdEx++
|
|
|
- m.PermType |= (Permission_Type(b) & 0x7F) << shift
|
|
|
+ byteLen |= (int(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ if byteLen < 0 {
|
|
|
+ return ErrInvalidLengthAuth
|
|
|
+ }
|
|
|
+ postIndex := iNdEx + byteLen
|
|
|
+ if postIndex > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ m.RangeEnd = append(m.RangeEnd[:0], data[iNdEx:postIndex]...)
|
|
|
+ if m.RangeEnd == nil {
|
|
|
+ m.RangeEnd = []byte{}
|
|
|
+ }
|
|
|
+ iNdEx = postIndex
|
|
|
default:
|
|
|
iNdEx = preIndex
|
|
|
skippy, err := skipAuth(data[iNdEx:])
|
|
|
@@ -756,22 +798,23 @@ var (
|
|
|
)
|
|
|
|
|
|
var fileDescriptorAuth = []byte{
|
|
|
- // 265 bytes of a gzipped FileDescriptorProto
|
|
|
+ // 276 bytes of a gzipped FileDescriptorProto
|
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x4a, 0x2c, 0x2d, 0xc9,
|
|
|
0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0xb1, 0x0b, 0x92, 0xa4, 0x44, 0xd2, 0xf3,
|
|
|
0xd3, 0xf3, 0xc1, 0x42, 0xfa, 0x20, 0x16, 0x44, 0x56, 0xc9, 0x87, 0x8b, 0x25, 0xb4, 0x38, 0xb5,
|
|
|
0x48, 0x48, 0x88, 0x8b, 0x25, 0x2f, 0x31, 0x37,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