-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathISaslServerSide.cs
More file actions
100 lines (87 loc) · 2.08 KB
/
ISaslServerSide.cs
File metadata and controls
100 lines (87 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
using System.Threading.Tasks;
using Waher.Persistence;
namespace Waher.Networking.SASL
{
/// <summary>
/// Interface for server-side client connections.
/// </summary>
public interface ISaslServerSide
{
/// <summary>
/// ID client claims to have
/// </summary>
string AuthId
{
get;
}
/// <summary>
/// User name
/// </summary>
CaseInsensitiveString UserName
{
get;
}
/// <summary>
/// Remote endpoint.
/// </summary>
string RemoteEndPoint
{
get;
}
/// <summary>
/// String representing protocol being used.
/// </summary>
string Protocol
{
get;
}
/// <summary>
/// Object tagged to the connection.
/// </summary>
object Tag
{
get;
set;
}
/// <summary>
/// Sets the account for the connection.
/// </summary>
/// <param name="Account">Account.</param>
Task SetAccount(IAccount Account);
/// <summary>
/// Resets the state machine.
/// </summary>
/// <param name="Authenticated">If the client is authenticated.</param>
void ResetState(bool Authenticated);
/// <summary>
/// Sets the identity of the user.
/// </summary>
/// <param name="UserName">Name of user.</param>
void SetUserIdentity(CaseInsensitiveString UserName);
/// <summary>
/// Reports the SASL error: Not Authorized
/// </summary>
/// <returns>If transmitted.</returns>
Task<bool> SaslErrorNotAuthorized();
/// <summary>
/// Reports the SASL error: Account disabled
/// </summary>
/// <returns>If transmitted.</returns>
Task<bool> SaslErrorAccountDisabled();
/// <summary>
/// Reports the SASL error: Malformed request
/// </summary>
/// <returns>If transmitted.</returns>
Task<bool> SaslErrorMalformedRequest();
/// <summary>
/// Returns a challenge to the client.
/// </summary>
/// <param name="ChallengeBase64">Base64-encoded challenge.</param>
Task<bool> SaslChallenge(string ChallengeBase64);
/// <summary>
/// Returns a sucess response to the client.
/// </summary>
/// <param name="ProofBase64">Optional base64-encoded proof.</param>
Task<bool> SaslSuccess(string ProofBase64);
}
}