mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-24 11:25:50 -06:00
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:
committed by
GitHub
parent
593ac4ae0c
commit
62c5a8b888
@@ -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")) {
|
||||
|
||||
Reference in New Issue
Block a user