Address review feedback and fix check lint failures
This commit is contained in:
parent
7bbaad2eea
commit
281e33e0cb
@ -87,13 +87,6 @@ function expectSupportsDeveloperRoleForcedOff(overrides?: Partial<Model<Api>>):
|
||||
expect(supportsDeveloperRole(normalized)).toBe(false);
|
||||
}
|
||||
|
||||
function expectSupportsUsageInStreamingForcedOff(overrides?: Partial<Model<Api>>): void {
|
||||
const model = { ...baseModel(), ...overrides };
|
||||
delete (model as { compat?: unknown }).compat;
|
||||
const normalized = normalizeModelCompat(model as Model<Api>);
|
||||
expect(supportsUsageInStreaming(normalized)).toBe(false);
|
||||
}
|
||||
|
||||
function expectResolvedForwardCompat(
|
||||
model: Model<Api> | undefined,
|
||||
expected: { provider: string; id: string },
|
||||
|
||||
@ -81,11 +81,7 @@ export type GatewayConnectionDetails = {
|
||||
message: string;
|
||||
};
|
||||
|
||||
function shouldAttachDeviceIdentityForGatewayCall(_params: {
|
||||
url: string;
|
||||
token?: string;
|
||||
password?: string;
|
||||
}): boolean {
|
||||
function shouldAttachDeviceIdentityForGatewayCall(): boolean {
|
||||
// Even when local CLI calls authenticate with a shared gateway token/password,
|
||||
// we still want to attach device identity so paired operator scopes remain
|
||||
// available for detail RPCs such as status / system-presence / last-heartbeat.
|
||||
@ -829,7 +825,7 @@ async function executeGatewayRequestWithScopes<T>(params: {
|
||||
mode: opts.mode ?? GATEWAY_CLIENT_MODES.CLI,
|
||||
role: "operator",
|
||||
scopes,
|
||||
deviceIdentity: shouldAttachDeviceIdentityForGatewayCall({ url, token, password })
|
||||
deviceIdentity: shouldAttachDeviceIdentityForGatewayCall()
|
||||
? loadOrCreateDeviceIdentity()
|
||||
: undefined,
|
||||
minProtocol: opts.minProtocol ?? PROTOCOL_VERSION,
|
||||
|
||||
@ -79,6 +79,7 @@ describe("probeGateway", () => {
|
||||
});
|
||||
|
||||
expect(result.ok).toBe(true);
|
||||
expect(gatewayClientState.options?.deviceIdentity).toBeNull();
|
||||
expect(gatewayClientState.requests).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
@ -61,6 +61,7 @@ export async function probeGateway(opts: {
|
||||
clientVersion: "dev",
|
||||
mode: GATEWAY_CLIENT_MODES.PROBE,
|
||||
instanceId,
|
||||
deviceIdentity: opts.includeDetails === false ? null : undefined,
|
||||
onConnectError: (err) => {
|
||||
connectError = formatErrorMessage(err);
|
||||
},
|
||||
|
||||
@ -684,7 +684,8 @@ export function attachGatewayWsMessageHandler(params: {
|
||||
hasBrowserOriginHeader,
|
||||
sharedAuthOk,
|
||||
authMethod,
|
||||
}) || shouldSkipControlUiPairing(controlUiAuthPolicy, role, trustedProxyAuthOk);
|
||||
}) ||
|
||||
shouldSkipControlUiPairing(controlUiAuthPolicy, role, trustedProxyAuthOk);
|
||||
if (device && devicePublicKey && !skipPairing) {
|
||||
const formatAuditList = (items: string[] | undefined): string => {
|
||||
if (!items || items.length === 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user