Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fiery-colts-send.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"google-workspace-developer-tools": patch
---

Add Apps Script specific `https://www.googleapis.com/auth/script.external_request` which is not part of any API.
8 changes: 8 additions & 0 deletions packages/vscode-extension/src/scopes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ for (const { title, version, documentationLink, scopes } of GOOGLE_APIS || []) {
}
}

export const SCRIPT_EXTERNAL_REQUEST_SCOPE =
"https://www.googleapis.com/auth/script.external_request";

SCOPES.set(SCRIPT_EXTERNAL_REQUEST_SCOPE, {
description: "Connect to an external service",
apis: [],
});

const RESTRICTED_SCOPES = [
"https://www.googleapis.com/auth/chat.admin.delete",
"https://www.googleapis.com/auth/chat.app.delete",
Expand Down
12 changes: 11 additions & 1 deletion packages/vscode-extension/src/test/scopes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
*/

import * as assert from "node:assert";
import { SCOPES, getScopeMarkdown } from "../scopes.js";
import {
SCOPES,
SCRIPT_EXTERNAL_REQUEST_SCOPE,
getScopeMarkdown,
} from "../scopes.js";

suite("getScopeMarkdown", () => {
test("it returns markdown for a known scope", () => {
Expand All @@ -27,4 +31,10 @@ suite("getScopeMarkdown", () => {
const markdown = getScopeMarkdown("https://example.com");
assert.strictEqual(markdown, "**https://example.com** (Unknown scope)");
});

test("it returns scope for script.external_request", () => {
const scope = SCOPES.get(SCRIPT_EXTERNAL_REQUEST_SCOPE);
assert.ok(scope);
assert.strictEqual(scope?.description, "Connect to an external service");
});
});