vendor update

This commit is contained in:
Gyu-Ho Lee 2016-04-05 11:22:36 -07:00
parent b3964c706c
commit ab5091cd64
7 changed files with 121 additions and 21 deletions

32
Godeps/Godeps.json generated
View File

@ -25,43 +25,43 @@
},
{
"ImportPath": "github.com/coreos/etcd/client",
"Comment": "v2.3.0-227-ge8a4ed0",
"Rev": "e8a4ed01e20fc5fbb09e2a00b9a31ef30c6e25e5"
"Comment": "v2.3.0-245-g01c3031",
"Rev": "01c303113d0a3d5a8075864321c3aedb72035bdd"
},
{
"ImportPath": "github.com/coreos/etcd/clientv3",
"Comment": "v2.3.0-227-ge8a4ed0",
"Rev": "e8a4ed01e20fc5fbb09e2a00b9a31ef30c6e25e5"
"Comment": "v2.3.0-245-g01c3031",
"Rev": "01c303113d0a3d5a8075864321c3aedb72035bdd"
},
{
"ImportPath": "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes",
"Comment": "v2.3.0-227-ge8a4ed0",
"Rev": "e8a4ed01e20fc5fbb09e2a00b9a31ef30c6e25e5"
"Comment": "v2.3.0-245-g01c3031",
"Rev": "01c303113d0a3d5a8075864321c3aedb72035bdd"
},
{
"ImportPath": "github.com/coreos/etcd/etcdserver/etcdserverpb",
"Comment": "v2.3.0-227-ge8a4ed0",
"Rev": "e8a4ed01e20fc5fbb09e2a00b9a31ef30c6e25e5"
"Comment": "v2.3.0-245-g01c3031",
"Rev": "01c303113d0a3d5a8075864321c3aedb72035bdd"
},
{
"ImportPath": "github.com/coreos/etcd/pkg/pathutil",
"Comment": "v2.3.0-227-ge8a4ed0",
"Rev": "e8a4ed01e20fc5fbb09e2a00b9a31ef30c6e25e5"
"Comment": "v2.3.0-245-g01c3031",
"Rev": "01c303113d0a3d5a8075864321c3aedb72035bdd"
},
{
"ImportPath": "github.com/coreos/etcd/pkg/tlsutil",
"Comment": "v2.3.0-227-ge8a4ed0",
"Rev": "e8a4ed01e20fc5fbb09e2a00b9a31ef30c6e25e5"
"Comment": "v2.3.0-245-g01c3031",
"Rev": "01c303113d0a3d5a8075864321c3aedb72035bdd"
},
{
"ImportPath": "github.com/coreos/etcd/pkg/types",
"Comment": "v2.3.0-227-ge8a4ed0",
"Rev": "e8a4ed01e20fc5fbb09e2a00b9a31ef30c6e25e5"
"Comment": "v2.3.0-245-g01c3031",
"Rev": "01c303113d0a3d5a8075864321c3aedb72035bdd"
},
{
"ImportPath": "github.com/coreos/etcd/storage/storagepb",
"Comment": "v2.3.0-227-ge8a4ed0",
"Rev": "e8a4ed01e20fc5fbb09e2a00b9a31ef30c6e25e5"
"Comment": "v2.3.0-245-g01c3031",
"Rev": "01c303113d0a3d5a8075864321c3aedb72035bdd"
},
{
"ImportPath": "github.com/dustin/go-humanize",

View File

@ -25,6 +25,7 @@ type (
AuthUserAddResponse pb.AuthUserAddResponse
AuthUserDeleteResponse pb.AuthUserDeleteResponse
AuthUserChangePasswordResponse pb.AuthUserChangePasswordResponse
AuthRoleAddResponse pb.AuthRoleAddResponse
)
type Auth interface {
@ -39,6 +40,9 @@ type Auth interface {
// UserChangePassword changes a password of a user.
UserChangePassword(ctx context.Context, name string, password string) (*AuthUserChangePasswordResponse, error)
// RoleAdd adds a new user to an etcd cluster.
RoleAdd(ctx context.Context, name string) (*AuthRoleAddResponse, error)
}
type auth struct {
@ -76,3 +80,8 @@ func (auth *auth) UserChangePassword(ctx context.Context, name string, password
resp, err := auth.remote.UserChangePassword(ctx, &pb.AuthUserChangePasswordRequest{Name: name, Password: password})
return (*AuthUserChangePasswordResponse)(resp), err
}
func (auth *auth) RoleAdd(ctx context.Context, name string) (*AuthRoleAddResponse, error) {
resp, err := auth.remote.RoleAdd(ctx, &pb.AuthRoleAddRequest{Name: name})
return (*AuthRoleAddResponse)(resp), err
}

View File

@ -39,4 +39,5 @@ var (
ErrUserAlreadyExist = grpc.Errorf(codes.FailedPrecondition, "etcdserver: user name already exists")
ErrUserNotFound = grpc.Errorf(codes.FailedPrecondition, "etcdserver: user name not found")
ErrRoleAlreadyExist = grpc.Errorf(codes.FailedPrecondition, "etcdserver: role name already exists")
)

View File

@ -35,7 +35,8 @@ type InternalRaftRequest struct {
AuthUserAdd *AuthUserAddRequest `protobuf:"bytes,11,opt,name=auth_user_add" json:"auth_user_add,omitempty"`
AuthUserDelete *AuthUserDeleteRequest `protobuf:"bytes,12,opt,name=auth_user_delete" json:"auth_user_delete,omitempty"`
AuthUserChangePassword *AuthUserChangePasswordRequest `protobuf:"bytes,13,opt,name=auth_user_change_password" json:"auth_user_change_password,omitempty"`
Alarm *AlarmRequest `protobuf:"bytes,14,opt,name=alarm" json:"alarm,omitempty"`
AuthRoleAdd *AuthRoleAddRequest `protobuf:"bytes,14,opt,name=auth_role_add" json:"auth_role_add,omitempty"`
Alarm *AlarmRequest `protobuf:"bytes,15,opt,name=alarm" json:"alarm,omitempty"`
}
func (m *InternalRaftRequest) Reset() { *m = InternalRaftRequest{} }
@ -193,16 +194,26 @@ func (m *InternalRaftRequest) MarshalTo(data []byte) (int, error) {
}
i += n12
}
if m.Alarm != nil {
if m.AuthRoleAdd != nil {
data[i] = 0x72
i++
i = encodeVarintRaftInternal(data, i, uint64(m.Alarm.Size()))
n13, err := m.Alarm.MarshalTo(data[i:])
i = encodeVarintRaftInternal(data, i, uint64(m.AuthRoleAdd.Size()))
n13, err := m.AuthRoleAdd.MarshalTo(data[i:])
if err != nil {
return 0, err
}
i += n13
}
if m.Alarm != nil {
data[i] = 0x7a
i++
i = encodeVarintRaftInternal(data, i, uint64(m.Alarm.Size()))
n14, err := m.Alarm.MarshalTo(data[i:])
if err != nil {
return 0, err
}
i += n14
}
return i, nil
}
@ -305,6 +316,10 @@ func (m *InternalRaftRequest) Size() (n int) {
l = m.AuthUserChangePassword.Size()
n += 1 + l + sovRaftInternal(uint64(l))
}
if m.AuthRoleAdd != nil {
l = m.AuthRoleAdd.Size()
n += 1 + l + sovRaftInternal(uint64(l))
}
if m.Alarm != nil {
l = m.Alarm.Size()
n += 1 + l + sovRaftInternal(uint64(l))
@ -776,6 +791,39 @@ func (m *InternalRaftRequest) Unmarshal(data []byte) error {
}
iNdEx = postIndex
case 14:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleAdd", 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.AuthRoleAdd == nil {
m.AuthRoleAdd = &AuthRoleAddRequest{}
}
if err := m.AuthRoleAdd.Unmarshal(data[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 15:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType)
}

View File

@ -29,8 +29,9 @@ message InternalRaftRequest {
AuthUserAddRequest auth_user_add = 11;
AuthUserDeleteRequest auth_user_delete = 12;
AuthUserChangePasswordRequest auth_user_change_password = 13;
AuthRoleAddRequest auth_role_add = 14;
AlarmRequest alarm = 14;
AlarmRequest alarm = 15;
}
message EmptyResponse {

View File

@ -1341,6 +1341,7 @@ func (m *AuthUserRevokeRequest) String() string { return proto.CompactTextString
func (*AuthUserRevokeRequest) ProtoMessage() {}
type AuthRoleAddRequest struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
func (m *AuthRoleAddRequest) Reset() { *m = AuthRoleAddRequest{} }
@ -4664,6 +4665,12 @@ func (m *AuthRoleAddRequest) 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)
}
return i, nil
}
@ -5934,6 +5941,10 @@ func (m *AuthUserRevokeRequest) Size() (n int) {
func (m *AuthRoleAddRequest) Size() (n int) {
var l int
_ = l
l = len(m.Name)
if l > 0 {
n += 1 + l + sovRpc(uint64(l))
}
return n
}
@ -11314,6 +11325,35 @@ func (m *AuthRoleAddRequest) Unmarshal(data []byte) error {
return fmt.Errorf("proto: AuthRoleAddRequest: 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
default:
iNdEx = preIndex
skippy, err := skipRpc(data[iNdEx:])

View File

@ -515,6 +515,7 @@ message AuthUserRevokeRequest {
}
message AuthRoleAddRequest {
string name = 1;
}
message AuthRoleGetRequest {