Skip to content

Commit b6d1e39

Browse files
checkpoint for v4 Management Cert Support
1 parent e1c8522 commit b6d1e39

File tree

6 files changed

+336
-106
lines changed

6 files changed

+336
-106
lines changed

A10vThunder.sln

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 17
4-
VisualStudioVersion = 17.11.35222.181
5-
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "A10vThunder", "a10vthunder-orchestrator\A10vThunder.csproj", "{0E9426F8-B45E-4266-BB6C-7942D1B6B650}"
7-
EndProject
8-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "A10vThunderTestConsole", "A10vThunderTestConsole\A10vThunderTestConsole.csproj", "{EB627575-4C56-45D3-AC41-C9459D30D37B}"
9-
EndProject
10-
Global
11-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12-
Debug|Any CPU = Debug|Any CPU
13-
Release|Any CPU = Release|Any CPU
14-
EndGlobalSection
15-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16-
{0E9426F8-B45E-4266-BB6C-7942D1B6B650}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17-
{0E9426F8-B45E-4266-BB6C-7942D1B6B650}.Debug|Any CPU.Build.0 = Debug|Any CPU
18-
{0E9426F8-B45E-4266-BB6C-7942D1B6B650}.Release|Any CPU.ActiveCfg = Release|Any CPU
19-
{0E9426F8-B45E-4266-BB6C-7942D1B6B650}.Release|Any CPU.Build.0 = Release|Any CPU
20-
{EB627575-4C56-45D3-AC41-C9459D30D37B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21-
{EB627575-4C56-45D3-AC41-C9459D30D37B}.Debug|Any CPU.Build.0 = Debug|Any CPU
22-
{EB627575-4C56-45D3-AC41-C9459D30D37B}.Release|Any CPU.ActiveCfg = Release|Any CPU
23-
{EB627575-4C56-45D3-AC41-C9459D30D37B}.Release|Any CPU.Build.0 = Release|Any CPU
24-
EndGlobalSection
25-
GlobalSection(SolutionProperties) = preSolution
26-
HideSolutionNode = FALSE
27-
EndGlobalSection
28-
GlobalSection(ExtensibilityGlobals) = postSolution
29-
SolutionGuid = {C9CA0496-DCB2-49B7-9D70-A6B1DACB282F}
30-
EndGlobalSection
31-
EndGlobal
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.11.35222.181
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "A10vThunder", "a10vthunder-orchestrator\A10vThunder.csproj", "{0E9426F8-B45E-4266-BB6C-7942D1B6B650}"
7+
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "A10vThunderTestConsole", "A10vThunderTestConsole\A10vThunderTestConsole.csproj", "{EB627575-4C56-45D3-AC41-C9459D30D37B}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{0E9426F8-B45E-4266-BB6C-7942D1B6B650}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{0E9426F8-B45E-4266-BB6C-7942D1B6B650}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{0E9426F8-B45E-4266-BB6C-7942D1B6B650}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{0E9426F8-B45E-4266-BB6C-7942D1B6B650}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{EB627575-4C56-45D3-AC41-C9459D30D37B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{EB627575-4C56-45D3-AC41-C9459D30D37B}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{EB627575-4C56-45D3-AC41-C9459D30D37B}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{EB627575-4C56-45D3-AC41-C9459D30D37B}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {C9CA0496-DCB2-49B7-9D70-A6B1DACB282F}
30+
EndGlobalSection
31+
EndGlobal

a10vthunder-orchestrator/Api/Models/ServerTemplateListResponse.cs

Lines changed: 94 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
using Keyfactor.PKI.X509;
1516
using Newtonsoft.Json;
16-
using System.Collections.Generic;
17+
using Newtonsoft.Json.Linq;
18+
using System;
19+
using System.Collections.Generic;
20+
1721

1822
namespace a10vthunder.Api.Models
1923
{
@@ -31,47 +35,94 @@ public class ServerTemplateListResponse
3135
{
3236
[JsonProperty("server-ssl-list")]
3337
public List<ServerSslList> serverssllist { get; set; }
34-
}
35-
36-
public class ServerSslList
37-
{
38-
public string name { get; set; }
39-
40-
[JsonProperty("enable-tls-alert-logging")]
41-
public int enabletlsalertlogging { get; set; }
42-
43-
[JsonProperty("handshake-logging-enable")]
44-
public int handshakeloggingenable { get; set; }
45-
46-
[JsonProperty("session-key-logging-enable")]
47-
public int sessionkeyloggingenable { get; set; }
48-
49-
[JsonProperty("close-notify")]
50-
public int closenotify { get; set; }
51-
52-
[JsonProperty("session-ticket-enable")]
53-
public int sessionticketenable { get; set; }
54-
public int version { get; set; }
55-
public int dgversion { get; set; }
38+
}
39+
40+
public class ServerSslList
41+
{
42+
public string name { get; set; }
43+
44+
[JsonProperty("enable-tls-alert-logging")]
45+
public int enabletlsalertlogging { get; set; }
46+
47+
[JsonProperty("handshake-logging-enable")]
48+
public int handshakeloggingenable { get; set; }
49+
50+
[JsonProperty("session-key-logging-enable")]
51+
public int sessionkeyloggingenable { get; set; }
52+
53+
[JsonProperty("close-notify")]
54+
public int closenotify { get; set; }
55+
56+
[JsonProperty("forward-proxy-enable")]
57+
public int? forwardproxyenable { get; set; } // optional
58+
59+
[JsonProperty("session-ticket-enable")]
60+
public int sessionticketenable { get; set; }
61+
62+
public int version { get; set; }
63+
public int dgversion { get; set; }
64+
65+
[JsonProperty("ssli-logging")]
66+
public int? ssliLogging { get; set; } // optional
67+
68+
[JsonProperty("ocsp-stapling")]
69+
public int ocspstapling { get; set; }
70+
71+
[JsonProperty("use-client-sni")]
72+
public int useclientsni { get; set; }
73+
74+
[JsonProperty("renegotiation-disable")]
75+
public int renegotiationdisable { get; set; }
76+
77+
[JsonProperty("session-cache-size")]
78+
public int sessioncachesize { get; set; }
79+
80+
[JsonProperty("early-data")]
81+
public int earlydata { get; set; }
82+
83+
public string uuid { get; set; }
84+
85+
[JsonProperty("certificate")]
86+
[JsonConverter(typeof(CertificateConverter))]
87+
public TemplateCertificate certificate { get; set; }
88+
89+
[JsonProperty("cert")]
90+
public string certFlat { get; set; }
91+
92+
[JsonProperty("key")]
93+
public string keyFlat { get; set; }
94+
95+
[JsonProperty("a10-url")]
96+
public string a10url { get; set; }
97+
98+
[JsonIgnore]
99+
public TemplateCertificate MergedCertificate => certificate ?? (
100+
certFlat != null && keyFlat != null
101+
? new TemplateCertificate { cert = certFlat, key = keyFlat, uuid = uuid, a10url = a10url + "/certificate" }
102+
: null
103+
);
104+
}
105+
106+
public class CertificateConverter : JsonConverter<TemplateCertificate>
107+
{
108+
public override TemplateCertificate ReadJson(JsonReader reader, Type objectType, TemplateCertificate existingValue, bool hasExistingValue, JsonSerializer serializer)
109+
{
110+
JObject obj = JObject.Load(reader);
111+
112+
// Case 1: certificate is a full object
113+
if (obj["cert"] != null && obj["key"] != null)
114+
{
115+
return obj.ToObject<TemplateCertificate>();
116+
}
117+
118+
// If the certificate node is not an object (e.g., null or primitive), fallback
119+
return null;
120+
}
121+
122+
public override void WriteJson(JsonWriter writer, TemplateCertificate value, JsonSerializer serializer)
123+
{
124+
serializer.Serialize(writer, value);
125+
}
126+
}
56127

57-
[JsonProperty("ocsp-stapling")]
58-
public int ocspstapling { get; set; }
59-
60-
[JsonProperty("use-client-sni")]
61-
public int useclientsni { get; set; }
62-
63-
[JsonProperty("renegotiation-disable")]
64-
public int renegotiationdisable { get; set; }
65-
66-
[JsonProperty("session-cache-size")]
67-
public int sessioncachesize { get; set; }
68-
69-
[JsonProperty("early-data")]
70-
public int earlydata { get; set; }
71-
public string uuid { get; set; }
72-
public TemplateCertificate certificate { get; set; }
73-
74-
[JsonProperty("a10-url")]
75-
public string a10url { get; set; }
76-
}
77128
}
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
using Newtonsoft.Json;
2+
3+
namespace a10vthunder.Api.Models
4+
{
5+
public class VersionResponse
6+
{
7+
[JsonProperty("version")]
8+
public VersionContainer Version { get; set; }
9+
}
10+
11+
public class VersionContainer
12+
{
13+
[JsonProperty("oper")]
14+
public VersionOperational Oper { get; set; }
15+
16+
[JsonProperty("a10-url")]
17+
public string A10Url { get; set; }
18+
}
19+
20+
public class VersionOperational
21+
{
22+
[JsonProperty("hw-platform")]
23+
public string HwPlatform { get; set; }
24+
25+
[JsonProperty("copyright")]
26+
public string Copyright { get; set; }
27+
28+
[JsonProperty("sw-version")]
29+
public string SwVersion { get; set; }
30+
31+
[JsonProperty("plat-features")]
32+
public string PlatFeatures { get; set; }
33+
34+
[JsonProperty("boot-from")]
35+
public string BootFrom { get; set; }
36+
37+
[JsonProperty("serial-number")]
38+
public string SerialNumber { get; set; }
39+
40+
[JsonProperty("aflex-version")]
41+
public string AflexVersion { get; set; }
42+
43+
[JsonProperty("axapi-version")]
44+
public string AxapiVersion { get; set; }
45+
46+
[JsonProperty("pri-gui-version")]
47+
public string PriGuiVersion { get; set; }
48+
49+
[JsonProperty("sec-gui-version")]
50+
public string SecGuiVersion { get; set; }
51+
52+
[JsonProperty("cylance-version")]
53+
public string CylanceVersion { get; set; }
54+
55+
[JsonProperty("hd-pri")]
56+
public string HdPri { get; set; }
57+
58+
[JsonProperty("hd-sec")]
59+
public string HdSec { get; set; }
60+
61+
[JsonProperty("last-config-saved-time")]
62+
public string LastConfigSavedTime { get; set; }
63+
64+
[JsonProperty("virtualization-type")]
65+
public string VirtualizationType { get; set; }
66+
67+
[JsonProperty("sys-poll-mode")]
68+
public string SysPollMode { get; set; }
69+
70+
[JsonProperty("product")]
71+
public string Product { get; set; }
72+
73+
[JsonProperty("hw-code")]
74+
public string HwCode { get; set; }
75+
76+
[JsonProperty("current-time")]
77+
public string CurrentTime { get; set; }
78+
79+
[JsonProperty("up-time")]
80+
public string UpTime { get; set; }
81+
82+
[JsonProperty("nun-ctrl-cpus")]
83+
public int NunCtrlCpus { get; set; }
84+
85+
[JsonProperty("buff-size")]
86+
public int BuffSize { get; set; }
87+
88+
[JsonProperty("io-buff-enabled")]
89+
public string IoBuffEnabled { get; set; }
90+
91+
[JsonProperty("build-type")]
92+
public string BuildType { get; set; }
93+
94+
[JsonProperty("cots-sys-mfg")]
95+
public string CotsSysMfg { get; set; }
96+
97+
[JsonProperty("cots-sys-name")]
98+
public string CotsSysName { get; set; }
99+
100+
[JsonProperty("cots-sys-ver")]
101+
public string CotsSysVer { get; set; }
102+
103+
[JsonProperty("series-name")]
104+
public string SeriesName { get; set; }
105+
106+
[JsonProperty("hostname")]
107+
public string Hostname { get; set; }
108+
}
109+
}

0 commit comments

Comments
 (0)