Skip to content

Commit e361933

Browse files
committed
fix: remove chat:write.public scope for better security
Changed botScopes from ["commands", "chat:write", "chat:write.public"] to ["commands", "chat:write"] to remove the overly broad public permission. The chat:write.public scope allows bots to write to channels they're not members of, which is unnecessarily permissive. Using just chat:write provides better security and privacy while maintaining necessary functionality. Updated: - Test data manifests (manifest-sdk.ts, manifest-sdk-app-name.ts) - Documentation example - Test expectations in strings_test.go
1 parent 37106f5 commit e361933

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

docs/guides/using-environment-variables-with-the-slack-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default Manifest({
108108
outgoingDomains: [
109109
Deno.env.get("CHATBOT_API_URL")!,
110110
],
111-
botScopes: ["commands", "chat:write", "chat:write.public"],
111+
botScopes: ["commands", "chat:write"],
112112
});
113113
```
114114

internal/goutils/strings_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,8 @@ func Test_RedactPII(t *testing.T) {
326326
},
327327
{
328328
name: "Escape sensitive data from mock HTTP response",
329-
text: `{"ok":true,"app_id":"A123","credentials":{"client_id":"123","client_secret":"123","verification_token":"123","signing_secret":"123"},"oauth_authorize_url":"123":\/\/slack.com\/oauth\/v2\/authorize?client_id=123&scope=commands,chat:write,chat:write.public"}`,
330-
expected: `{"ok":true,"app_id":"A123","credentials":{"client_id":"...","client_secret":"...","verification_token":"...","signing_secret":"..."},"oauth_authorize_url":"...":\/\/slack.com\/oauth\/v2\/authorize?client_id=...&scope=commands,chat:write,chat:write.public"}`,
329+
text: `{"ok":true,"app_id":"A123","credentials":{"client_id":"123","client_secret":"123","verification_token":"123","signing_secret":"123"},"oauth_authorize_url":"123":\/\/slack.com\/oauth\/v2\/authorize?client_id=123&scope=commands,chat:write"}`,
330+
expected: `{"ok":true,"app_id":"A123","credentials":{"client_id":"...","client_secret":"...","verification_token":"...","signing_secret":"..."},"oauth_authorize_url":"...":\/\/slack.com\/oauth\/v2\/authorize?client_id=...&scope=commands,chat:write"}`,
331331
},
332332
{
333333
name: "Escape from `Command` for external-auth add-secret",

test/testdata/manifest-sdk-app-name.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ export default Manifest({
1818
"icon": "assets/icon.png",
1919
"functions": [ReverseFunction],
2020
"outgoingDomains": [],
21-
"botScopes": ["commands", "chat:write", "chat:write.public"],
21+
"botScopes": ["commands", "chat:write"],
2222
});

test/testdata/manifest-sdk.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ export default Manifest({
1818
"icon": "assets/icon.png",
1919
"functions": [ReverseFunction],
2020
"outgoingDomains": [],
21-
"botScopes": ["commands", "chat:write", "chat:write.public"],
21+
"botScopes": ["commands", "chat:write"],
2222
});

0 commit comments

Comments
 (0)