-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHydrantIdCAPluginConfig.cs
More file actions
112 lines (103 loc) · 4.31 KB
/
Copy pathHydrantIdCAPluginConfig.cs
File metadata and controls
112 lines (103 loc) · 4.31 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
101
102
103
104
105
106
107
108
109
110
111
112
/*
Copyright © 2025 Keyfactor
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
using Keyfactor.AnyGateway.Extensions;
using System.Collections.Generic;
namespace Keyfactor.Extensions.CAPlugin.HydrantId
{
public class HydrantIdCAPluginConfig
{
public const int DefaultPageSize = 100;
public class ConfigConstants
{
public static string HydrantIdBaseUrl = "HydrantIdBaseUrl";
public static string HydrantIdAuthId = "HydrantIdAuthId";
public static string HydrantIdAuthKey = "HydrantIdAuthKey";
public static string DefaultPageSize = "DefaultPageSize";
public static string Enabled = "Enabled";
}
public class Config
{
public string HydrantIdBaseUrl { get; set; }
public string HydrantIdAuthId { get; set; }
public string HydrantIdAuthKey { get; set; }
public bool Enabled { get; set; }
}
public static class EnrollmentParametersConstants
{
public const string ValidityPeriod = "ValidityPeriod";
public const string ValidityUnits = "ValidityUnits";
public const string RenewalDays = "RenewalDays";
}
public static Dictionary<string, PropertyConfigInfo> GetPluginAnnotations()
{
return new Dictionary<string, PropertyConfigInfo>()
{
[ConfigConstants.HydrantIdBaseUrl] = new PropertyConfigInfo()
{
Comments = "The Base URL For the HydrantId Endpoint similar to https://acm-stage.hydrantid.com. Get this from HydrantId.",
Hidden = false,
DefaultValue = "",
Type = "String"
},
[ConfigConstants.HydrantIdAuthId] = new PropertyConfigInfo()
{
Comments = "The AuthId Obtained from HydrantId.",
Hidden = true,
DefaultValue = "",
Type = "Secret"
},
[ConfigConstants.HydrantIdAuthKey] = new PropertyConfigInfo()
{
Comments = "The AuthKey Obtained from HydrantId.",
Hidden = true,
DefaultValue = "",
Type = "Secret"
},
[ConfigConstants.Enabled] = new PropertyConfigInfo()
{
Comments = "Flag to Enable or Disable the CA connector.",
Hidden = false,
DefaultValue = true,
Type = "Bool"
}
};
}
public static Dictionary<string, PropertyConfigInfo> GetTemplateParameterAnnotations()
{
return new Dictionary<string, PropertyConfigInfo>()
{
[EnrollmentParametersConstants.ValidityPeriod] = new PropertyConfigInfo()
{
Comments = $"The desired lifetime time period could be Days, Months or Years.",
Hidden = false,
DefaultValue = "Years",
Type = "String"
},
[EnrollmentParametersConstants.ValidityUnits] = new PropertyConfigInfo()
{
Comments = $"The desired lifetime time value some number indicating days, months or years.",
Hidden = false,
DefaultValue = 1,
Type = "Number"
},
[EnrollmentParametersConstants.RenewalDays] = new PropertyConfigInfo()
{
Comments = $"The window that determines whether it is a renewal vs a re-issue.",
Hidden = false,
DefaultValue = 30,
Type = "Number"
}
};
}
}
}