feat(server): add observability and operator controls (#16)
quality-gate / quality (push) Failing after 1m1s
quality-gate / quality (push) Failing after 1m1s
This commit is contained in:
@@ -11,6 +11,11 @@ public sealed class OpenApiCompatibilityTests
|
||||
"/v1/join-attempts",
|
||||
"/v1/join-attempts/{attemptId}",
|
||||
"/v1/join-attempts/{attemptId}/outcome",
|
||||
"/v1/operator/drain",
|
||||
"/v1/operator/keys/revoke",
|
||||
"/v1/operator/listings/revoke",
|
||||
"/v1/operator/principals/revoke",
|
||||
"/v1/operator/status",
|
||||
"/v1/sessions",
|
||||
"/v1/sessions/{listingId}",
|
||||
"/v1/sessions/{listingId}/join-attempts",
|
||||
@@ -104,6 +109,11 @@ public sealed class OpenApiCompatibilityTests
|
||||
Assert.Equal(
|
||||
"X-Rendezvous-Client-Punch-Capability",
|
||||
attemptCapability.GetProperty("name").GetString());
|
||||
JsonElement operatorBearer = root.GetProperty("components")
|
||||
.GetProperty("securitySchemes")
|
||||
.GetProperty("OperatorBearer");
|
||||
Assert.Equal("http", operatorBearer.GetProperty("type").GetString());
|
||||
Assert.Equal("bearer", operatorBearer.GetProperty("scheme").GetString());
|
||||
(string Path, string Method)[] publisherOperations =
|
||||
[
|
||||
("/v1/sessions", "post"),
|
||||
@@ -120,6 +130,23 @@ public sealed class OpenApiCompatibilityTests
|
||||
Assert.True(security[0].TryGetProperty("PublisherBearer", out _));
|
||||
}
|
||||
|
||||
(string Path, string Method)[] operatorOperations =
|
||||
[
|
||||
("/v1/operator/status", "get"),
|
||||
("/v1/operator/listings/revoke", "post"),
|
||||
("/v1/operator/principals/revoke", "post"),
|
||||
("/v1/operator/keys/revoke", "post"),
|
||||
("/v1/operator/drain", "post"),
|
||||
];
|
||||
foreach ((string operationPath, string method) in operatorOperations)
|
||||
{
|
||||
JsonElement security = root.GetProperty("paths")
|
||||
.GetProperty(operationPath)
|
||||
.GetProperty(method)
|
||||
.GetProperty("security");
|
||||
Assert.True(security[0].TryGetProperty("OperatorBearer", out _));
|
||||
}
|
||||
|
||||
JsonElement cancelParameters = root.GetProperty("paths")
|
||||
.GetProperty("/v1/join-attempts/{attemptId}")
|
||||
.GetProperty("delete")
|
||||
@@ -157,6 +184,15 @@ public sealed class OpenApiCompatibilityTests
|
||||
static item => item.Name is "get" or "post" or "put" or "delete"))
|
||||
{
|
||||
JsonElement responses = operation.Value.GetProperty("responses");
|
||||
foreach (JsonProperty response in responses.EnumerateObject())
|
||||
{
|
||||
JsonElement correlation = response.Value.GetProperty("headers")
|
||||
.GetProperty("X-Rendezvous-Correlation-ID");
|
||||
Assert.Equal(
|
||||
"string",
|
||||
correlation.GetProperty("schema").GetProperty("type").GetString());
|
||||
}
|
||||
|
||||
if (!responses.TryGetProperty("429", out JsonElement overloaded))
|
||||
{
|
||||
continue;
|
||||
@@ -171,7 +207,7 @@ public sealed class OpenApiCompatibilityTests
|
||||
}
|
||||
}
|
||||
|
||||
Assert.Equal(12, overloadContracts);
|
||||
Assert.Equal(17, overloadContracts);
|
||||
(string Path, string Method)[] bodyOperations =
|
||||
[
|
||||
("/v1/sessions", "post"),
|
||||
@@ -180,6 +216,10 @@ public sealed class OpenApiCompatibilityTests
|
||||
("/v1/sessions/{listingId}", "delete"),
|
||||
("/v1/join-attempts", "post"),
|
||||
("/v1/join-attempts/{attemptId}/outcome", "post"),
|
||||
("/v1/operator/listings/revoke", "post"),
|
||||
("/v1/operator/principals/revoke", "post"),
|
||||
("/v1/operator/keys/revoke", "post"),
|
||||
("/v1/operator/drain", "post"),
|
||||
];
|
||||
foreach ((string operationPath, string method) in bodyOperations)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user