Preserve current rendering, operator and retained-source behavior while integrating script quality, meaningful headers and strict Error Prone/NullAway contracts. Production and test compilation and the 189-case verification gate pass with zero failures and one intentional workload skip. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: James Maes <james@kof22.com>
24 lines
912 B
C#
24 lines
912 B
C#
/*
|
|
* Copyright 2026 Kingsrook, LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
using Printing.Development;
|
|
using Qqq.PrintAgent.Core.Authentication;
|
|
namespace Printing.NativeAuth;
|
|
|
|
|
|
|
|
/// <summary>Requires the pinned experimental native grant before provider authentication.</summary>
|
|
internal static class NativeAuthDiscovery
|
|
{
|
|
/// <summary>Checks actual production discovery without sending credentials.</summary>
|
|
internal static async Task DiscoverAsync(QqqSessionClient client, CancellationToken token)
|
|
{
|
|
QqqApiDiscovery discovery = await WorkloadDiscovery.DiscoverRealtimeAsync(client, token);
|
|
if(!string.Equals(discovery.ApiVersion, "1.9.0", StringComparison.Ordinal) || !discovery.Features.Contains("nativeSessionLogin", StringComparer.Ordinal))
|
|
{
|
|
throw new InvalidOperationException("The actual server did not advertise the pinned native-session API.");
|
|
}
|
|
}
|
|
}
|