2015-08-08 15:29:18 +03:00
|
|
|
// Code generated by protoc-gen-gogo.
|
|
|
|
// source: raft_internal.proto
|
|
|
|
// DO NOT EDIT!
|
|
|
|
|
|
|
|
package etcdserverpb
|
|
|
|
|
2016-01-27 04:41:19 +03:00
|
|
|
import (
|
|
|
|
"fmt"
|
2015-08-08 15:29:18 +03:00
|
|
|
|
2016-07-18 19:33:32 +03:00
|
|
|
proto "github.com/golang/protobuf/proto"
|
2015-08-08 15:29:18 +03:00
|
|
|
|
2016-04-14 02:23:07 +03:00
|
|
|
math "math"
|
|
|
|
)
|
2016-04-08 10:58:46 +03:00
|
|
|
|
2015-08-08 15:29:18 +03:00
|
|
|
import io "io"
|
|
|
|
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
|
|
var _ = proto.Marshal
|
2016-01-27 04:41:19 +03:00
|
|
|
var _ = fmt.Errorf
|
|
|
|
var _ = math.Inf
|
2015-08-08 15:29:18 +03:00
|
|
|
|
2016-05-17 09:20:50 +03:00
|
|
|
type RequestHeader struct {
|
|
|
|
ID uint64 `protobuf:"varint,1,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
|
|
|
|
// username is a username that is associated with an auth token of gRPC connection
|
|
|
|
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
|
auth, etcdserver: introduce revision of authStore for avoiding TOCTOU problem
This commit introduces revision of authStore. The revision number
represents a version of authStore that is incremented by updating auth
related information.
The revision is required for avoiding TOCTOU problems. Currently there
are two types of the TOCTOU problems in v3 auth.
The first one is in ordinal linearizable requests with a sequence like
below ():
1. Request from client CA is processed in follower FA. FA looks up the
username (let it U) for the request from a token of the request. At
this time, the request is authorized correctly.
2. Another request from client CB is processed in follower FB. CB
is for changing U's password.
3. FB forwards the request from CB to the leader before FA. Now U's
password is updated and the request from CA should be rejected.
4. However, the request from CA is processed by the leader because
authentication is already done in FA.
For avoiding the above sequence, this commit lets
etcdserverpb.RequestHeader have a member revision. The member is
initialized during authentication by followers and checked in a
leader. If the revision in RequestHeader is lower than the leader's
authStore revision, it means a sequence like above happened. In such a
case, the state machine returns auth.ErrAuthRevisionObsolete. The
error code lets nodes retry their requests.
The second one, a case of serializable range and txn, is more
subtle. Because these requests are processed in follower directly. The
TOCTOU problem can be caused by a sequence like below:
1. Serializable request from client CA is processed in follower FA. At
first, FA looks up the username (let it U) and its permission
before actual access to KV.
2. Another request from client CB is processed in follower FB and
forwarded to the leader. The cluster including FA now commits a log
entry of the request from CB. Assume the request changed the
permission or password of U.
3. Now the serializable request from CA is accessing to KV. Even if
the access is allowed at the point of 1, now it can be invalid
because of the change introduced in 2.
For avoiding the above sequence, this commit lets the functions of
serializable requests (EtcdServer.Range() and EtcdServer.Txn())
compare the revision in the request header with the latest revision of
authStore after the actual access. If the saved revision is lower than
the latest one, it means the permission can be changed. Although it
would introduce false positives (e.g. changing other user's password),
it prevents the TOCTOU problem. This idea is an implementation of
Anthony's comment:
https://github.com/coreos/etcd/pull/5739#issuecomment-228128254
2016-06-23 12:31:12 +03:00
|
|
|
// auth_revision is a revision number of auth.authStore. It is not related to mvcc
|
|
|
|
AuthRevision uint64 `protobuf:"varint,3,opt,name=auth_revision,json=authRevision,proto3" json:"auth_revision,omitempty"`
|
2016-05-17 09:20:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *RequestHeader) Reset() { *m = RequestHeader{} }
|
|
|
|
func (m *RequestHeader) String() string { return proto.CompactTextString(m) }
|
|
|
|
func (*RequestHeader) ProtoMessage() {}
|
|
|
|
func (*RequestHeader) Descriptor() ([]byte, []int) { return fileDescriptorRaftInternal, []int{0} }
|
|
|
|
|
2015-08-08 15:29:18 +03:00
|
|
|
// An InternalRaftRequest is the union of all requests which can be
|
|
|
|
// sent via raft.
|
|
|
|
type InternalRaftRequest struct {
|
2016-06-05 10:57:23 +03:00
|
|
|
Header *RequestHeader `protobuf:"bytes,100,opt,name=header" json:"header,omitempty"`
|
|
|
|
ID uint64 `protobuf:"varint,1,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
|
|
|
|
V2 *Request `protobuf:"bytes,2,opt,name=v2" json:"v2,omitempty"`
|
|
|
|
Range *RangeRequest `protobuf:"bytes,3,opt,name=range" json:"range,omitempty"`
|
|
|
|
Put *PutRequest `protobuf:"bytes,4,opt,name=put" json:"put,omitempty"`
|
|
|
|
DeleteRange *DeleteRangeRequest `protobuf:"bytes,5,opt,name=delete_range,json=deleteRange" json:"delete_range,omitempty"`
|
|
|
|
Txn *TxnRequest `protobuf:"bytes,6,opt,name=txn" json:"txn,omitempty"`
|
|
|
|
Compaction *CompactionRequest `protobuf:"bytes,7,opt,name=compaction" json:"compaction,omitempty"`
|
|
|
|
LeaseGrant *LeaseGrantRequest `protobuf:"bytes,8,opt,name=lease_grant,json=leaseGrant" json:"lease_grant,omitempty"`
|
|
|
|
LeaseRevoke *LeaseRevokeRequest `protobuf:"bytes,9,opt,name=lease_revoke,json=leaseRevoke" json:"lease_revoke,omitempty"`
|
|
|
|
Alarm *AlarmRequest `protobuf:"bytes,10,opt,name=alarm" json:"alarm,omitempty"`
|
|
|
|
AuthEnable *AuthEnableRequest `protobuf:"bytes,1000,opt,name=auth_enable,json=authEnable" json:"auth_enable,omitempty"`
|
|
|
|
AuthDisable *AuthDisableRequest `protobuf:"bytes,1011,opt,name=auth_disable,json=authDisable" json:"auth_disable,omitempty"`
|
2016-06-09 03:11:26 +03:00
|
|
|
Authenticate *InternalAuthenticateRequest `protobuf:"bytes,1012,opt,name=authenticate" json:"authenticate,omitempty"`
|
2016-06-07 06:17:28 +03:00
|
|
|
AuthUserAdd *AuthUserAddRequest `protobuf:"bytes,1100,opt,name=auth_user_add,json=authUserAdd" json:"auth_user_add,omitempty"`
|
|
|
|
AuthUserDelete *AuthUserDeleteRequest `protobuf:"bytes,1101,opt,name=auth_user_delete,json=authUserDelete" json:"auth_user_delete,omitempty"`
|
|
|
|
AuthUserGet *AuthUserGetRequest `protobuf:"bytes,1102,opt,name=auth_user_get,json=authUserGet" json:"auth_user_get,omitempty"`
|
|
|
|
AuthUserChangePassword *AuthUserChangePasswordRequest `protobuf:"bytes,1103,opt,name=auth_user_change_password,json=authUserChangePassword" json:"auth_user_change_password,omitempty"`
|
|
|
|
AuthUserGrantRole *AuthUserGrantRoleRequest `protobuf:"bytes,1104,opt,name=auth_user_grant_role,json=authUserGrantRole" json:"auth_user_grant_role,omitempty"`
|
|
|
|
AuthUserRevokeRole *AuthUserRevokeRoleRequest `protobuf:"bytes,1105,opt,name=auth_user_revoke_role,json=authUserRevokeRole" json:"auth_user_revoke_role,omitempty"`
|
2016-06-15 09:11:27 +03:00
|
|
|
AuthUserList *AuthUserListRequest `protobuf:"bytes,1106,opt,name=auth_user_list,json=authUserList" json:"auth_user_list,omitempty"`
|
|
|
|
AuthRoleList *AuthRoleListRequest `protobuf:"bytes,1107,opt,name=auth_role_list,json=authRoleList" json:"auth_role_list,omitempty"`
|
2016-06-07 06:17:28 +03:00
|
|
|
AuthRoleAdd *AuthRoleAddRequest `protobuf:"bytes,1200,opt,name=auth_role_add,json=authRoleAdd" json:"auth_role_add,omitempty"`
|
|
|
|
AuthRoleDelete *AuthRoleDeleteRequest `protobuf:"bytes,1201,opt,name=auth_role_delete,json=authRoleDelete" json:"auth_role_delete,omitempty"`
|
|
|
|
AuthRoleGet *AuthRoleGetRequest `protobuf:"bytes,1202,opt,name=auth_role_get,json=authRoleGet" json:"auth_role_get,omitempty"`
|
|
|
|
AuthRoleGrantPermission *AuthRoleGrantPermissionRequest `protobuf:"bytes,1203,opt,name=auth_role_grant_permission,json=authRoleGrantPermission" json:"auth_role_grant_permission,omitempty"`
|
|
|
|
AuthRoleRevokePermission *AuthRoleRevokePermissionRequest `protobuf:"bytes,1204,opt,name=auth_role_revoke_permission,json=authRoleRevokePermission" json:"auth_role_revoke_permission,omitempty"`
|
2015-08-08 15:29:18 +03:00
|
|
|
}
|
|
|
|
|
2016-04-26 00:08:33 +03:00
|
|
|
func (m *InternalRaftRequest) Reset() { *m = InternalRaftRequest{} }
|
|
|
|
func (m *InternalRaftRequest) String() string { return proto.CompactTextString(m) }
|
|
|
|
func (*InternalRaftRequest) ProtoMessage() {}
|
2016-05-17 09:20:50 +03:00
|
|
|
func (*InternalRaftRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftInternal, []int{1} }
|
2015-08-08 15:29:18 +03:00
|
|
|
|
2015-09-13 18:28:10 +03:00
|
|
|
type EmptyResponse struct {
|
|
|
|
}
|
|
|
|
|
2016-04-26 00:08:33 +03:00
|
|
|
func (m *EmptyResponse) Reset() { *m = EmptyResponse{} }
|
|
|
|
func (m *EmptyResponse) String() string { return proto.CompactTextString(m) }
|
|
|
|
func (*EmptyResponse) ProtoMessage() {}
|
2016-05-17 09:20:50 +03:00
|
|
|
func (*EmptyResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftInternal, []int{2} }
|
2015-09-13 18:28:10 +03:00
|
|
|
|
2016-06-09 03:11:26 +03:00
|
|
|
// What is the difference between AuthenticateRequest (defined in rpc.proto) and InternalAuthenticateRequest?
|
|
|
|
// InternalAuthenticateRequest has a member that is filled by etcdserver and shouldn't be user-facing.
|
|
|
|
// For avoiding misusage the field, we have an internal version of AuthenticateRequest.
|
|
|
|
type InternalAuthenticateRequest struct {
|
|
|
|
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
|
|
|
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
|
|
|
|
// simple_token is generated in API layer (etcdserver/v3_server.go)
|
|
|
|
SimpleToken string `protobuf:"bytes,3,opt,name=simple_token,json=simpleToken,proto3" json:"simple_token,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *InternalAuthenticateRequest) Reset() { *m = InternalAuthenticateRequest{} }
|
|
|
|
func (m *InternalAuthenticateRequest) String() string { return proto.CompactTextString(m) }
|
|
|
|
func (*InternalAuthenticateRequest) ProtoMessage() {}
|
|
|
|
func (*InternalAuthenticateRequest) Descriptor() ([]byte, []int) {
|
|
|
|
return fileDescriptorRaftInternal, []int{3}
|
|
|
|
}
|
|
|
|
|
2016-01-27 04:41:19 +03:00
|
|
|
func init() {
|
2016-05-17 09:20:50 +03:00
|
|
|
proto.RegisterType((*RequestHeader)(nil), "etcdserverpb.RequestHeader")
|
2016-01-27 04:41:19 +03:00
|
|
|
proto.RegisterType((*InternalRaftRequest)(nil), "etcdserverpb.InternalRaftRequest")
|
|
|
|
proto.RegisterType((*EmptyResponse)(nil), "etcdserverpb.EmptyResponse")
|
2016-06-09 03:11:26 +03:00
|
|
|
proto.RegisterType((*InternalAuthenticateRequest)(nil), "etcdserverpb.InternalAuthenticateRequest")
|
2016-01-27 04:41:19 +03:00
|
|
|
}
|
2016-05-17 09:20:50 +03:00
|
|
|
func (m *RequestHeader) Marshal() (data []byte, err error) {
|
|
|
|
size := m.Size()
|
|
|
|
data = make([]byte, size)
|
|
|
|
n, err := m.MarshalTo(data)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return data[:n], nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *RequestHeader) MarshalTo(data []byte) (int, error) {
|
|
|
|
var i int
|
|
|
|
_ = i
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
if m.ID != 0 {
|
|
|
|
data[i] = 0x8
|
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.ID))
|
|
|
|
}
|
|
|
|
if len(m.Username) > 0 {
|
|
|
|
data[i] = 0x12
|
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(len(m.Username)))
|
|
|
|
i += copy(data[i:], m.Username)
|
|
|
|
}
|
auth, etcdserver: introduce revision of authStore for avoiding TOCTOU problem
This commit introduces revision of authStore. The revision number
represents a version of authStore that is incremented by updating auth
related information.
The revision is required for avoiding TOCTOU problems. Currently there
are two types of the TOCTOU problems in v3 auth.
The first one is in ordinal linearizable requests with a sequence like
below ():
1. Request from client CA is processed in follower FA. FA looks up the
username (let it U) for the request from a token of the request. At
this time, the request is authorized correctly.
2. Another request from client CB is processed in follower FB. CB
is for changing U's password.
3. FB forwards the request from CB to the leader before FA. Now U's
password is updated and the request from CA should be rejected.
4. However, the request from CA is processed by the leader because
authentication is already done in FA.
For avoiding the above sequence, this commit lets
etcdserverpb.RequestHeader have a member revision. The member is
initialized during authentication by followers and checked in a
leader. If the revision in RequestHeader is lower than the leader's
authStore revision, it means a sequence like above happened. In such a
case, the state machine returns auth.ErrAuthRevisionObsolete. The
error code lets nodes retry their requests.
The second one, a case of serializable range and txn, is more
subtle. Because these requests are processed in follower directly. The
TOCTOU problem can be caused by a sequence like below:
1. Serializable request from client CA is processed in follower FA. At
first, FA looks up the username (let it U) and its permission
before actual access to KV.
2. Another request from client CB is processed in follower FB and
forwarded to the leader. The cluster including FA now commits a log
entry of the request from CB. Assume the request changed the
permission or password of U.
3. Now the serializable request from CA is accessing to KV. Even if
the access is allowed at the point of 1, now it can be invalid
because of the change introduced in 2.
For avoiding the above sequence, this commit lets the functions of
serializable requests (EtcdServer.Range() and EtcdServer.Txn())
compare the revision in the request header with the latest revision of
authStore after the actual access. If the saved revision is lower than
the latest one, it means the permission can be changed. Although it
would introduce false positives (e.g. changing other user's password),
it prevents the TOCTOU problem. This idea is an implementation of
Anthony's comment:
https://github.com/coreos/etcd/pull/5739#issuecomment-228128254
2016-06-23 12:31:12 +03:00
|
|
|
if m.AuthRevision != 0 {
|
|
|
|
data[i] = 0x18
|
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.AuthRevision))
|
|
|
|
}
|
2016-05-17 09:20:50 +03:00
|
|
|
return i, nil
|
|
|
|
}
|
|
|
|
|
2015-09-04 01:32:25 +03:00
|
|
|
func (m *InternalRaftRequest) Marshal() (data []byte, err error) {
|
|
|
|
size := m.Size()
|
|
|
|
data = make([]byte, size)
|
|
|
|
n, err := m.MarshalTo(data)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return data[:n], nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *InternalRaftRequest) MarshalTo(data []byte) (int, error) {
|
|
|
|
var i int
|
|
|
|
_ = i
|
|
|
|
var l int
|
|
|
|
_ = l
|
2015-09-13 18:28:10 +03:00
|
|
|
if m.ID != 0 {
|
|
|
|
data[i] = 0x8
|
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.ID))
|
|
|
|
}
|
2015-09-04 01:32:25 +03:00
|
|
|
if m.V2 != nil {
|
2015-09-13 18:28:10 +03:00
|
|
|
data[i] = 0x12
|
2015-09-04 01:32:25 +03:00
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.V2.Size()))
|
|
|
|
n1, err := m.V2.MarshalTo(data[i:])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n1
|
|
|
|
}
|
|
|
|
if m.Range != nil {
|
2015-09-13 18:28:10 +03:00
|
|
|
data[i] = 0x1a
|
2015-09-04 01:32:25 +03:00
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.Range.Size()))
|
|
|
|
n2, err := m.Range.MarshalTo(data[i:])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n2
|
|
|
|
}
|
|
|
|
if m.Put != nil {
|
2015-09-13 18:28:10 +03:00
|
|
|
data[i] = 0x22
|
2015-09-04 01:32:25 +03:00
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.Put.Size()))
|
|
|
|
n3, err := m.Put.MarshalTo(data[i:])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n3
|
|
|
|
}
|
|
|
|
if m.DeleteRange != nil {
|
2015-09-13 18:28:10 +03:00
|
|
|
data[i] = 0x2a
|
2015-09-04 01:32:25 +03:00
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.DeleteRange.Size()))
|
|
|
|
n4, err := m.DeleteRange.MarshalTo(data[i:])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n4
|
|
|
|
}
|
|
|
|
if m.Txn != nil {
|
2015-09-13 18:28:10 +03:00
|
|
|
data[i] = 0x32
|
2015-09-04 01:32:25 +03:00
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.Txn.Size()))
|
|
|
|
n5, err := m.Txn.MarshalTo(data[i:])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n5
|
|
|
|
}
|
2015-09-06 02:08:58 +03:00
|
|
|
if m.Compaction != nil {
|
|
|
|
data[i] = 0x3a
|
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.Compaction.Size()))
|
|
|
|
n6, err := m.Compaction.MarshalTo(data[i:])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n6
|
|
|
|
}
|
2016-04-07 20:27:36 +03:00
|
|
|
if m.LeaseGrant != nil {
|
2016-01-06 00:49:25 +03:00
|
|
|
data[i] = 0x42
|
|
|
|
i++
|
2016-04-07 20:27:36 +03:00
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.LeaseGrant.Size()))
|
|
|
|
n7, err := m.LeaseGrant.MarshalTo(data[i:])
|
2016-01-06 00:49:25 +03:00
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n7
|
|
|
|
}
|
|
|
|
if m.LeaseRevoke != nil {
|
|
|
|
data[i] = 0x4a
|
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.LeaseRevoke.Size()))
|
|
|
|
n8, err := m.LeaseRevoke.MarshalTo(data[i:])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n8
|
|
|
|
}
|
2016-05-30 11:21:11 +03:00
|
|
|
if m.Alarm != nil {
|
2016-03-02 08:56:42 +03:00
|
|
|
data[i] = 0x52
|
|
|
|
i++
|
2016-05-30 11:21:11 +03:00
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.Alarm.Size()))
|
|
|
|
n9, err := m.Alarm.MarshalTo(data[i:])
|
2016-03-02 08:56:42 +03:00
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n9
|
|
|
|
}
|
2016-05-30 11:21:11 +03:00
|
|
|
if m.Header != nil {
|
|
|
|
data[i] = 0xa2
|
2016-03-23 07:25:48 +03:00
|
|
|
i++
|
2016-05-30 11:21:11 +03:00
|
|
|
data[i] = 0x6
|
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.Header.Size()))
|
|
|
|
n10, err := m.Header.MarshalTo(data[i:])
|
2016-03-23 07:25:48 +03:00
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n10
|
|
|
|
}
|
2016-05-30 11:21:11 +03:00
|
|
|
if m.AuthEnable != nil {
|
|
|
|
data[i] = 0xc2
|
2016-03-24 03:20:52 +03:00
|
|
|
i++
|
2016-05-30 11:21:11 +03:00
|
|
|
data[i] = 0x3e
|
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.AuthEnable.Size()))
|
|
|
|
n11, err := m.AuthEnable.MarshalTo(data[i:])
|
2016-03-24 03:20:52 +03:00
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n11
|
|
|
|
}
|
2016-05-30 11:21:11 +03:00
|
|
|
if m.AuthDisable != nil {
|
|
|
|
data[i] = 0x9a
|
2016-03-31 05:29:47 +03:00
|
|
|
i++
|
2016-05-30 11:21:11 +03:00
|
|
|
data[i] = 0x3f
|
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.AuthDisable.Size()))
|
|
|
|
n12, err := m.AuthDisable.MarshalTo(data[i:])
|
2016-03-31 05:29:47 +03:00
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n12
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.Authenticate != nil {
|
2016-05-30 11:21:11 +03:00
|
|
|
data[i] = 0xa2
|
2016-03-31 08:31:07 +03:00
|
|
|
i++
|
2016-05-30 11:21:11 +03:00
|
|
|
data[i] = 0x3f
|
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.Authenticate.Size()))
|
|
|
|
n13, err := m.Authenticate.MarshalTo(data[i:])
|
2016-03-31 08:31:07 +03:00
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n13
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthUserAdd != nil {
|
|
|
|
data[i] = 0xe2
|
2016-04-01 05:07:43 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
data[i] = 0x44
|
2016-05-30 11:21:11 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.AuthUserAdd.Size()))
|
|
|
|
n14, err := m.AuthUserAdd.MarshalTo(data[i:])
|
2016-04-01 05:07:43 +03:00
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n14
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthUserDelete != nil {
|
|
|
|
data[i] = 0xea
|
2016-04-05 09:42:38 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
data[i] = 0x44
|
2016-04-05 09:42:38 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.AuthUserDelete.Size()))
|
|
|
|
n15, err := m.AuthUserDelete.MarshalTo(data[i:])
|
2016-04-05 09:42:38 +03:00
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n15
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthUserGet != nil {
|
|
|
|
data[i] = 0xf2
|
2016-04-11 08:34:13 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
data[i] = 0x44
|
2016-04-11 08:34:13 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.AuthUserGet.Size()))
|
|
|
|
n16, err := m.AuthUserGet.MarshalTo(data[i:])
|
2016-04-11 08:34:13 +03:00
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n16
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthUserChangePassword != nil {
|
|
|
|
data[i] = 0xfa
|
2016-04-13 07:44:53 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
data[i] = 0x44
|
2016-04-13 07:44:53 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.AuthUserChangePassword.Size()))
|
|
|
|
n17, err := m.AuthUserChangePassword.MarshalTo(data[i:])
|
2016-04-13 07:44:53 +03:00
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n17
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthUserGrantRole != nil {
|
|
|
|
data[i] = 0x82
|
2016-05-07 21:24:43 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
data[i] = 0x45
|
2016-05-07 21:24:43 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.AuthUserGrantRole.Size()))
|
|
|
|
n18, err := m.AuthUserGrantRole.MarshalTo(data[i:])
|
2016-05-07 21:24:43 +03:00
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n18
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthUserRevokeRole != nil {
|
|
|
|
data[i] = 0x8a
|
2016-05-17 09:20:50 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
data[i] = 0x45
|
2016-05-17 09:20:50 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.AuthUserRevokeRole.Size()))
|
|
|
|
n19, err := m.AuthUserRevokeRole.MarshalTo(data[i:])
|
2016-05-17 09:20:50 +03:00
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n19
|
|
|
|
}
|
2016-06-15 09:11:27 +03:00
|
|
|
if m.AuthUserList != nil {
|
|
|
|
data[i] = 0x92
|
|
|
|
i++
|
|
|
|
data[i] = 0x45
|
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.AuthUserList.Size()))
|
|
|
|
n20, err := m.AuthUserList.MarshalTo(data[i:])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n20
|
|
|
|
}
|
|
|
|
if m.AuthRoleList != nil {
|
|
|
|
data[i] = 0x9a
|
|
|
|
i++
|
|
|
|
data[i] = 0x45
|
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.AuthRoleList.Size()))
|
|
|
|
n21, err := m.AuthRoleList.MarshalTo(data[i:])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n21
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthRoleAdd != nil {
|
|
|
|
data[i] = 0x82
|
2016-05-30 11:21:11 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
data[i] = 0x4b
|
2016-05-30 11:21:11 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.AuthRoleAdd.Size()))
|
2016-06-15 09:11:27 +03:00
|
|
|
n22, err := m.AuthRoleAdd.MarshalTo(data[i:])
|
2016-05-30 11:21:11 +03:00
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
2016-06-15 09:11:27 +03:00
|
|
|
i += n22
|
2016-05-30 11:21:11 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthRoleDelete != nil {
|
|
|
|
data[i] = 0x8a
|
2016-06-02 17:25:15 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
data[i] = 0x4b
|
2016-06-02 17:25:15 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.AuthRoleDelete.Size()))
|
2016-06-15 09:11:27 +03:00
|
|
|
n23, err := m.AuthRoleDelete.MarshalTo(data[i:])
|
2016-06-02 17:25:15 +03:00
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
2016-06-15 09:11:27 +03:00
|
|
|
i += n23
|
2016-06-02 17:25:15 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthRoleGet != nil {
|
|
|
|
data[i] = 0x92
|
2016-06-03 10:38:59 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
data[i] = 0x4b
|
2016-06-03 10:38:59 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.AuthRoleGet.Size()))
|
2016-06-15 09:11:27 +03:00
|
|
|
n24, err := m.AuthRoleGet.MarshalTo(data[i:])
|
2016-06-03 10:38:59 +03:00
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
2016-06-15 09:11:27 +03:00
|
|
|
i += n24
|
2016-06-03 10:38:59 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthRoleGrantPermission != nil {
|
|
|
|
data[i] = 0x9a
|
2016-06-03 11:10:08 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
data[i] = 0x4b
|
2016-06-03 11:10:08 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.AuthRoleGrantPermission.Size()))
|
2016-06-15 09:11:27 +03:00
|
|
|
n25, err := m.AuthRoleGrantPermission.MarshalTo(data[i:])
|
2016-06-03 11:10:08 +03:00
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
2016-06-15 09:11:27 +03:00
|
|
|
i += n25
|
2016-06-03 11:10:08 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthRoleRevokePermission != nil {
|
|
|
|
data[i] = 0xa2
|
2016-06-03 11:33:05 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
data[i] = 0x4b
|
2016-06-03 11:33:05 +03:00
|
|
|
i++
|
2016-06-07 06:17:28 +03:00
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(m.AuthRoleRevokePermission.Size()))
|
2016-06-15 09:11:27 +03:00
|
|
|
n26, err := m.AuthRoleRevokePermission.MarshalTo(data[i:])
|
2016-06-03 11:33:05 +03:00
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
2016-06-15 09:11:27 +03:00
|
|
|
i += n26
|
2016-06-03 11:33:05 +03:00
|
|
|
}
|
2015-09-04 01:32:25 +03:00
|
|
|
return i, nil
|
|
|
|
}
|
|
|
|
|
2015-09-13 18:28:10 +03:00
|
|
|
func (m *EmptyResponse) Marshal() (data []byte, err error) {
|
|
|
|
size := m.Size()
|
|
|
|
data = make([]byte, size)
|
|
|
|
n, err := m.MarshalTo(data)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return data[:n], nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *EmptyResponse) MarshalTo(data []byte) (int, error) {
|
|
|
|
var i int
|
|
|
|
_ = i
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
return i, nil
|
|
|
|
}
|
|
|
|
|
2016-06-09 03:11:26 +03:00
|
|
|
func (m *InternalAuthenticateRequest) Marshal() (data []byte, err error) {
|
|
|
|
size := m.Size()
|
|
|
|
data = make([]byte, size)
|
|
|
|
n, err := m.MarshalTo(data)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return data[:n], nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *InternalAuthenticateRequest) MarshalTo(data []byte) (int, error) {
|
|
|
|
var i int
|
|
|
|
_ = i
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
if len(m.Name) > 0 {
|
|
|
|
data[i] = 0xa
|
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(len(m.Name)))
|
|
|
|
i += copy(data[i:], m.Name)
|
|
|
|
}
|
|
|
|
if len(m.Password) > 0 {
|
|
|
|
data[i] = 0x12
|
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(len(m.Password)))
|
|
|
|
i += copy(data[i:], m.Password)
|
|
|
|
}
|
|
|
|
if len(m.SimpleToken) > 0 {
|
|
|
|
data[i] = 0x1a
|
|
|
|
i++
|
|
|
|
i = encodeVarintRaftInternal(data, i, uint64(len(m.SimpleToken)))
|
|
|
|
i += copy(data[i:], m.SimpleToken)
|
|
|
|
}
|
|
|
|
return i, nil
|
|
|
|
}
|
|
|
|
|
2015-09-04 01:32:25 +03:00
|
|
|
func encodeFixed64RaftInternal(data []byte, offset int, v uint64) int {
|
|
|
|
data[offset] = uint8(v)
|
|
|
|
data[offset+1] = uint8(v >> 8)
|
|
|
|
data[offset+2] = uint8(v >> 16)
|
|
|
|
data[offset+3] = uint8(v >> 24)
|
|
|
|
data[offset+4] = uint8(v >> 32)
|
|
|
|
data[offset+5] = uint8(v >> 40)
|
|
|
|
data[offset+6] = uint8(v >> 48)
|
|
|
|
data[offset+7] = uint8(v >> 56)
|
|
|
|
return offset + 8
|
|
|
|
}
|
|
|
|
func encodeFixed32RaftInternal(data []byte, offset int, v uint32) int {
|
|
|
|
data[offset] = uint8(v)
|
|
|
|
data[offset+1] = uint8(v >> 8)
|
|
|
|
data[offset+2] = uint8(v >> 16)
|
|
|
|
data[offset+3] = uint8(v >> 24)
|
|
|
|
return offset + 4
|
|
|
|
}
|
|
|
|
func encodeVarintRaftInternal(data []byte, offset int, v uint64) int {
|
|
|
|
for v >= 1<<7 {
|
|
|
|
data[offset] = uint8(v&0x7f | 0x80)
|
|
|
|
v >>= 7
|
|
|
|
offset++
|
|
|
|
}
|
|
|
|
data[offset] = uint8(v)
|
|
|
|
return offset + 1
|
|
|
|
}
|
2016-05-17 09:20:50 +03:00
|
|
|
func (m *RequestHeader) Size() (n int) {
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
if m.ID != 0 {
|
|
|
|
n += 1 + sovRaftInternal(uint64(m.ID))
|
|
|
|
}
|
|
|
|
l = len(m.Username)
|
|
|
|
if l > 0 {
|
|
|
|
n += 1 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
auth, etcdserver: introduce revision of authStore for avoiding TOCTOU problem
This commit introduces revision of authStore. The revision number
represents a version of authStore that is incremented by updating auth
related information.
The revision is required for avoiding TOCTOU problems. Currently there
are two types of the TOCTOU problems in v3 auth.
The first one is in ordinal linearizable requests with a sequence like
below ():
1. Request from client CA is processed in follower FA. FA looks up the
username (let it U) for the request from a token of the request. At
this time, the request is authorized correctly.
2. Another request from client CB is processed in follower FB. CB
is for changing U's password.
3. FB forwards the request from CB to the leader before FA. Now U's
password is updated and the request from CA should be rejected.
4. However, the request from CA is processed by the leader because
authentication is already done in FA.
For avoiding the above sequence, this commit lets
etcdserverpb.RequestHeader have a member revision. The member is
initialized during authentication by followers and checked in a
leader. If the revision in RequestHeader is lower than the leader's
authStore revision, it means a sequence like above happened. In such a
case, the state machine returns auth.ErrAuthRevisionObsolete. The
error code lets nodes retry their requests.
The second one, a case of serializable range and txn, is more
subtle. Because these requests are processed in follower directly. The
TOCTOU problem can be caused by a sequence like below:
1. Serializable request from client CA is processed in follower FA. At
first, FA looks up the username (let it U) and its permission
before actual access to KV.
2. Another request from client CB is processed in follower FB and
forwarded to the leader. The cluster including FA now commits a log
entry of the request from CB. Assume the request changed the
permission or password of U.
3. Now the serializable request from CA is accessing to KV. Even if
the access is allowed at the point of 1, now it can be invalid
because of the change introduced in 2.
For avoiding the above sequence, this commit lets the functions of
serializable requests (EtcdServer.Range() and EtcdServer.Txn())
compare the revision in the request header with the latest revision of
authStore after the actual access. If the saved revision is lower than
the latest one, it means the permission can be changed. Although it
would introduce false positives (e.g. changing other user's password),
it prevents the TOCTOU problem. This idea is an implementation of
Anthony's comment:
https://github.com/coreos/etcd/pull/5739#issuecomment-228128254
2016-06-23 12:31:12 +03:00
|
|
|
if m.AuthRevision != 0 {
|
|
|
|
n += 1 + sovRaftInternal(uint64(m.AuthRevision))
|
|
|
|
}
|
2016-05-17 09:20:50 +03:00
|
|
|
return n
|
|
|
|
}
|
|
|
|
|
2015-09-04 01:32:25 +03:00
|
|
|
func (m *InternalRaftRequest) Size() (n int) {
|
|
|
|
var l int
|
|
|
|
_ = l
|
2015-09-13 18:28:10 +03:00
|
|
|
if m.ID != 0 {
|
|
|
|
n += 1 + sovRaftInternal(uint64(m.ID))
|
|
|
|
}
|
2015-09-04 01:32:25 +03:00
|
|
|
if m.V2 != nil {
|
|
|
|
l = m.V2.Size()
|
|
|
|
n += 1 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
|
|
|
if m.Range != nil {
|
|
|
|
l = m.Range.Size()
|
|
|
|
n += 1 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
|
|
|
if m.Put != nil {
|
|
|
|
l = m.Put.Size()
|
|
|
|
n += 1 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
|
|
|
if m.DeleteRange != nil {
|
|
|
|
l = m.DeleteRange.Size()
|
|
|
|
n += 1 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
|
|
|
if m.Txn != nil {
|
|
|
|
l = m.Txn.Size()
|
|
|
|
n += 1 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
2015-09-06 02:08:58 +03:00
|
|
|
if m.Compaction != nil {
|
|
|
|
l = m.Compaction.Size()
|
|
|
|
n += 1 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
2016-04-07 20:27:36 +03:00
|
|
|
if m.LeaseGrant != nil {
|
|
|
|
l = m.LeaseGrant.Size()
|
2016-01-06 00:49:25 +03:00
|
|
|
n += 1 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
|
|
|
if m.LeaseRevoke != nil {
|
|
|
|
l = m.LeaseRevoke.Size()
|
|
|
|
n += 1 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
2016-05-30 11:21:11 +03:00
|
|
|
if m.Alarm != nil {
|
|
|
|
l = m.Alarm.Size()
|
|
|
|
n += 1 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
|
|
|
if m.Header != nil {
|
|
|
|
l = m.Header.Size()
|
|
|
|
n += 2 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
2016-03-02 08:56:42 +03:00
|
|
|
if m.AuthEnable != nil {
|
|
|
|
l = m.AuthEnable.Size()
|
2016-05-30 11:21:11 +03:00
|
|
|
n += 2 + l + sovRaftInternal(uint64(l))
|
2016-03-02 08:56:42 +03:00
|
|
|
}
|
2016-05-07 21:24:43 +03:00
|
|
|
if m.AuthDisable != nil {
|
|
|
|
l = m.AuthDisable.Size()
|
2016-05-30 11:21:11 +03:00
|
|
|
n += 2 + l + sovRaftInternal(uint64(l))
|
2016-05-07 21:24:43 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.Authenticate != nil {
|
|
|
|
l = m.Authenticate.Size()
|
|
|
|
n += 2 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
2016-03-29 08:32:19 +03:00
|
|
|
if m.AuthUserAdd != nil {
|
|
|
|
l = m.AuthUserAdd.Size()
|
2016-05-30 11:21:11 +03:00
|
|
|
n += 2 + l + sovRaftInternal(uint64(l))
|
2016-03-23 07:25:48 +03:00
|
|
|
}
|
2016-03-31 05:29:47 +03:00
|
|
|
if m.AuthUserDelete != nil {
|
|
|
|
l = m.AuthUserDelete.Size()
|
2016-05-30 11:21:11 +03:00
|
|
|
n += 2 + l + sovRaftInternal(uint64(l))
|
2016-03-31 05:29:47 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthUserGet != nil {
|
|
|
|
l = m.AuthUserGet.Size()
|
2016-05-30 11:21:11 +03:00
|
|
|
n += 2 + l + sovRaftInternal(uint64(l))
|
2016-03-31 08:31:07 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthUserChangePassword != nil {
|
|
|
|
l = m.AuthUserChangePassword.Size()
|
2016-05-30 11:21:11 +03:00
|
|
|
n += 2 + l + sovRaftInternal(uint64(l))
|
2016-04-11 08:34:13 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthUserGrantRole != nil {
|
|
|
|
l = m.AuthUserGrantRole.Size()
|
2016-05-07 21:24:43 +03:00
|
|
|
n += 2 + l + sovRaftInternal(uint64(l))
|
2016-04-01 05:07:43 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthUserRevokeRole != nil {
|
|
|
|
l = m.AuthUserRevokeRole.Size()
|
2016-04-11 08:34:13 +03:00
|
|
|
n += 2 + l + sovRaftInternal(uint64(l))
|
2016-04-05 09:42:38 +03:00
|
|
|
}
|
2016-06-15 09:11:27 +03:00
|
|
|
if m.AuthUserList != nil {
|
|
|
|
l = m.AuthUserList.Size()
|
|
|
|
n += 2 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
|
|
|
if m.AuthRoleList != nil {
|
|
|
|
l = m.AuthRoleList.Size()
|
|
|
|
n += 2 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthRoleAdd != nil {
|
|
|
|
l = m.AuthRoleAdd.Size()
|
2016-04-13 07:44:53 +03:00
|
|
|
n += 2 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthRoleDelete != nil {
|
|
|
|
l = m.AuthRoleDelete.Size()
|
2016-05-17 09:20:50 +03:00
|
|
|
n += 2 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
2016-06-02 17:25:15 +03:00
|
|
|
if m.AuthRoleGet != nil {
|
|
|
|
l = m.AuthRoleGet.Size()
|
|
|
|
n += 2 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthRoleGrantPermission != nil {
|
|
|
|
l = m.AuthRoleGrantPermission.Size()
|
2016-06-03 10:38:59 +03:00
|
|
|
n += 2 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
2016-06-05 10:57:23 +03:00
|
|
|
if m.AuthRoleRevokePermission != nil {
|
|
|
|
l = m.AuthRoleRevokePermission.Size()
|
2016-06-03 11:10:08 +03:00
|
|
|
n += 2 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
2015-09-04 01:32:25 +03:00
|
|
|
return n
|
|
|
|
}
|
|
|
|
|
2015-09-13 18:28:10 +03:00
|
|
|
func (m *EmptyResponse) Size() (n int) {
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
return n
|
|
|
|
}
|
|
|
|
|
2016-06-09 03:11:26 +03:00
|
|
|
func (m *InternalAuthenticateRequest) Size() (n int) {
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
l = len(m.Name)
|
|
|
|
if l > 0 {
|
|
|
|
n += 1 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
|
|
|
l = len(m.Password)
|
|
|
|
if l > 0 {
|
|
|
|
n += 1 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
|
|
|
l = len(m.SimpleToken)
|
|
|
|
if l > 0 {
|
|
|
|
n += 1 + l + sovRaftInternal(uint64(l))
|
|
|
|
}
|
|
|
|
return n
|
|
|
|
}
|
|
|
|
|
2015-09-04 01:32:25 +03:00
|
|
|
func sovRaftInternal(x uint64) (n int) {
|
|
|
|
for {
|
|
|
|
n++
|
|
|
|
x >>= 7
|
|
|
|
if x == 0 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return n
|
|
|
|
}
|
|
|
|
func sozRaftInternal(x uint64) (n int) {
|
|
|
|
return sovRaftInternal(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
|
|
}
|
2016-05-17 09:20:50 +03:00
|
|
|
func (m *RequestHeader) Unmarshal(data []byte) error {
|
|
|
|
l := len(data)
|
|
|
|
iNdEx := 0
|
|
|
|
for iNdEx < l {
|
|
|
|
preIndex := iNdEx
|
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fieldNum := int32(wire >> 3)
|
|
|
|
wireType := int(wire & 0x7)
|
|
|
|
if wireType == 4 {
|
|
|
|
return fmt.Errorf("proto: RequestHeader: wiretype end group for non-group")
|
|
|
|
}
|
|
|
|
if fieldNum <= 0 {
|
|
|
|
return fmt.Errorf("proto: RequestHeader: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
|
}
|
|
|
|
switch fieldNum {
|
|
|
|
case 1:
|
|
|
|
if wireType != 0 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
|
|
|
|
}
|
|
|
|
m.ID = 0
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
m.ID |= (uint64(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 2:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType)
|
|
|
|
}
|
|
|
|
var stringLen uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
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 ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + intStringLen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.Username = string(data[iNdEx:postIndex])
|
|
|
|
iNdEx = postIndex
|
auth, etcdserver: introduce revision of authStore for avoiding TOCTOU problem
This commit introduces revision of authStore. The revision number
represents a version of authStore that is incremented by updating auth
related information.
The revision is required for avoiding TOCTOU problems. Currently there
are two types of the TOCTOU problems in v3 auth.
The first one is in ordinal linearizable requests with a sequence like
below ():
1. Request from client CA is processed in follower FA. FA looks up the
username (let it U) for the request from a token of the request. At
this time, the request is authorized correctly.
2. Another request from client CB is processed in follower FB. CB
is for changing U's password.
3. FB forwards the request from CB to the leader before FA. Now U's
password is updated and the request from CA should be rejected.
4. However, the request from CA is processed by the leader because
authentication is already done in FA.
For avoiding the above sequence, this commit lets
etcdserverpb.RequestHeader have a member revision. The member is
initialized during authentication by followers and checked in a
leader. If the revision in RequestHeader is lower than the leader's
authStore revision, it means a sequence like above happened. In such a
case, the state machine returns auth.ErrAuthRevisionObsolete. The
error code lets nodes retry their requests.
The second one, a case of serializable range and txn, is more
subtle. Because these requests are processed in follower directly. The
TOCTOU problem can be caused by a sequence like below:
1. Serializable request from client CA is processed in follower FA. At
first, FA looks up the username (let it U) and its permission
before actual access to KV.
2. Another request from client CB is processed in follower FB and
forwarded to the leader. The cluster including FA now commits a log
entry of the request from CB. Assume the request changed the
permission or password of U.
3. Now the serializable request from CA is accessing to KV. Even if
the access is allowed at the point of 1, now it can be invalid
because of the change introduced in 2.
For avoiding the above sequence, this commit lets the functions of
serializable requests (EtcdServer.Range() and EtcdServer.Txn())
compare the revision in the request header with the latest revision of
authStore after the actual access. If the saved revision is lower than
the latest one, it means the permission can be changed. Although it
would introduce false positives (e.g. changing other user's password),
it prevents the TOCTOU problem. This idea is an implementation of
Anthony's comment:
https://github.com/coreos/etcd/pull/5739#issuecomment-228128254
2016-06-23 12:31:12 +03:00
|
|
|
case 3:
|
|
|
|
if wireType != 0 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AuthRevision", wireType)
|
|
|
|
}
|
|
|
|
m.AuthRevision = 0
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
m.AuthRevision |= (uint64(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
2016-05-17 09:20:50 +03:00
|
|
|
default:
|
|
|
|
iNdEx = preIndex
|
|
|
|
skippy, err := skipRaftInternal(data[iNdEx:])
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if skippy < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
iNdEx += skippy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if iNdEx > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
func (m *InternalRaftRequest) Unmarshal(data []byte) error {
|
|
|
|
l := len(data)
|
|
|
|
iNdEx := 0
|
|
|
|
for iNdEx < l {
|
2016-01-27 04:41:19 +03:00
|
|
|
preIndex := iNdEx
|
2015-08-08 15:29:18 +03:00
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
2016-01-27 04:41:19 +03:00
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fieldNum := int32(wire >> 3)
|
|
|
|
wireType := int(wire & 0x7)
|
2016-01-27 04:41:19 +03:00
|
|
|
if wireType == 4 {
|
|
|
|
return fmt.Errorf("proto: InternalRaftRequest: wiretype end group for non-group")
|
|
|
|
}
|
|
|
|
if fieldNum <= 0 {
|
|
|
|
return fmt.Errorf("proto: InternalRaftRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
switch fieldNum {
|
|
|
|
case 1:
|
2015-09-13 18:28:10 +03:00
|
|
|
if wireType != 0 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
|
|
|
|
}
|
|
|
|
m.ID = 0
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
2016-01-27 04:41:19 +03:00
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
2015-09-13 18:28:10 +03:00
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
m.ID |= (uint64(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 2:
|
2015-08-08 15:29:18 +03:00
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field V2", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
2016-01-27 04:41:19 +03:00
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
2015-09-04 01:32:25 +03:00
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
if m.V2 == nil {
|
|
|
|
m.V2 = &Request{}
|
|
|
|
}
|
|
|
|
if err := m.V2.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2015-09-13 18:28:10 +03:00
|
|
|
case 3:
|
2015-08-08 15:29:18 +03:00
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Range", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
2016-01-27 04:41:19 +03:00
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
2015-09-04 01:32:25 +03:00
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
if m.Range == nil {
|
|
|
|
m.Range = &RangeRequest{}
|
|
|
|
}
|
|
|
|
if err := m.Range.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2015-09-13 18:28:10 +03:00
|
|
|
case 4:
|
2015-08-08 15:29:18 +03:00
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Put", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
2016-01-27 04:41:19 +03:00
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
2015-09-04 01:32:25 +03:00
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
if m.Put == nil {
|
|
|
|
m.Put = &PutRequest{}
|
|
|
|
}
|
|
|
|
if err := m.Put.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2015-09-13 18:28:10 +03:00
|
|
|
case 5:
|
2015-08-08 15:29:18 +03:00
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field DeleteRange", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
2016-01-27 04:41:19 +03:00
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
2015-09-04 01:32:25 +03:00
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
if m.DeleteRange == nil {
|
|
|
|
m.DeleteRange = &DeleteRangeRequest{}
|
|
|
|
}
|
|
|
|
if err := m.DeleteRange.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2015-09-13 18:28:10 +03:00
|
|
|
case 6:
|
2015-08-08 15:29:18 +03:00
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Txn", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
2016-01-27 04:41:19 +03:00
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
2015-09-04 01:32:25 +03:00
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
if m.Txn == nil {
|
|
|
|
m.Txn = &TxnRequest{}
|
|
|
|
}
|
|
|
|
if err := m.Txn.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2015-09-06 02:08:58 +03:00
|
|
|
case 7:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Compaction", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
2016-01-27 04:41:19 +03:00
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
2015-09-06 02:08:58 +03:00
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
if m.Compaction == nil {
|
|
|
|
m.Compaction = &CompactionRequest{}
|
|
|
|
}
|
|
|
|
if err := m.Compaction.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2016-01-06 00:49:25 +03:00
|
|
|
case 8:
|
|
|
|
if wireType != 2 {
|
2016-04-07 20:27:36 +03:00
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field LeaseGrant", wireType)
|
2016-01-06 00:49:25 +03:00
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
2016-01-27 04:41:19 +03:00
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
2016-01-06 00:49:25 +03:00
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2016-04-07 20:27:36 +03:00
|
|
|
if m.LeaseGrant == nil {
|
|
|
|
m.LeaseGrant = &LeaseGrantRequest{}
|
2016-01-06 00:49:25 +03:00
|
|
|
}
|
2016-04-07 20:27:36 +03:00
|
|
|
if err := m.LeaseGrant.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
2016-01-06 00:49:25 +03:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 9:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field LeaseRevoke", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
2016-01-27 04:41:19 +03:00
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
2016-01-06 00:49:25 +03:00
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
if m.LeaseRevoke == nil {
|
|
|
|
m.LeaseRevoke = &LeaseRevokeRequest{}
|
|
|
|
}
|
|
|
|
if err := m.LeaseRevoke.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2016-03-02 08:56:42 +03:00
|
|
|
case 10:
|
2016-05-30 11:21:11 +03:00
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
if m.Alarm == nil {
|
|
|
|
m.Alarm = &AlarmRequest{}
|
|
|
|
}
|
|
|
|
if err := m.Alarm.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 100:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
if m.Header == nil {
|
|
|
|
m.Header = &RequestHeader{}
|
|
|
|
}
|
|
|
|
if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 1000:
|
2016-03-02 08:56:42 +03:00
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AuthEnable", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
if m.AuthEnable == nil {
|
|
|
|
m.AuthEnable = &AuthEnableRequest{}
|
|
|
|
}
|
|
|
|
if err := m.AuthEnable.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2016-05-30 11:21:11 +03:00
|
|
|
case 1011:
|
2016-05-07 21:24:43 +03:00
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AuthDisable", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
if m.AuthDisable == nil {
|
|
|
|
m.AuthDisable = &AuthDisableRequest{}
|
|
|
|
}
|
|
|
|
if err := m.AuthDisable.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2016-05-30 11:21:11 +03:00
|
|
|
case 1012:
|
2016-03-23 07:25:48 +03:00
|
|
|
if wireType != 2 {
|
2016-06-07 06:17:28 +03:00
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Authenticate", wireType)
|
2016-03-23 07:25:48 +03:00
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.Authenticate == nil {
|
2016-06-09 03:11:26 +03:00
|
|
|
m.Authenticate = &InternalAuthenticateRequest{}
|
2016-03-23 07:25:48 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if err := m.Authenticate.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
2016-03-23 07:25:48 +03:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2016-06-07 06:17:28 +03:00
|
|
|
case 1100:
|
2016-03-31 05:29:47 +03:00
|
|
|
if wireType != 2 {
|
2016-06-07 06:17:28 +03:00
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AuthUserAdd", wireType)
|
2016-03-31 05:29:47 +03:00
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthUserAdd == nil {
|
|
|
|
m.AuthUserAdd = &AuthUserAddRequest{}
|
2016-03-31 05:29:47 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if err := m.AuthUserAdd.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
2016-03-31 05:29:47 +03:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2016-06-07 06:17:28 +03:00
|
|
|
case 1101:
|
2016-03-31 08:31:07 +03:00
|
|
|
if wireType != 2 {
|
2016-06-07 06:17:28 +03:00
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AuthUserDelete", wireType)
|
2016-03-31 08:31:07 +03:00
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthUserDelete == nil {
|
|
|
|
m.AuthUserDelete = &AuthUserDeleteRequest{}
|
2016-03-31 08:31:07 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if err := m.AuthUserDelete.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
2016-03-31 08:31:07 +03:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2016-06-07 06:17:28 +03:00
|
|
|
case 1102:
|
2016-04-11 08:34:13 +03:00
|
|
|
if wireType != 2 {
|
2016-06-07 06:17:28 +03:00
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AuthUserGet", wireType)
|
2016-04-11 08:34:13 +03:00
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthUserGet == nil {
|
|
|
|
m.AuthUserGet = &AuthUserGetRequest{}
|
2016-04-11 08:34:13 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if err := m.AuthUserGet.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
2016-04-11 08:34:13 +03:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2016-06-07 06:17:28 +03:00
|
|
|
case 1103:
|
2016-04-01 05:07:43 +03:00
|
|
|
if wireType != 2 {
|
2016-06-07 06:17:28 +03:00
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AuthUserChangePassword", wireType)
|
2016-04-01 05:07:43 +03:00
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthUserChangePassword == nil {
|
|
|
|
m.AuthUserChangePassword = &AuthUserChangePasswordRequest{}
|
2016-04-01 05:07:43 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if err := m.AuthUserChangePassword.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
2016-04-01 05:07:43 +03:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2016-06-07 06:17:28 +03:00
|
|
|
case 1104:
|
2016-04-05 09:42:38 +03:00
|
|
|
if wireType != 2 {
|
2016-06-07 06:17:28 +03:00
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AuthUserGrantRole", wireType)
|
2016-04-05 09:42:38 +03:00
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthUserGrantRole == nil {
|
|
|
|
m.AuthUserGrantRole = &AuthUserGrantRoleRequest{}
|
2016-04-05 09:42:38 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if err := m.AuthUserGrantRole.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
2016-04-05 09:42:38 +03:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2016-06-07 06:17:28 +03:00
|
|
|
case 1105:
|
2016-04-13 07:44:53 +03:00
|
|
|
if wireType != 2 {
|
2016-06-07 06:17:28 +03:00
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AuthUserRevokeRole", wireType)
|
2016-04-13 07:44:53 +03:00
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthUserRevokeRole == nil {
|
|
|
|
m.AuthUserRevokeRole = &AuthUserRevokeRoleRequest{}
|
2016-04-13 07:44:53 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if err := m.AuthUserRevokeRole.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
2016-04-13 07:44:53 +03:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2016-06-15 09:11:27 +03:00
|
|
|
case 1106:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AuthUserList", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
if m.AuthUserList == nil {
|
|
|
|
m.AuthUserList = &AuthUserListRequest{}
|
|
|
|
}
|
|
|
|
if err := m.AuthUserList.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 1107:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleList", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
if m.AuthRoleList == nil {
|
|
|
|
m.AuthRoleList = &AuthRoleListRequest{}
|
|
|
|
}
|
|
|
|
if err := m.AuthRoleList.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2016-06-07 06:17:28 +03:00
|
|
|
case 1200:
|
2016-03-24 03:20:52 +03:00
|
|
|
if wireType != 2 {
|
2016-06-07 06:17:28 +03:00
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleAdd", wireType)
|
2016-03-24 03:20:52 +03:00
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthRoleAdd == nil {
|
|
|
|
m.AuthRoleAdd = &AuthRoleAddRequest{}
|
2016-05-17 09:20:50 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if err := m.AuthRoleAdd.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
2016-05-17 09:20:50 +03:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2016-06-07 06:17:28 +03:00
|
|
|
case 1201:
|
2016-06-02 17:25:15 +03:00
|
|
|
if wireType != 2 {
|
2016-06-07 06:17:28 +03:00
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleDelete", wireType)
|
2016-06-02 17:25:15 +03:00
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthRoleDelete == nil {
|
|
|
|
m.AuthRoleDelete = &AuthRoleDeleteRequest{}
|
2016-06-02 17:25:15 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if err := m.AuthRoleDelete.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
2016-06-02 17:25:15 +03:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2016-06-07 06:17:28 +03:00
|
|
|
case 1202:
|
2016-06-03 10:38:59 +03:00
|
|
|
if wireType != 2 {
|
2016-06-07 06:17:28 +03:00
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleGet", wireType)
|
2016-06-03 10:38:59 +03:00
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthRoleGet == nil {
|
|
|
|
m.AuthRoleGet = &AuthRoleGetRequest{}
|
2016-06-03 10:38:59 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if err := m.AuthRoleGet.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
2016-06-03 10:38:59 +03:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2016-06-07 06:17:28 +03:00
|
|
|
case 1203:
|
2016-06-03 11:10:08 +03:00
|
|
|
if wireType != 2 {
|
2016-06-07 06:17:28 +03:00
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleGrantPermission", wireType)
|
2016-06-03 11:10:08 +03:00
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthRoleGrantPermission == nil {
|
|
|
|
m.AuthRoleGrantPermission = &AuthRoleGrantPermissionRequest{}
|
2016-06-03 11:10:08 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if err := m.AuthRoleGrantPermission.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
2016-06-03 11:10:08 +03:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2016-06-07 06:17:28 +03:00
|
|
|
case 1204:
|
2016-06-03 11:33:05 +03:00
|
|
|
if wireType != 2 {
|
2016-06-07 06:17:28 +03:00
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleRevokePermission", wireType)
|
2016-06-03 11:33:05 +03:00
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if m.AuthRoleRevokePermission == nil {
|
|
|
|
m.AuthRoleRevokePermission = &AuthRoleRevokePermissionRequest{}
|
2016-06-03 11:33:05 +03:00
|
|
|
}
|
2016-06-07 06:17:28 +03:00
|
|
|
if err := m.AuthRoleRevokePermission.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
2016-06-03 11:33:05 +03:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
2015-08-08 15:29:18 +03:00
|
|
|
default:
|
2016-01-27 04:41:19 +03:00
|
|
|
iNdEx = preIndex
|
2015-09-13 18:28:10 +03:00
|
|
|
skippy, err := skipRaftInternal(data[iNdEx:])
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if skippy < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
iNdEx += skippy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-27 04:41:19 +03:00
|
|
|
if iNdEx > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2015-09-13 18:28:10 +03:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
func (m *EmptyResponse) Unmarshal(data []byte) error {
|
|
|
|
l := len(data)
|
|
|
|
iNdEx := 0
|
|
|
|
for iNdEx < l {
|
2016-01-27 04:41:19 +03:00
|
|
|
preIndex := iNdEx
|
2015-09-13 18:28:10 +03:00
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
2016-01-27 04:41:19 +03:00
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
2015-09-13 18:28:10 +03:00
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fieldNum := int32(wire >> 3)
|
2016-01-27 04:41:19 +03:00
|
|
|
wireType := int(wire & 0x7)
|
|
|
|
if wireType == 4 {
|
|
|
|
return fmt.Errorf("proto: EmptyResponse: wiretype end group for non-group")
|
|
|
|
}
|
|
|
|
if fieldNum <= 0 {
|
|
|
|
return fmt.Errorf("proto: EmptyResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
|
}
|
2015-09-13 18:28:10 +03:00
|
|
|
switch fieldNum {
|
|
|
|
default:
|
2016-01-27 04:41:19 +03:00
|
|
|
iNdEx = preIndex
|
2015-08-08 15:29:18 +03:00
|
|
|
skippy, err := skipRaftInternal(data[iNdEx:])
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2015-09-04 01:32:25 +03:00
|
|
|
if skippy < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
if (iNdEx + skippy) > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
iNdEx += skippy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-27 04:41:19 +03:00
|
|
|
if iNdEx > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
return nil
|
|
|
|
}
|
2016-06-09 03:11:26 +03:00
|
|
|
func (m *InternalAuthenticateRequest) Unmarshal(data []byte) error {
|
|
|
|
l := len(data)
|
|
|
|
iNdEx := 0
|
|
|
|
for iNdEx < l {
|
|
|
|
preIndex := iNdEx
|
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fieldNum := int32(wire >> 3)
|
|
|
|
wireType := int(wire & 0x7)
|
|
|
|
if wireType == 4 {
|
|
|
|
return fmt.Errorf("proto: InternalAuthenticateRequest: wiretype end group for non-group")
|
|
|
|
}
|
|
|
|
if fieldNum <= 0 {
|
|
|
|
return fmt.Errorf("proto: InternalAuthenticateRequest: 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 ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
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 ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
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 Password", wireType)
|
|
|
|
}
|
|
|
|
var stringLen uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
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 ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + intStringLen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.Password = string(data[iNdEx:postIndex])
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 3:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field SimpleToken", wireType)
|
|
|
|
}
|
|
|
|
var stringLen uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowRaftInternal
|
|
|
|
}
|
|
|
|
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 ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + intStringLen
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.SimpleToken = string(data[iNdEx:postIndex])
|
|
|
|
iNdEx = postIndex
|
|
|
|
default:
|
|
|
|
iNdEx = preIndex
|
|
|
|
skippy, err := skipRaftInternal(data[iNdEx:])
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if skippy < 0 {
|
|
|
|
return ErrInvalidLengthRaftInternal
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
iNdEx += skippy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if iNdEx > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
func skipRaftInternal(data []byte) (n int, err error) {
|
|
|
|
l := len(data)
|
|
|
|
iNdEx := 0
|
|
|
|
for iNdEx < l {
|
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
2016-01-27 04:41:19 +03:00
|
|
|
if shift >= 64 {
|
|
|
|
return 0, ErrIntOverflowRaftInternal
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
if iNdEx >= l {
|
|
|
|
return 0, io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wireType := int(wire & 0x7)
|
|
|
|
switch wireType {
|
|
|
|
case 0:
|
2016-01-27 04:41:19 +03:00
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return 0, ErrIntOverflowRaftInternal
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
if iNdEx >= l {
|
|
|
|
return 0, io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
iNdEx++
|
|
|
|
if data[iNdEx-1] < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return iNdEx, nil
|
|
|
|
case 1:
|
|
|
|
iNdEx += 8
|
|
|
|
return iNdEx, nil
|
|
|
|
case 2:
|
|
|
|
var length int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
2016-01-27 04:41:19 +03:00
|
|
|
if shift >= 64 {
|
|
|
|
return 0, ErrIntOverflowRaftInternal
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
if iNdEx >= l {
|
|
|
|
return 0, io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
length |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
iNdEx += length
|
2015-09-04 01:32:25 +03:00
|
|
|
if length < 0 {
|
|
|
|
return 0, ErrInvalidLengthRaftInternal
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
return iNdEx, nil
|
|
|
|
case 3:
|
|
|
|
for {
|
|
|
|
var innerWire uint64
|
|
|
|
var start int = iNdEx
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
2016-01-27 04:41:19 +03:00
|
|
|
if shift >= 64 {
|
|
|
|
return 0, ErrIntOverflowRaftInternal
|
|
|
|
}
|
2015-08-08 15:29:18 +03:00
|
|
|
if iNdEx >= l {
|
|
|
|
return 0, io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := data[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
innerWire |= (uint64(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
innerWireType := int(innerWire & 0x7)
|
|
|
|
if innerWireType == 4 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
next, err := skipRaftInternal(data[start:])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
iNdEx = start + next
|
|
|
|
}
|
|
|
|
return iNdEx, nil
|
|
|
|
case 4:
|
|
|
|
return iNdEx, nil
|
|
|
|
case 5:
|
|
|
|
iNdEx += 4
|
|
|
|
return iNdEx, nil
|
|
|
|
default:
|
|
|
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
panic("unreachable")
|
|
|
|
}
|
|
|
|
|
2015-09-04 01:32:25 +03:00
|
|
|
var (
|
|
|
|
ErrInvalidLengthRaftInternal = fmt.Errorf("proto: negative length found during unmarshaling")
|
2016-01-27 04:41:19 +03:00
|
|
|
ErrIntOverflowRaftInternal = fmt.Errorf("proto: integer overflow")
|
2015-09-04 01:32:25 +03:00
|
|
|
)
|
2016-04-26 00:08:33 +03:00
|
|
|
|
|
|
|
var fileDescriptorRaftInternal = []byte{
|
2016-07-27 23:21:03 +03:00
|
|
|
// 837 bytes of a gzipped FileDescriptorProto
|
|
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x96, 0xdd, 0x52, 0xd3, 0x40,
|
|
|
|
0x14, 0xc7, 0x69, 0xf9, 0xec, 0xb6, 0x54, 0x5c, 0x40, 0xd7, 0x32, 0x53, 0xa1, 0x8c, 0x8a, 0x5f,
|
|
|
|
0xe8, 0x94, 0x07, 0xd0, 0x4a, 0x19, 0x60, 0x86, 0x61, 0x98, 0x0c, 0xce, 0x38, 0xe3, 0x45, 0x5c,
|
|
|
|
0x9a, 0x43, 0x1b, 0x49, 0x93, 0xb8, 0xd9, 0x56, 0x7c, 0x13, 0x1f, 0xc3, 0xaf, 0x87, 0xe0, 0xc2,
|
|
|
|
0x0f, 0xd4, 0x17, 0x50, 0xbc, 0xf1, 0xca, 0x1b, 0x7d, 0x00, 0x67, 0x3f, 0x92, 0x34, 0x6d, 0xca,
|
|
|
|
0x5d, 0x72, 0xce, 0xff, 0xfc, 0xce, 0xd9, 0xec, 0x7f, 0xbb, 0x45, 0xb3, 0x8c, 0x1e, 0x72, 0xd3,
|
|
|
|
0x76, 0x39, 0x30, 0x97, 0x3a, 0xab, 0x3e, 0xf3, 0xb8, 0x87, 0x0b, 0xc0, 0x1b, 0x56, 0x00, 0xac,
|
|
|
|
0x0b, 0xcc, 0x3f, 0x28, 0xcd, 0x35, 0xbd, 0xa6, 0x27, 0x13, 0xf7, 0xc4, 0x93, 0xd2, 0x94, 0x66,
|
|
|
|
0x62, 0x8d, 0x8e, 0xe4, 0x98, 0xdf, 0x50, 0x8f, 0x95, 0x67, 0x68, 0xda, 0x80, 0x17, 0x1d, 0x08,
|
|
|
|
0xf8, 0x16, 0x50, 0x0b, 0x18, 0x2e, 0xa2, 0xec, 0x76, 0x9d, 0x64, 0x16, 0x33, 0x2b, 0x63, 0x46,
|
|
|
|
0xd6, 0xae, 0xe3, 0x12, 0x9a, 0xea, 0x04, 0xa2, 0x65, 0x1b, 0x48, 0x76, 0x31, 0xb3, 0x92, 0x33,
|
|
|
|
0xa2, 0x77, 0xbc, 0x8c, 0xa6, 0x69, 0x87, 0xb7, 0x4c, 0x06, 0x5d, 0x3b, 0xb0, 0x3d, 0x97, 0x8c,
|
|
|
|
0xca, 0xb2, 0x82, 0x08, 0x1a, 0x3a, 0x56, 0xf9, 0x53, 0x44, 0xb3, 0xdb, 0x7a, 0x6a, 0x83, 0x1e,
|
|
|
|
0x72, 0xdd, 0x6e, 0xa0, 0xd1, 0x35, 0x94, 0xed, 0x56, 0x65, 0x8b, 0x7c, 0x75, 0x7e, 0xb5, 0x77,
|
|
|
|
0x5d, 0xab, 0xba, 0xc4, 0xc8, 0x76, 0xab, 0xf8, 0x3e, 0x1a, 0x67, 0xd4, 0x6d, 0x82, 0xec, 0x95,
|
|
|
|
0xaf, 0x96, 0xfa, 0x94, 0x22, 0x15, 0xca, 0x95, 0x10, 0xdf, 0x42, 0xa3, 0x7e, 0x87, 0x93, 0x31,
|
|
|
|
0xa9, 0x27, 0x49, 0xfd, 0x5e, 0x27, 0x9c, 0xc7, 0x10, 0x22, 0xbc, 0x8e, 0x0a, 0x16, 0x38, 0xc0,
|
|
|
|
0xc1, 0x54, 0x4d, 0xc6, 0x65, 0xd1, 0x62, 0xb2, 0xa8, 0x2e, 0x15, 0x89, 0x56, 0x79, 0x2b, 0x8e,
|
|
|
|
0x89, 0x86, 0xfc, 0xd8, 0x25, 0x13, 0x69, 0x0d, 0xf7, 0x8f, 0xdd, 0xa8, 0x21, 0x3f, 0x76, 0xf1,
|
|
|
|
0x03, 0x84, 0x1a, 0x5e, 0xdb, 0xa7, 0x0d, 0x2e, 0xbe, 0xdf, 0xa4, 0x2c, 0xb9, 0x9a, 0x2c, 0x59,
|
|
|
|
0x8f, 0xf2, 0x61, 0x65, 0x4f, 0x09, 0x7e, 0x88, 0xf2, 0x0e, 0xd0, 0x00, 0xcc, 0x26, 0xa3, 0x2e,
|
|
|
|
0x27, 0x53, 0x69, 0x84, 0x1d, 0x21, 0xd8, 0x14, 0xf9, 0x88, 0xe0, 0x44, 0x21, 0xb1, 0x66, 0x45,
|
|
|
|
0x60, 0xd0, 0xf5, 0x8e, 0x80, 0xe4, 0xd2, 0xd6, 0x2c, 0x11, 0x86, 0x14, 0x44, 0x6b, 0x76, 0xe2,
|
|
|
|
0x98, 0xd8, 0x16, 0xea, 0x50, 0xd6, 0x26, 0x28, 0x6d, 0x5b, 0x6a, 0x22, 0x15, 0x6d, 0x8b, 0x14,
|
|
|
|
0xe2, 0x35, 0x34, 0xd1, 0x92, 0x96, 0x23, 0x96, 0x2c, 0x59, 0x48, 0xdd, 0x73, 0xe5, 0x4a, 0x43,
|
|
|
|
0x4b, 0x71, 0x0d, 0xe5, 0xa5, 0xe3, 0xc0, 0xa5, 0x07, 0x0e, 0x90, 0xdf, 0xa9, 0x1f, 0xac, 0xd6,
|
|
|
|
0xe1, 0xad, 0x0d, 0x29, 0x88, 0x96, 0x4b, 0xa3, 0x10, 0xae, 0x23, 0xe9, 0x4f, 0xd3, 0xb2, 0x03,
|
|
|
|
0xc9, 0xf8, 0x3b, 0x99, 0xb6, 0x5e, 0xc1, 0xa8, 0x2b, 0x45, 0xb4, 0x5e, 0x1a, 0xc7, 0xf0, 0xae,
|
|
|
|
0xa2, 0x80, 0xcb, 0xed, 0x06, 0xe5, 0x40, 0xfe, 0x29, 0xca, 0xcd, 0x24, 0x25, 0xf4, 0x7d, 0xad,
|
|
|
|
0x47, 0x1a, 0xe2, 0x12, 0xf5, 0x78, 0x43, 0x1f, 0x25, 0x71, 0xb6, 0x4c, 0x6a, 0x59, 0xe4, 0xe3,
|
|
|
|
0xd4, 0xb0, 0xb1, 0x1e, 0x07, 0xc0, 0x6a, 0x96, 0x95, 0x18, 0x4b, 0xc7, 0xf0, 0x2e, 0x9a, 0x89,
|
|
|
|
0x31, 0xca, 0x93, 0xe4, 0x93, 0x22, 0x2d, 0xa7, 0x93, 0xb4, 0x99, 0x35, 0xac, 0x48, 0x13, 0xe1,
|
|
|
|
0xe4, 0x58, 0x4d, 0xe0, 0xe4, 0xf3, 0xb9, 0x63, 0x6d, 0x02, 0x1f, 0x18, 0x6b, 0x13, 0x38, 0x6e,
|
|
|
|
0xa2, 0x2b, 0x31, 0xa6, 0xd1, 0x12, 0xa7, 0xc4, 0xf4, 0x69, 0x10, 0xbc, 0xf4, 0x98, 0x45, 0xbe,
|
|
|
|
0x28, 0xe4, 0xed, 0x74, 0xe4, 0xba, 0x54, 0xef, 0x69, 0x71, 0x48, 0xbf, 0x44, 0x53, 0xd3, 0xf8,
|
|
|
|
0x09, 0x9a, 0xeb, 0x99, 0x57, 0xd8, 0xdb, 0x64, 0x9e, 0x03, 0xe4, 0x54, 0xf5, 0xb8, 0x3e, 0x64,
|
|
|
|
0x6c, 0x79, 0x34, 0xbc, 0x78, 0xab, 0x2f, 0xd2, 0xfe, 0x0c, 0x7e, 0x8a, 0xe6, 0x63, 0xb2, 0x3a,
|
|
|
|
0x29, 0x0a, 0xfd, 0x55, 0xa1, 0x6f, 0xa4, 0xa3, 0xf5, 0x91, 0xe9, 0x61, 0x63, 0x3a, 0x90, 0xc2,
|
|
|
|
0x5b, 0xa8, 0x18, 0xc3, 0x1d, 0x3b, 0xe0, 0xe4, 0x9b, 0xa2, 0x2e, 0xa5, 0x53, 0x77, 0xec, 0x80,
|
|
|
|
0x27, 0x7c, 0x14, 0x06, 0x23, 0x92, 0x18, 0x4d, 0x91, 0xbe, 0x0f, 0x25, 0x89, 0xd6, 0x03, 0xa4,
|
|
|
|
0x30, 0x18, 0x6d, 0xbd, 0x24, 0x09, 0x47, 0xbe, 0xc9, 0x0d, 0xdb, 0x7a, 0x51, 0xd3, 0xef, 0x48,
|
|
|
|
0x1d, 0x8b, 0x1c, 0x29, 0x31, 0xda, 0x91, 0x6f, 0x73, 0xc3, 0x1c, 0x29, 0xaa, 0x52, 0x1c, 0x19,
|
|
|
|
0x87, 0x93, 0x63, 0x09, 0x47, 0xbe, 0x3b, 0x77, 0xac, 0x7e, 0x47, 0xea, 0x18, 0x7e, 0x8e, 0x4a,
|
|
|
|
0x3d, 0x18, 0x69, 0x14, 0x1f, 0x58, 0xdb, 0x0e, 0xe4, 0x3d, 0xf6, 0x5e, 0x31, 0xef, 0x0c, 0x61,
|
|
|
|
0x0a, 0xf9, 0x5e, 0xa4, 0x0e, 0xf9, 0x97, 0x69, 0x7a, 0x1e, 0xb7, 0xd1, 0x42, 0xdc, 0x4b, 0x5b,
|
|
|
|
0xa7, 0xa7, 0xd9, 0x07, 0xd5, 0xec, 0x6e, 0x7a, 0x33, 0xe5, 0x92, 0xc1, 0x6e, 0x84, 0x0e, 0x11,
|
|
|
|
0x54, 0x2e, 0xa0, 0xe9, 0x8d, 0xb6, 0xcf, 0x5f, 0x19, 0x10, 0xf8, 0x9e, 0x1b, 0x40, 0xc5, 0x47,
|
|
|
|
0x0b, 0xe7, 0xfc, 0x10, 0x61, 0x8c, 0xc6, 0xe4, 0xed, 0x9e, 0x91, 0xb7, 0xbb, 0x7c, 0x16, 0xb7,
|
|
|
|
0x7e, 0x74, 0x3e, 0xf5, 0xad, 0x1f, 0xbe, 0xe3, 0x25, 0x54, 0x08, 0xec, 0xb6, 0xef, 0x80, 0xc9,
|
|
|
|
0xbd, 0x23, 0x50, 0x97, 0x7e, 0xce, 0xc8, 0xab, 0xd8, 0xbe, 0x08, 0x3d, 0x9a, 0x3b, 0xf9, 0x59,
|
|
|
|
0x1e, 0x39, 0x39, 0x2b, 0x67, 0x4e, 0xcf, 0xca, 0x99, 0x1f, 0x67, 0xe5, 0xcc, 0xeb, 0x5f, 0xe5,
|
|
|
|
0x91, 0x83, 0x09, 0xf9, 0x97, 0x63, 0xed, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x02, 0x23, 0xd2,
|
|
|
|
0x00, 0xca, 0x08, 0x00, 0x00,
|
2016-04-26 00:08:33 +03:00
|
|
|
}
|