/
AppIdAuthenticationInfo.cs
80 lines (73 loc) · 2.76 KB
/
AppIdAuthenticationInfo.cs
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
using System;
using VaultSharp.Infrastructure.Validation;
namespace VaultSharp.Backends.Authentication.Models.AppId
{
/// <summary>
/// Represents the login information for the AppId Authentication backend.
/// </summary>
[Obsolete("The AppId Authentication backend in Vault is now deprecated with the addition " +
"of the new AppRole backend. There are no plans to remove it, but we encourage " +
"using AppRole whenever possible, as it offers enhanced functionality " +
"and can accommodate many more types of authentication paradigms.")]
public class AppIdAuthenticationInfo : IAuthenticationInfo
{
/// <summary>
/// Gets the type of the authentication backend.
/// </summary>
/// <value>
/// The type of the authentication backend.
/// </value>
public AuthenticationBackendType AuthenticationBackendType
{
get
{
return AuthenticationBackendType.AppId;
}
}
/// <summary>
/// Gets the mount point.
/// Presence or absence of leading or trailing slashes don't matter.
/// </summary>
/// <value>
/// The mount point.
/// </value>
public string MountPoint { get; }
/// <summary>
/// Gets the application identifier.
/// </summary>
/// <value>
/// The application identifier.
/// </value>
public string AppId { get; }
/// <summary>
/// Gets the user identifier.
/// </summary>
/// <value>
/// The user identifier.
/// </value>
public string UserId { get; }
/// <summary>
/// Initializes a new instance of the <see cref="AppIdAuthenticationInfo" /> class.
/// </summary>
/// <param name="appId">The application identifier.</param>
/// <param name="userId">The user identifier.</param>
public AppIdAuthenticationInfo(string appId, string userId) : this(AuthenticationBackendType.AppId.Type, appId, userId)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="AppIdAuthenticationInfo"/> class.
/// </summary>
/// <param name="mountPoint">The mount point.</param>
/// <param name="appId">The application identifier.</param>
/// <param name="userId">The user identifier.</param>
public AppIdAuthenticationInfo(string mountPoint, string appId, string userId)
{
Checker.NotNull(mountPoint, "mountPoint");
Checker.NotNull(appId, "appId");
Checker.NotNull(userId, "userId");
MountPoint = mountPoint;
AppId = appId;
UserId = userId;
}
}
}