mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 09:00:21 +00:00
fix: bind bootstrap setup codes to node profile
This commit is contained in:
@@ -149,6 +149,10 @@ describe("device-pair /pair qr", () => {
|
||||
const text = requireText(result);
|
||||
|
||||
expect(pluginApiMocks.renderQrPngBase64).toHaveBeenCalledTimes(1);
|
||||
expect(pluginApiMocks.issueDeviceBootstrapToken).toHaveBeenCalledWith({
|
||||
roles: ["node"],
|
||||
scopes: [],
|
||||
});
|
||||
expect(text).toContain("Scan this QR code with the OpenClaw iOS app:");
|
||||
expect(text).toContain("");
|
||||
expect(text).toContain("- Security: single-use bootstrap token");
|
||||
|
||||
@@ -43,6 +43,8 @@ function formatDurationMinutes(expiresAtMs: number): string {
|
||||
}
|
||||
|
||||
const DEFAULT_GATEWAY_PORT = 18789;
|
||||
const SETUP_CODE_ROLES = ["node"] as const;
|
||||
const SETUP_CODE_SCOPES: string[] = [];
|
||||
|
||||
type DevicePairPluginConfig = {
|
||||
publicUrl?: string;
|
||||
@@ -515,7 +517,10 @@ function resolveQrReplyTarget(ctx: QrCommandContext): string {
|
||||
}
|
||||
|
||||
async function issueSetupPayload(url: string): Promise<SetupPayload> {
|
||||
const issuedBootstrap = await issueDeviceBootstrapToken();
|
||||
const issuedBootstrap = await issueDeviceBootstrapToken({
|
||||
roles: SETUP_CODE_ROLES,
|
||||
scopes: SETUP_CODE_SCOPES,
|
||||
});
|
||||
return {
|
||||
url,
|
||||
bootstrapToken: issuedBootstrap.token,
|
||||
|
||||
Reference in New Issue
Block a user