*: add a new API and command for checking auth status (#11536)

This changes have started at etcdctl under auth.go, and make changes to stub out everything down into the internal raft.  Made changes to the .proto files and regenerated them so that the local version would build successfully.
release-3.5
Vern Burton 2020-02-05 21:27:42 -06:00 committed by GitHub
parent 74d5ba5777
commit 071e70cdc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 1013 additions and 465 deletions

View File

@ -100,6 +100,7 @@ Note that any `etcd_debugging_*` metrics are experimental and subject to change.
- Fix [`etcdctl member add`](https://github.com/etcd-io/etcd/pull/11194) command to prevent potential timeout.
- Add [`etcdctl watch --progress-notify`](https://github.com/etcd-io/etcd/pull/11462) flag.
- Add [`etcdctl auth status`](https://github.com/etcd-io/etcd/pull/11536) command to check if authentication is enabled
### gRPC gateway
@ -112,6 +113,10 @@ Note that any `etcd_debugging_*` metrics are experimental and subject to change.
- Fix [NoPassword check when adding user through GRPC gateway](https://github.com/etcd-io/etcd/pull/11418) ([issue#11414](https://github.com/etcd-io/etcd/issues/11414))
- Fix bug where [some auth related messages are logged at wrong level](https://github.com/etcd-io/etcd/pull/11586)
### API
- Add [`/v3/auth/status`](https://github.com/etcd-io/etcd/pull/11536) endpoint to check if authentication is enabled
### Dependency
- Upgrade [`google.golang.org/grpc`](https://github.com/grpc/grpc-go/releases) from [**`v1.23.0`**](https://github.com/grpc/grpc-go/releases/tag/v1.23.0) to [**`v1.26.0`**](https://github.com/grpc/grpc-go/releases/tag/v1.26.0).

View File

@ -10,6 +10,7 @@ This is a generated documentation. Please read the proto files for more.
| ------ | ------------ | ------------- | ----------- |
| AuthEnable | AuthEnableRequest | AuthEnableResponse | AuthEnable enables authentication. |
| AuthDisable | AuthDisableRequest | AuthDisableResponse | AuthDisable disables authentication. |
| AuthStatus | AuthStatusRequest | AuthStatusResponse | AuthStatus displays authentication status. |
| Authenticate | AuthenticateRequest | AuthenticateResponse | Authenticate processes an authenticate request. |
| UserAdd | AuthUserAddRequest | AuthUserAddResponse | UserAdd adds a new user. User name cannot be empty. |
| UserGet | AuthUserGetRequest | AuthUserGetResponse | UserGet gets detailed user information. |
@ -240,6 +241,21 @@ Empty field.
##### message `AuthStatusRequest` (etcdserver/etcdserverpb/rpc.proto)
Empty field.
##### message `AuthStatusResponse` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| enabled | | bool |
##### message `AuthUserAddRequest` (etcdserver/etcdserverpb/rpc.proto)
| Field | Description | Type |

View File

@ -5,10 +5,6 @@
"produces": [
"application/json"
],
"schemes": [
"http",
"https"
],
"swagger": "2.0",
"info": {
"title": "etcdserver/etcdserverpb/rpc.proto",
@ -258,6 +254,33 @@
}
}
},
"/v3/auth/status": {
"post": {
"tags": [
"Auth"
],
"summary": "AuthStatus displays authentication status.",
"operationId": "AuthStatus",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/etcdserverpbAuthStatusRequest"
}
}
],
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/etcdserverpbAuthStatusResponse"
}
}
}
}
},
"/v3/auth/user/add": {
"post": {
"tags": [
@ -847,7 +870,16 @@
"200": {
"description": "A successful response.(streaming responses)",
"schema": {
"$ref": "#/x-stream-definitions/etcdserverpbLeaseKeepAliveResponse"
"type": "object",
"title": "Stream result of etcdserverpbLeaseKeepAliveResponse",
"properties": {
"error": {
"$ref": "#/definitions/runtimeStreamError"
},
"result": {
"$ref": "#/definitions/etcdserverpbLeaseKeepAliveResponse"
}
}
}
}
}
@ -1036,7 +1068,16 @@
"200": {
"description": "A successful response.(streaming responses)",
"schema": {
"$ref": "#/x-stream-definitions/etcdserverpbSnapshotResponse"
"type": "object",
"title": "Stream result of etcdserverpbSnapshotResponse",
"properties": {
"error": {
"$ref": "#/definitions/runtimeStreamError"
},
"result": {
"$ref": "#/definitions/etcdserverpbSnapshotResponse"
}
}
}
}
}
@ -1118,7 +1159,16 @@
"200": {
"description": "A successful response.(streaming responses)",
"schema": {
"$ref": "#/x-stream-definitions/etcdserverpbWatchResponse"
"type": "object",
"title": "Stream result of etcdserverpbWatchResponse",
"properties": {
"error": {
"$ref": "#/definitions/runtimeStreamError"
},
"result": {
"$ref": "#/definitions/etcdserverpbWatchResponse"
}
}
}
}
}
@ -1423,6 +1473,21 @@
}
}
},
"etcdserverpbAuthStatusRequest": {
"type": "object"
},
"etcdserverpbAuthStatusResponse": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"format": "boolean"
},
"header": {
"$ref": "#/definitions/etcdserverpbResponseHeader"
}
}
},
"etcdserverpbAuthUserAddRequest": {
"type": "object",
"properties": {
@ -2637,43 +2702,5 @@
{
"ApiKey": []
}
],
"x-stream-definitions": {
"etcdserverpbLeaseKeepAliveResponse": {
"properties": {
"error": {
"$ref": "#/definitions/runtimeStreamError"
},
"result": {
"$ref": "#/definitions/etcdserverpbLeaseKeepAliveResponse"
}
},
"title": "Stream result of etcdserverpbLeaseKeepAliveResponse",
"type": "object"
},
"etcdserverpbSnapshotResponse": {
"properties": {
"error": {
"$ref": "#/definitions/runtimeStreamError"
},
"result": {
"$ref": "#/definitions/etcdserverpbSnapshotResponse"
}
},
"title": "Stream result of etcdserverpbSnapshotResponse",
"type": "object"
},
"etcdserverpbWatchResponse": {
"properties": {
"error": {
"$ref": "#/definitions/runtimeStreamError"
},
"result": {
"$ref": "#/definitions/etcdserverpbWatchResponse"
}
},
"title": "Stream result of etcdserverpbWatchResponse",
"type": "object"
}
}
]
}

