fix(gateway): make scope errors machine-readable across clients (#111013)

* fix(gateway): consume structured scope errors

* docs(gateway): clarify tools error boundary

* refactor(gateway): unify node admin policy
This commit is contained in:
Peter Steinberger
2026-07-18 17:53:45 -07:00
committed by GitHub
parent 593ac4ae0c
commit 62c5a8b888
54 changed files with 957 additions and 231 deletions
+7 -2
View File
@@ -728,9 +728,14 @@ describe("cli program (nodes basics)", () => {
useStoredDeviceAuth?: boolean;
};
if (opts.method === "node.list" && opts.useStoredDeviceAuth) {
throw Object.assign(new Error("missing scope: operator.read"), {
throw Object.assign(new Error("permission denied"), {
name: "GatewayClientRequestError",
gatewayCode: "INVALID_REQUEST",
gatewayCode: "FORBIDDEN",
details: {
code: "MISSING_SCOPE",
missingScope: "operator.read",
requiredScopes: ["operator.read"],
},
});
}
if (opts.method === "node.list" && opts.scopes?.includes("operator.pairing")) {