示例#1
0
 /// <summary>
 /// UserChangePasswordAsync changes the password of a specified user in async
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The response received from the server.</returns>
 public async Task <AuthUserChangePasswordResponse> UserChangePasswordAsync(AuthUserChangePasswordRequest request,
                                                                            Grpc.Core.Metadata headers          = null, DateTime?deadline = null,
                                                                            CancellationToken cancellationToken = default)
 {
     return(await CallEtcdAsync(async (connection) => await connection._authClient
                                .UserChangePasswordAsync(request, headers, deadline, cancellationToken)).ConfigureAwait(false));
 }
示例#2
0
 /// <summary>
 /// UserChangePassword changes the password of a specified user
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The response received from the server.</returns>
 public AuthUserChangePasswordResponse UserChangePassword(AuthUserChangePasswordRequest request,
                                                          Grpc.Core.Metadata headers          = null, DateTime?deadline = null,
                                                          CancellationToken cancellationToken = default)
 {
     return(CallEtcd((connection) => connection._authClient
                     .UserChangePassword(request, headers, deadline, cancellationToken)));
 }
示例#3
0
        /// <summary>
        /// UserChangePasswordAsync changes the password of a specified user in async
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <AuthUserChangePasswordResponse> UserChangePasswordAsync(AuthUserChangePasswordRequest request, Metadata headers = null)
        {
            AuthUserChangePasswordResponse response = new AuthUserChangePasswordResponse();
            bool success    = false;
            int  retryCount = 0;

            while (!success)
            {
                try
                {
                    response = await _balancer.GetConnection().authClient.UserChangePasswordAsync(request, headers);

                    success = true;
                }
                catch (RpcException ex) when(ex.StatusCode == StatusCode.Unavailable)
                {
                    retryCount++;
                    if (retryCount >= _balancer._numNodes)
                    {
                        throw ex;
                    }
                }
            }
            return(response);
        }
示例#4
0
        /// <summary>
        /// UserChangePasswordAsync changes the password of a specified user in async
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <AuthUserChangePasswordResponse> UserChangePasswordAsync(AuthUserChangePasswordRequest request, Metadata headers = null)
        {
            AuthUserChangePasswordResponse response = new AuthUserChangePasswordResponse();

            response = await _balancer.GetConnection().authClient.UserChangePasswordAsync(request, headers);

            return(response);
        }
示例#5
0
        /// <summary>
        /// UserChangePassword changes the password of a specified user
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public AuthUserChangePasswordResponse UserChangePassword(AuthUserChangePasswordRequest request, Metadata headers = null)
        {
            AuthUserChangePasswordResponse response = new AuthUserChangePasswordResponse();

            response = _balancer.GetConnection().authClient.UserChangePassword(request, headers);

            return(response);
        }
示例#6
0
        /// <summary>
        /// UserChangePasswordAsync changes the password of a specified user in async
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <AuthUserChangePasswordResponse> UserChangePasswordAsync(AuthUserChangePasswordRequest request)
        {
            AuthUserChangePasswordResponse response = new AuthUserChangePasswordResponse();

            try
            {
                response = await _authClient.UserChangePasswordAsync(request, _headers);
            }
            catch (RpcException ex)
            {
                ResetConnection(ex);
                throw;
            }
            catch
            {
                throw;
            }
            return(response);
        }
示例#7
0
        /// <summary>
        /// UserChangePassword changes the password of a specified user
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public AuthUserChangePasswordResponse UserChangePassword(AuthUserChangePasswordRequest request)
        {
            AuthUserChangePasswordResponse response = new AuthUserChangePasswordResponse();

            try
            {
                response = _authClient.UserChangePassword(request, _headers);
            }
            catch (RpcException ex)
            {
                ResetConnection(ex);
                throw;
            }
            catch
            {
                throw;
            }
            return(response);
        }