Skip to content

Commit e04e012

Browse files
committed
Added partialSuccessLimit argument to ClientAuthentication ctor.
1 parent 69fb3be commit e04e012

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/Renci.SshNet/ClientAuthentication.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,34 @@ namespace Renci.SshNet
66
{
77
internal class ClientAuthentication : IClientAuthentication
88
{
9+
private readonly int _partialSuccessLimit;
10+
11+
/// <summary>
12+
/// Initializes a new <see cref="ClientAuthentication"/> instance.
13+
/// </summary>
14+
/// <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>
15+
/// <exception cref="ArgumentOutOfRangeException"><paramref name="partialSuccessLimit"/> is less than one.</exception>
16+
public ClientAuthentication(int partialSuccessLimit)
17+
{
18+
if (partialSuccessLimit < 1)
19+
throw new ArgumentOutOfRangeException("partialSuccessLimit", "Cannot be less than one.");
20+
21+
_partialSuccessLimit = partialSuccessLimit;
22+
}
23+
24+
/// <summary>
25+
/// Gets the number of times an authentication attempt with any given <see cref="IAuthenticationMethod"/> can
26+
/// result in <see cref="AuthenticationResult.PartialSuccess"/> before it is disregarded.
27+
/// </summary>
28+
/// <value>
29+
/// The number of times an authentication attempt with any given <see cref="IAuthenticationMethod"/> can result
30+
/// in <see cref="AuthenticationResult.PartialSuccess"/> before it is disregarded.
31+
/// </value>
32+
internal int PartialSuccessLimit
33+
{
34+
get { return _partialSuccessLimit; }
35+
}
36+
937
public void Authenticate(IConnectionInfoInternal connectionInfo, ISession session)
1038
{
1139
if (connectionInfo == null)

0 commit comments

Comments
 (0)