Added partialSuccessLimit argument to ClientAuthentication ctor.

This commit is contained in:
Gert Driesen
2017-10-02 22:10:20 +02:00
parent 69fb3be4fa
commit e04e0129cd
+28
View File
@@ -6,6 +6,34 @@ namespace Renci.SshNet
{
internal class ClientAuthentication : IClientAuthentication
{
private readonly int _partialSuccessLimit;
/// <summary>
/// Initializes a new <see cref="ClientAuthentication"/> instance.
/// </summary>
/// <param name="partialSuccessLimit">The number of times an authentication attempt with any given <see cref="IAuthenticationMethod"/> can result in <see cref="AuthenticationResult.PartialSuccess"/> before it is disregarded.</param>
/// <exception cref="ArgumentOutOfRangeException"><paramref name="partialSuccessLimit"/> is less than one.</exception>
public ClientAuthentication(int partialSuccessLimit)
{
if (partialSuccessLimit < 1)
throw new ArgumentOutOfRangeException("partialSuccessLimit", "Cannot be less than one.");
_partialSuccessLimit = partialSuccessLimit;
}
/// <summary>
/// Gets the number of times an authentication attempt with any given <see cref="IAuthenticationMethod"/> can
/// result in <see cref="AuthenticationResult.PartialSuccess"/> before it is disregarded.
/// </summary>
/// <value>
/// The number of times an authentication attempt with any given <see cref="IAuthenticationMethod"/> can result
/// in <see cref="AuthenticationResult.PartialSuccess"/> before it is disregarded.
/// </value>
internal int PartialSuccessLimit
{
get { return _partialSuccessLimit; }
}
public void Authenticate(IConnectionInfoInternal connectionInfo, ISession session)
{
if (connectionInfo == null)