test(grpc-data): H2 live smoke on the standalone rig - denied-principal modes, pinned-build check, parity; evidence
This commit is contained in:
@@ -209,17 +209,29 @@ try
|
||||
["serving"] = featured.Serving.ToString(),
|
||||
}));
|
||||
// 3. Unhistorized tag and the no-HistoryRead principal answer the same bytes; no header ⇒ FAILED_PRECONDITION.
|
||||
// --denied-expect: `permission-denied` (the second principal's export lacks HistoryRead ⇒ RPC refused) or
|
||||
// `unsupported` (export granted, origin ACL denies ⇒ per-item, byte-identical to the unhistorized answer).
|
||||
var deniedExpect = arguments.GetValueOrDefault("--denied-expect", "unsupported");
|
||||
var unhist = (await client.HistoryReadAsync(Raw(View(unhistorized), null), With(key, true), deadline())).Items.Single();
|
||||
var denied = (await client.HistoryReadAsync(Raw(View(historized), null), With(otherKey, true), deadline())).Items.Single();
|
||||
var identical = Shape(unhist).AsSpan().SequenceEqual(Shape(denied));
|
||||
W.HistoryReadResult? denied = null;
|
||||
string? deniedRpc = null;
|
||||
try { denied = (await client.HistoryReadAsync(Raw(View(historized), null), With(otherKey, true), deadline())).Items.Single(); }
|
||||
catch (RpcException error) { deniedRpc = error.StatusCode.ToString(); }
|
||||
var otherCaps = await client.GetCapabilitiesAsync(new() { ProtocolMajor = 1, ProtocolMinor = 3 }, With(otherKey, true), deadline());
|
||||
var identical = denied is not null && Shape(unhist).AsSpan().SequenceEqual(Shape(denied));
|
||||
var deniedOk = deniedExpect == "permission-denied"
|
||||
? deniedRpc == "PermissionDenied"
|
||||
: denied is not null && denied.StatusCode == 0x80720000u && identical;
|
||||
string? precondition = null;
|
||||
try { await client.HistoryReadAsync(Raw(View(historized), null), With(key, false), deadline()); precondition = "OK"; }
|
||||
catch (RpcException error) { precondition = error.StatusCode.ToString(); }
|
||||
results.Add(new("history-refusals-" + name, "history-refusals",
|
||||
unhist.StatusCode == 0x80720000u && denied.StatusCode == 0x80720000u && identical && precondition == "FailedPrecondition", 4, new()
|
||||
unhist.StatusCode == 0x80720000u && deniedOk && precondition == "FailedPrecondition", 3, new()
|
||||
{
|
||||
["unhistorized"] = new { statusCode = Hex(unhist.StatusCode), unhist.Samples.Count, unhist.HasContinuation, unhist.HasDiagnostic, bytes = Convert.ToHexString(Shape(unhist)) },
|
||||
["deniedPrincipal"] = new { statusCode = Hex(denied.StatusCode), denied.Samples.Count, denied.HasContinuation, denied.HasDiagnostic, bytes = Convert.ToHexString(Shape(denied)) },
|
||||
["deniedExpect"] = deniedExpect,
|
||||
["deniedPrincipal"] = denied is null ? new { rpcStatus = deniedRpc } : (object)new { statusCode = Hex(denied.StatusCode), denied.Samples.Count, denied.HasContinuation, denied.HasDiagnostic, bytes = Convert.ToHexString(Shape(denied)) },
|
||||
["deniedPrincipalCapabilities"] = new { operations = otherCaps.Operations, historyPresent = otherCaps.History is not null },
|
||||
["byteIdentical"] = identical,
|
||||
["withoutFeatureHeader"] = precondition,
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user