|
|
@@ -11,14 +11,17 @@ import (
|
|
|
|
|
|
math "math"
|
|
|
|
|
|
- context "golang.org/x/net/context"
|
|
|
+ authpb "github.com/coreos/etcd/auth/authpb"
|
|
|
|
|
|
- grpc "google.golang.org/grpc"
|
|
|
+ io "io"
|
|
|
)
|
|
|
|
|
|
import storagepb "github.com/coreos/etcd/storage/storagepb"
|
|
|
|
|
|
-import io "io"
|
|
|
+import (
|
|
|
+ context "golang.org/x/net/context"
|
|
|
+ grpc "google.golang.org/grpc"
|
|
|
+)
|
|
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
|
var _ = proto.Marshal
|
|
|
@@ -1362,12 +1365,21 @@ func (m *AuthRoleDeleteRequest) String() string { return proto.CompactTextString
|
|
|
func (*AuthRoleDeleteRequest) ProtoMessage() {}
|
|
|
|
|
|
type AuthRoleGrantRequest struct {
|
|
|
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
|
|
+ Perm *authpb.Permission `protobuf:"bytes,2,opt,name=perm" json:"perm,omitempty"`
|
|
|
}
|
|
|
|
|
|
func (m *AuthRoleGrantRequest) Reset() { *m = AuthRoleGrantRequest{} }
|
|
|
func (m *AuthRoleGrantRequest) String() string { return proto.CompactTextString(m) }
|
|
|
func (*AuthRoleGrantRequest) ProtoMessage() {}
|
|
|
|
|
|
+func (m *AuthRoleGrantRequest) GetPerm() *authpb.Permission {
|
|
|
+ if m != nil {
|
|
|
+ return m.Perm
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
type AuthRoleRevokeRequest struct {
|
|
|
}
|
|
|
|
|
|
@@ -4724,6 +4736,22 @@ func (m *AuthRoleGrantRequest) MarshalTo(data []byte) (int, error) {
|
|
|
_ = i
|
|
|
var l int
|
|
|
_ = l
|
|
|
+ if len(m.Name) > 0 {
|
|
|
+ data[i] = 0xa
|
|
|
+ i++
|
|
|
+ i = encodeVarintRpc(data, i, uint64(len(m.Name)))
|
|
|
+ i += copy(data[i:], m.Name)
|
|
|
+ }
|
|
|
+ if m.Perm != nil {
|
|
|
+ data[i] = 0x12
|
|
|
+ i++
|
|
|
+ i = encodeVarintRpc(data, i, uint64(m.Perm.Size()))
|
|
|
+ n31, err := m.Perm.MarshalTo(data[i:])
|
|
|
+ if err != nil {
|
|
|
+ return 0, err
|
|
|
+ }
|
|
|
+ i += n31
|
|
|
+ }
|
|
|
return i, nil
|
|
|
}
|
|
|
|
|
|
@@ -4764,11 +4792,11 @@ func (m *AuthEnableResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n31, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n32, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n31
|
|
|
+ i += n32
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4792,11 +4820,11 @@ func (m *AuthDisableResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n32, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n33, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n32
|
|
|
+ i += n33
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4820,11 +4848,11 @@ func (m *AuthenticateResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n33, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n34, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n33
|
|
|
+ i += n34
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4848,11 +4876,11 @@ func (m *AuthUserAddResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n34, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n35, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n34
|
|
|
+ i += n35
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4876,11 +4904,11 @@ func (m *AuthUserGetResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n35, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n36, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n35
|
|
|
+ i += n36
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4904,11 +4932,11 @@ func (m *AuthUserDeleteResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n36, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n37, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n36
|
|
|
+ i += n37
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4932,11 +4960,11 @@ func (m *AuthUserChangePasswordResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n37, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n38, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n37
|
|
|
+ i += n38
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4960,11 +4988,11 @@ func (m *AuthUserGrantResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n38, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n39, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n38
|
|
|
+ i += n39
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4988,11 +5016,11 @@ func (m *AuthUserRevokeResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n39, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n40, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n39
|
|
|
+ i += n40
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -5016,11 +5044,11 @@ func (m *AuthRoleAddResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n40, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n41, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n40
|
|
|
+ i += n41
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -5044,11 +5072,11 @@ func (m *AuthRoleGetResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n41, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n42, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n41
|
|
|
+ i += n42
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -5072,11 +5100,11 @@ func (m *AuthRoleDeleteResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n42, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n43, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n42
|
|
|
+ i += n43
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -5100,11 +5128,11 @@ func (m *AuthRoleGrantResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n43, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n44, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n43
|
|
|
+ i += n44
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -5128,11 +5156,11 @@ func (m *AuthRoleRevokeResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n44, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n45, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n44
|
|
|
+ i += n45
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -5962,6 +5990,14 @@ func (m *AuthRoleDeleteRequest) Size() (n int) {
|
|
|
func (m *AuthRoleGrantRequest) Size() (n int) {
|
|
|
var l int
|
|
|
_ = l
|
|
|
+ l = len(m.Name)
|
|
|
+ if l > 0 {
|
|
|
+ n += 1 + l + sovRpc(uint64(l))
|
|
|
+ }
|
|
|
+ if m.Perm != nil {
|
|
|
+ l = m.Perm.Size()
|
|
|
+ n += 1 + l + sovRpc(uint64(l))
|
|
|
+ }
|
|
|
return n
|
|
|
}
|
|
|
|
|
|
@@ -11503,6 +11539,68 @@ func (m *AuthRoleGrantRequest) Unmarshal(data []byte) error {
|
|
|
return fmt.Errorf("proto: AuthRoleGrantRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
}
|
|
|
switch fieldNum {
|
|
|
+ case 1:
|
|
|
+ if wireType != 2 {
|
|
|
+ return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
|
|
|
+ }
|
|
|
+ var stringLen uint64
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowRpc
|
|
|
+ }
|
|
|
+ if iNdEx >= l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ stringLen |= (uint64(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ intStringLen := int(stringLen)
|
|
|
+ if intStringLen < 0 {
|
|
|
+ return ErrInvalidLengthRpc
|
|
|
+ }
|
|
|
+ postIndex := iNdEx + intStringLen
|
|
|
+ if postIndex > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ m.Name = string(data[iNdEx:postIndex])
|
|
|
+ iNdEx = postIndex
|
|
|
+ case 2:
|
|
|
+ if wireType != 2 {
|
|
|
+ return fmt.Errorf("proto: wrong wireType = %d for field Perm", wireType)
|
|
|
+ }
|
|
|
+ var msglen int
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowRpc
|
|
|
+ }
|
|
|
+ if iNdEx >= l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ msglen |= (int(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if msglen < 0 {
|
|
|
+ return ErrInvalidLengthRpc
|
|
|
+ }
|
|
|
+ postIndex := iNdEx + msglen
|
|
|
+ if postIndex > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ if m.Perm == nil {
|
|
|
+ m.Perm = &authpb.Permission{}
|
|
|
+ }
|
|
|
+ if err := m.Perm.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ iNdEx = postIndex
|
|
|
default:
|
|
|
iNdEx = preIndex
|
|
|
skippy, err := skipRpc(data[iNdEx:])
|