commit
935999a80e
|
@ -55,9 +55,8 @@ func (x Permission_Type) String() string {
|
||||||
|
|
||||||
// User is a single entry in the bucket authUsers
|
// User is a single entry in the bucket authUsers
|
||||||
type User struct {
|
type User struct {
|
||||||
Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||||
Password []byte `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
|
Password []byte `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
|
||||||
Tombstone int64 `protobuf:"varint,3,opt,name=tombstone,proto3" json:"tombstone,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *User) Reset() { *m = User{} }
|
func (m *User) Reset() { *m = User{} }
|
||||||
|
@ -121,11 +120,6 @@ func (m *User) MarshalTo(data []byte) (int, error) {
|
||||||
i += copy(data[i:], m.Password)
|
i += copy(data[i:], m.Password)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if m.Tombstone != 0 {
|
|
||||||
data[i] = 0x18
|
|
||||||
i++
|
|
||||||
i = encodeVarintAuth(data, i, uint64(m.Tombstone))
|
|
||||||
}
|
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,9 +234,6 @@ func (m *User) Size() (n int) {
|
||||||
n += 1 + l + sovAuth(uint64(l))
|
n += 1 + l + sovAuth(uint64(l))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if m.Tombstone != 0 {
|
|
||||||
n += 1 + sovAuth(uint64(m.Tombstone))
|
|
||||||
}
|
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,25 +374,6 @@ func (m *User) Unmarshal(data []byte) error {
|
||||||
m.Password = []byte{}
|
m.Password = []byte{}
|
||||||
}
|
}
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 3:
|
|
||||||
if wireType != 0 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Tombstone", wireType)
|
|
||||||
}
|
|
||||||
m.Tombstone = 0
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowAuth
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := data[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
m.Tombstone |= (int64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := skipAuth(data[iNdEx:])
|
skippy, err := skipAuth(data[iNdEx:])
|
||||||
|
|
|
@ -13,7 +13,6 @@ option (gogoproto.goproto_enum_prefix_all) = false;
|
||||||
message User {
|
message User {
|
||||||
bytes name = 1;
|
bytes name = 1;
|
||||||
bytes password = 2;
|
bytes password = 2;
|
||||||
int64 tombstone = 3;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Permission is a single entity
|
// Permission is a single entity
|
||||||
|
|
|
@ -27,12 +27,12 @@ func NewAuthCommand() *cobra.Command {
|
||||||
Short: "Enable or disable authentication.",
|
Short: "Enable or disable authentication.",
|
||||||
}
|
}
|
||||||
|
|
||||||
ac.AddCommand(NewAuthEnableCommand())
|
ac.AddCommand(newAuthEnableCommand())
|
||||||
|
|
||||||
return ac
|
return ac
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewAuthEnableCommand() *cobra.Command {
|
func newAuthEnableCommand() *cobra.Command {
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "enable",
|
Use: "enable",
|
||||||
Short: "enable authentication",
|
Short: "enable authentication",
|
||||||
|
|
|
@ -30,9 +30,9 @@ func NewUserCommand() *cobra.Command {
|
||||||
Short: "user related command",
|
Short: "user related command",
|
||||||
}
|
}
|
||||||
|
|
||||||
ac.AddCommand(NewUserAddCommand())
|
ac.AddCommand(newUserAddCommand())
|
||||||
ac.AddCommand(NewUserDeleteCommand())
|
ac.AddCommand(newUserDeleteCommand())
|
||||||
ac.AddCommand(NewUserChangePasswordCommand())
|
ac.AddCommand(newUserChangePasswordCommand())
|
||||||
|
|
||||||
return ac
|
return ac
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ var (
|
||||||
passwordInteractive bool
|
passwordInteractive bool
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewUserAddCommand() *cobra.Command {
|
func newUserAddCommand() *cobra.Command {
|
||||||
cmd := cobra.Command{
|
cmd := cobra.Command{
|
||||||
Use: "add <user name>",
|
Use: "add <user name>",
|
||||||
Short: "add a new user",
|
Short: "add a new user",
|
||||||
|
@ -53,7 +53,7 @@ func NewUserAddCommand() *cobra.Command {
|
||||||
return &cmd
|
return &cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewUserDeleteCommand() *cobra.Command {
|
func newUserDeleteCommand() *cobra.Command {
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "delete <user name>",
|
Use: "delete <user name>",
|
||||||
Short: "delete a user",
|
Short: "delete a user",
|
||||||
|
@ -61,7 +61,7 @@ func NewUserDeleteCommand() *cobra.Command {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewUserChangePasswordCommand() *cobra.Command {
|
func newUserChangePasswordCommand() *cobra.Command {
|
||||||
cmd := cobra.Command{
|
cmd := cobra.Command{
|
||||||
Use: "passwd <user name>",
|
Use: "passwd <user name>",
|
||||||
Short: "change password of user",
|
Short: "change password of user",
|
||||||
|
|
Loading…
Reference in New Issue