View File

@ -4,10 +4,6 @@
"title": "etcdserver/api/v3election/v3electionpb/v3election.proto",
"version": "version not set"
},
"schemes": [
"http",
"https"
],
"consumes": [
"application/json"
],
@ -77,7 +73,16 @@
"200": {
"description": "A successful response.(streaming responses)",
"schema": {
"$ref": "#/x-stream-definitions/v3electionpbLeaderResponse"
"type": "object",
"properties": {
"result": {
"$ref": "#/definitions/v3electionpbLeaderResponse"
},
"error": {
"$ref": "#/definitions/runtimeStreamError"
}
},
"title": "Stream result of v3electionpbLeaderResponse"
}
}
},
@ -367,19 +372,5 @@
}
}
}
},
"x-stream-definitions": {
"v3electionpbLeaderResponse": {
"type": "object",
"properties": {
"result": {
"$ref": "#/definitions/v3electionpbLeaderResponse"
},
"error": {
"$ref": "#/definitions/runtimeStreamError"
}
},
"title": "Stream result of v3electionpbLeaderResponse"
}
}
}

View File

@ -4,10 +4,6 @@
"title": "etcdserver/api/v3lock/v3lockpb/v3lock.proto",
"version": "version not set"
},
"schemes": [
"http",
"https"
],
"consumes": [
"application/json"
],

View File

@ -621,6 +621,30 @@ func TestAuthDisable(t *testing.T) {
}
}
func TestIsAuthEnabled(t *testing.T) {
as, tearDown := setupAuthStore(t)
defer tearDown(t)
// enable authentication to test the first possible condition
as.AuthEnable()
status := as.IsAuthEnabled()
ctx := context.WithValue(context.WithValue(context.TODO(), AuthenticateParamIndex{}, uint64(2)), AuthenticateParamSimpleTokenPrefix{}, "dummy")
_, _ = as.Authenticate(ctx, "foo", "bar")
if status != true {
t.Errorf("expected %v, got %v", true, false)
}
// Disabling disabled auth to test the other condition that can be return
as.AuthDisable()
status = as.IsAuthEnabled()
_, _ = as.Authenticate(ctx, "foo", "bar")
if status != false {
t.Errorf("expected %v, got %v", false, true)
}
}
// TestAuthRevisionRace ensures that access to authStore.revision is thread-safe.
func TestAuthInfoFromCtxRace(t *testing.T) {
b, tPath := backend.NewDefaultTmpBackend()

View File

@ -27,6 +27,7 @@ import (
type (
AuthEnableResponse pb.AuthEnableResponse
AuthDisableResponse pb.AuthDisableResponse
AuthStatusResponse pb.AuthStatusResponse
AuthenticateResponse pb.AuthenticateResponse
AuthUserAddResponse pb.AuthUserAddResponse
AuthUserDeleteResponse pb.AuthUserDeleteResponse
@ -61,6 +62,9 @@ type Auth interface {
// AuthDisable disables auth of an etcd cluster.
AuthDisable(ctx context.Context) (*AuthDisableResponse, error)
// AuthStatus returns the status of auth of an etcd cluster.
AuthStatus(ctx context.Context) (*AuthStatusResponse, error)
// UserAdd adds a new user to an etcd cluster.
UserAdd(ctx context.Context, name string, password string) (*AuthUserAddResponse, error)
@ -127,6 +131,11 @@ func (auth *authClient) AuthDisable(ctx context.Context) (*AuthDisableResponse,
return (*AuthDisableResponse)(resp), toErr(ctx, err)
}
func (auth *authClient) AuthStatus(ctx context.Context) (*AuthStatusResponse, error) {
resp, err := auth.remote.AuthStatus(ctx, &pb.AuthStatusRequest{}, auth.callOpts...)
return (*AuthStatusResponse)(resp), toErr(ctx, err)
}
func (auth *authClient) UserAdd(ctx context.Context, name string, password string) (*AuthUserAddResponse, error) {
resp, err := auth.remote.UserAdd(ctx, &pb.AuthUserAddRequest{Name: name, Password: password, Options: &authpb.UserAddOptions{NoPassword: false}}, auth.callOpts...)
return (*AuthUserAddResponse)(resp), toErr(ctx, err)

View File

@ -257,6 +257,10 @@ func (rac *retryAuthClient) AuthDisable(ctx context.Context, in *pb.AuthDisableR
return rac.ac.AuthDisable(ctx, in, opts...)
}
func (rac *retryAuthClient) AuthStatus(ctx context.Context, in *pb.AuthStatusRequest, opts ...grpc.CallOption) (resp *pb.AuthStatusResponse, err error) {
return rac.ac.AuthStatus(ctx, in, opts...)
}
func (rac *retryAuthClient) UserAdd(ctx context.Context, in *pb.AuthUserAddRequest, opts ...grpc.CallOption) (resp *pb.AuthUserAddResponse, err error) {
return rac.ac.UserAdd(ctx, in, opts...)
}

View File

@ -30,10 +30,35 @@ func NewAuthCommand() *cobra.Command {
ac.AddCommand(newAuthEnableCommand())
ac.AddCommand(newAuthDisableCommand())
ac.AddCommand(newAuthStatusCommand())
return ac
}
func newAuthStatusCommand() *cobra.Command {
return &cobra.Command{
Use: "status",
Short: "Returns authentication status",
Run: authStatusCommandFunc,
}
}
// authStatusCommandFunc executes the "auth status" command.
func authStatusCommandFunc(cmd *cobra.Command, args []string) {
if len(args) != 0 {
ExitWithError(ExitBadArgs, fmt.Errorf("auth status command does not accept any arguments"))
}
ctx, cancel := commandCtx(cmd)
result, err := mustClientFromCmd(cmd).Auth.AuthStatus(ctx)
cancel()
if err != nil {
ExitWithError(ExitError, err)
}
fmt.Println("Authentication Status:", result.Enabled)
}
func newAuthEnableCommand() *cobra.Command {
return &cobra.Command{
Use: "enable",

View File

@ -45,6 +45,14 @@ func (as *AuthServer) AuthDisable(ctx context.Context, r *pb.AuthDisableRequest)
return resp, nil
}
func (as *AuthServer) AuthStatus(ctx context.Context, r *pb.AuthStatusRequest) (*pb.AuthStatusResponse, error) {
resp, err := as.authenticator.AuthStatus(ctx, r)
if err != nil {
return nil, togRPCError(err)
}
return resp, nil
}
func (as *AuthServer) Authenticate(ctx context.Context, r *pb.AuthenticateRequest) (*pb.AuthenticateResponse, error) {
resp, err := as.authenticator.Authenticate(ctx, r)
if err != nil {

View File

@ -78,6 +78,7 @@ type applierV3 interface {
AuthEnable() (*pb.AuthEnableResponse, error)
AuthDisable() (*pb.AuthDisableResponse, error)
AuthStatus() (*pb.AuthStatusResponse, error)
UserAdd(ua *pb.AuthUserAddRequest) (*pb.AuthUserAddResponse, error)
UserDelete(ua *pb.AuthUserDeleteRequest) (*pb.AuthUserDeleteResponse, error)
@ -159,6 +160,8 @@ func (a *applierV3backend) Apply(r *pb.InternalRaftRequest) *applyResult {
ar.resp, ar.err = a.s.applyV3.AuthEnable()
case r.AuthDisable != nil:
ar.resp, ar.err = a.s.applyV3.AuthDisable()
case r.AuthStatus != nil:
ar.resp, ar.err = a.s.applyV3.AuthStatus()
case r.AuthUserAdd != nil:
ar.resp, ar.err = a.s.applyV3.UserAdd(r.AuthUserAdd)
case r.AuthUserDelete != nil:
@ -739,6 +742,11 @@ func (a *applierV3backend) AuthDisable() (*pb.AuthDisableResponse, error) {
return &pb.AuthDisableResponse{Header: newHeader(a.s)}, nil
}
func (a *applierV3backend) AuthStatus() (*pb.AuthStatusResponse, error) {
enabled := a.s.AuthStore().IsAuthEnabled()
return &pb.AuthStatusResponse{Header: newHeader(a.s), Enabled: enabled}, nil
}
func (a *applierV3backend) Authenticate(r *pb.InternalAuthenticateRequest) (*pb.AuthenticateResponse, error) {
ctx := context.WithValue(context.WithValue(a.s.ctx, auth.AuthenticateParamIndex{}, a.s.consistIndex.ConsistentIndex()), auth.AuthenticateParamSimpleTokenPrefix{}, r.SimpleToken)
resp, err := a.s.AuthStore().Authenticate(ctx, r.Name, r.Password)

View File

@ -216,6 +216,8 @@ func needAdminPermission(r *pb.InternalRaftRequest) bool {
return true
case r.AuthDisable != nil:
return true
case r.AuthStatus != nil:
return true
case r.AuthUserAdd != nil:
return true
case r.AuthUserDelete != nil:

View File

@ -77,6 +77,7 @@
StatusResponse
AuthEnableRequest
AuthDisableRequest
AuthStatusRequest
AuthenticateRequest
AuthUserAddRequest
AuthUserGetRequest
@ -93,6 +94,7 @@
AuthRoleRevokePermissionRequest
AuthEnableResponse
AuthDisableResponse
AuthStatusResponse
AuthenticateResponse
AuthUserAddResponse
AuthUserGetResponse

View File

@ -479,6 +479,19 @@ func request_Auth_AuthDisable_0(ctx context.Context, marshaler runtime.Marshaler
}
func request_Auth_AuthStatus_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq etcdserverpb.AuthStatusRequest
var metadata runtime.ServerMetadata
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.AuthStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_Auth_Authenticate_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq etcdserverpb.AuthenticateRequest
var metadata runtime.ServerMetadata
@ -1840,6 +1853,35 @@ func RegisterAuthHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien
})
mux.Handle("POST", pattern_Auth_AuthStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
if cn, ok := w.(http.CloseNotifier); ok {
go func(done <-chan struct{}, closed <-chan bool) {
select {
case <-done:
case <-closed:
cancel()
}
}(ctx.Done(), cn.CloseNotify())
}
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Auth_AuthStatus_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Auth_AuthStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Auth_Authenticate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@ -2254,6 +2296,8 @@ var (
pattern_Auth_AuthDisable_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "auth", "disable"}, ""))
pattern_Auth_AuthStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "auth", "status"}, ""))
pattern_Auth_Authenticate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "auth", "authenticate"}, ""))
pattern_Auth_UserAdd_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "auth", "user", "add"}, ""))
@ -2288,6 +2332,8 @@ var (
forward_Auth_AuthDisable_0 = runtime.ForwardResponseMessage
forward_Auth_AuthStatus_0 = runtime.ForwardResponseMessage
forward_Auth_Authenticate_0 = runtime.ForwardResponseMessage
forward_Auth_UserAdd_0 = runtime.ForwardResponseMessage

View File

@ -52,6 +52,7 @@ type InternalRaftRequest struct {
LeaseCheckpoint *LeaseCheckpointRequest `protobuf:"bytes,11,opt,name=lease_checkpoint,json=leaseCheckpoint" json:"lease_checkpoint,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"`
AuthStatus *AuthStatusRequest `protobuf:"bytes,1013,opt,name=auth_status,json=authStatus" json:"auth_status,omitempty"`
Authenticate *InternalAuthenticateRequest `protobuf:"bytes,1012,opt,name=authenticate" json:"authenticate,omitempty"`
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"`
@ -308,17 +309,29 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
}
i += n14
}
if m.AuthStatus != nil {
dAtA[i] = 0xaa
i++
dAtA[i] = 0x3f
i++
i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthStatus.Size()))
n15, err := m.AuthStatus.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n15
}
if m.AuthUserAdd != nil {
dAtA[i] = 0xe2
i++
dAtA[i] = 0x44
i++
i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserAdd.Size()))
n15, err := m.AuthUserAdd.MarshalTo(dAtA[i:])
n16, err := m.AuthUserAdd.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n15
i += n16
}
if m.AuthUserDelete != nil {
dAtA[i] = 0xea
@ -326,11 +339,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x44
i++
i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserDelete.Size()))
n16, err := m.AuthUserDelete.MarshalTo(dAtA[i:])
n17, err := m.AuthUserDelete.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n16
i += n17
}
if m.AuthUserGet != nil {
dAtA[i] = 0xf2
@ -338,11 +351,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x44
i++
i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserGet.Size()))
n17, err := m.AuthUserGet.MarshalTo(dAtA[i:])
n18, err := m.AuthUserGet.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n17
i += n18
}
if m.AuthUserChangePassword != nil {
dAtA[i] = 0xfa
@ -350,11 +363,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x44
i++
i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserChangePassword.Size()))
n18, err := m.AuthUserChangePassword.MarshalTo(dAtA[i:])
n19, err := m.AuthUserChangePassword.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n18
i += n19
}
if m.AuthUserGrantRole != nil {
dAtA[i] = 0x82
@ -362,11 +375,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x45
i++
i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserGrantRole.Size()))
n19, err := m.AuthUserGrantRole.MarshalTo(dAtA[i:])
n20, err := m.AuthUserGrantRole.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n19
i += n20
}
if m.AuthUserRevokeRole != nil {
dAtA[i] = 0x8a
@ -374,11 +387,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x45
i++
i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserRevokeRole.Size()))
n20, err := m.AuthUserRevokeRole.MarshalTo(dAtA[i:])
n21, err := m.AuthUserRevokeRole.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n20
i += n21
}
if m.AuthUserList != nil {
dAtA[i] = 0x92
@ -386,11 +399,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x45
i++
i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserList.Size()))
n21, err := m.AuthUserList.MarshalTo(dAtA[i:])
n22, err := m.AuthUserList.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n21
i += n22
}
if m.AuthRoleList != nil {
dAtA[i] = 0x9a
@ -398,11 +411,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x45
i++
i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleList.Size()))
n22, err := m.AuthRoleList.MarshalTo(dAtA[i:])
n23, err := m.AuthRoleList.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n22
i += n23
}
if m.AuthRoleAdd != nil {
dAtA[i] = 0x82
@ -410,11 +423,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x4b
i++
i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleAdd.Size()))
n23, err := m.AuthRoleAdd.MarshalTo(dAtA[i:])
n24, err := m.AuthRoleAdd.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n23
i += n24
}
if m.AuthRoleDelete != nil {
dAtA[i] = 0x8a
@ -422,11 +435,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x4b
i++
i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleDelete.Size()))
n24, err := m.AuthRoleDelete.MarshalTo(dAtA[i:])
n25, err := m.AuthRoleDelete.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n24
i += n25
}
if m.AuthRoleGet != nil {
dAtA[i] = 0x92
@ -434,11 +447,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x4b
i++
i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleGet.Size()))
n25, err := m.AuthRoleGet.MarshalTo(dAtA[i:])
n26, err := m.AuthRoleGet.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n25
i += n26
}
if m.AuthRoleGrantPermission != nil {
dAtA[i] = 0x9a
@ -446,11 +459,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x4b
i++
i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleGrantPermission.Size()))
n26, err := m.AuthRoleGrantPermission.MarshalTo(dAtA[i:])
n27, err := m.AuthRoleGrantPermission.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n26
i += n27
}
if m.AuthRoleRevokePermission != nil {
dAtA[i] = 0xa2
@ -458,11 +471,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x4b
i++
i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleRevokePermission.Size()))
n27, err := m.AuthRoleRevokePermission.MarshalTo(dAtA[i:])
n28, err := m.AuthRoleRevokePermission.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n27
i += n28
}
if m.ClusterVersionSet != nil {
dAtA[i] = 0xa2
@ -470,11 +483,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x51
i++
i = encodeVarintRaftInternal(dAtA, i, uint64(m.ClusterVersionSet.Size()))
n28, err := m.ClusterVersionSet.MarshalTo(dAtA[i:])
n29, err := m.ClusterVersionSet.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n28
i += n29
}
if m.ClusterMemberAttrSet != nil {
dAtA[i] = 0xaa
@ -482,11 +495,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x51
i++
i = encodeVarintRaftInternal(dAtA, i, uint64(m.ClusterMemberAttrSet.Size()))
n29, err := m.ClusterMemberAttrSet.MarshalTo(dAtA[i:])
n30, err := m.ClusterMemberAttrSet.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n29
i += n30
}
return i, nil
}
@ -632,6 +645,10 @@ func (m *InternalRaftRequest) Size() (n int) {
l = m.Authenticate.Size()
n += 2 + l + sovRaftInternal(uint64(l))
}
if m.AuthStatus != nil {
l = m.AuthStatus.Size()
n += 2 + l + sovRaftInternal(uint64(l))
}
if m.AuthUserAdd != nil {
l = m.AuthUserAdd.Size()
n += 2 + l + sovRaftInternal(uint64(l))
@ -1359,6 +1376,39 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
case 1013:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field AuthStatus", 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.AuthStatus == nil {
m.AuthStatus = &AuthStatusRequest{}
}
if err := m.AuthStatus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 1100:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field AuthUserAdd", wireType)
@ -2170,66 +2220,67 @@ var (
func init() { proto.RegisterFile("raft_internal.proto", fileDescriptorRaftInternal) }
var fileDescriptorRaftInternal = []byte{
// 961 bytes of a gzipped FileDescriptorProto
// 978 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x96, 0x49, 0x73, 0x1b, 0x45,
0x14, 0xc7, 0x23, 0xc5, 0x71, 0xac, 0x96, 0xed, 0x38, 0x6d, 0x87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, 0xc8, 0x4e, 0x41, 0x5f,
0xa2, 0x9a, 0x5e, 0x4b, 0x6b, 0x0f, 0xa5, 0xf4, 0xce, 0xd6, 0xe3, 0xbf, 0x3a, 0x97, 0x1e, 0x9f,
0x77, 0x1a, 0x4f, 0xce, 0x3b, 0x8d, 0x3f, 0xcf, 0x3b, 0x8d, 0xaf, 0xff, 0xee, 0x5c, 0x1a, 0x2c,
0xa9, 0x2b, 0xdc, 0x9d, 0xa7, 0x01, 0x00, 0x00, 0xff, 0xff, 0x82, 0x70, 0x91, 0x6b, 0x58, 0x0a,
0x00, 0x00,
}

View File

@ -42,6 +42,7 @@ message InternalRaftRequest {
AuthEnableRequest auth_enable = 1000;
AuthDisableRequest auth_disable = 1011;
AuthStatusRequest auth_status = 1013;
InternalAuthenticateRequest authenticate = 1012;

File diff suppressed because it is too large Load Diff

View File

@ -256,6 +256,14 @@ service Auth {
};
}
// AuthStatus displays authentication status.
rpc AuthStatus(AuthStatusRequest) returns (AuthStatusResponse) {
option (google.api.http) = {
post: "/v3/auth/status"
body: "*"
};
}
// Authenticate processes an authenticate request.
rpc Authenticate(AuthenticateRequest) returns (AuthenticateResponse) {
option (google.api.http) = {
@ -1000,6 +1008,9 @@ message AuthEnableRequest {
message AuthDisableRequest {
}
message AuthStatusRequest {
}
message AuthenticateRequest {
string name = 1;
string password = 2;
@ -1079,6 +1090,11 @@ message AuthDisableResponse {
ResponseHeader header = 1;
}
message AuthStatusResponse {
ResponseHeader header = 1;
bool enabled = 2;
}
message AuthenticateResponse {
ResponseHeader header = 1;
// token is an authorized token that can be used in succeeding RPCs

View File

@ -70,6 +70,7 @@ type Lessor interface {
type Authenticator interface {
AuthEnable(ctx context.Context, r *pb.AuthEnableRequest) (*pb.AuthEnableResponse, error)
AuthDisable(ctx context.Context, r *pb.AuthDisableRequest) (*pb.AuthDisableResponse, error)
AuthStatus(ctx context.Context, r *pb.AuthStatusRequest) (*pb.AuthStatusResponse, error)
Authenticate(ctx context.Context, r *pb.AuthenticateRequest) (*pb.AuthenticateResponse, error)
UserAdd(ctx context.Context, r *pb.AuthUserAddRequest) (*pb.AuthUserAddResponse, error)
UserDelete(ctx context.Context, r *pb.AuthUserDeleteRequest) (*pb.AuthUserDeleteResponse, error)
@ -398,6 +399,14 @@ func (s *EtcdServer) AuthDisable(ctx context.Context, r *pb.AuthDisableRequest)
return resp.(*pb.AuthDisableResponse), nil
}
func (s *EtcdServer) AuthStatus(ctx context.Context, r *pb.AuthStatusRequest) (*pb.AuthStatusResponse, error) {
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{AuthStatus: r})
if err != nil {
return nil, err
}
return resp.(*pb.AuthStatusResponse), nil
}
func (s *EtcdServer) Authenticate(ctx context.Context, r *pb.AuthenticateRequest) (*pb.AuthenticateResponse, error) {
if err := s.linearizableReadNotify(ctx); err != nil {
return nil, err

View File

@ -36,6 +36,10 @@ func (s *as2ac) AuthDisable(ctx context.Context, in *pb.AuthDisableRequest, opts
return s.as.AuthDisable(ctx, in)
}
func (s *as2ac) AuthStatus(ctx context.Context, in *pb.AuthStatusRequest, opts ...grpc.CallOption) (*pb.AuthStatusResponse, error) {
return s.as.AuthStatus(ctx, in)
}
func (s *as2ac) Authenticate(ctx context.Context, in *pb.AuthenticateRequest, opts ...grpc.CallOption) (*pb.AuthenticateResponse, error) {
return s.as.Authenticate(ctx, in)
}

View File

@ -39,6 +39,11 @@ func (ap *AuthProxy) AuthDisable(ctx context.Context, r *pb.AuthDisableRequest)
return pb.NewAuthClient(conn).AuthDisable(ctx, r)
}
func (ap *AuthProxy) AuthStatus(ctx context.Context, r *pb.AuthStatusRequest) (*pb.AuthStatusResponse, error) {
conn := ap.client.ActiveConnection()
return pb.NewAuthClient(conn).AuthStatus(ctx, r)
}
func (ap *AuthProxy) Authenticate(ctx context.Context, r *pb.AuthenticateRequest) (*pb.AuthenticateResponse, error) {
conn := ap.client.ActiveConnection()
return pb.NewAuthClient(conn).Authenticate(ctx, r)