Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ MY_ENV_VAR=asdf1234

Note that changes to your `.env` file will be reflected when you restart your local development server.

While the `.env` file should **never** be committed to source control for security reasons, you can see a sample `.env` file we've included in the [Timesheet approval sample app](https://github.com/slack-samples/deno-timesheet-approval) and the [Incident management sample app](https://github.com/slack-samples/deno-incident-management).
While the `.env` file should **never** be committed to source control for security reasons, you can see a sample `.env` file we've included in the [Timesheet approval sample app](https://github.com/slack-samples/deno-timesheet-approval) and the [Incident management sample app](https://github.com/slack-samples/deno-incident-management).

### Storing deployed environment variables {#deployed-env-vars}

Expand All @@ -40,7 +40,7 @@ If your token contains non-alphanumeric characters, wrap it in quotes like this:
slack env add SLACK_API_URL "https://dev<yournumber>.slack.com/api/"
```

Your environment variables are always encrypted before being stored on our servers and will be automatically decrypted when you use them&mdash;including when listing environment variables with `slack env list`.
Your environment variables are always encrypted before being stored on our servers and will be automatically decrypted when you use them&mdash;including when listing environment variables with `slack env list`.

### Access variables from within function {#access-function}

Expand Down Expand Up @@ -108,7 +108,7 @@ export default Manifest({
outgoingDomains: [
Deno.env.get("CHATBOT_API_URL")!,
],
botScopes: ["commands", "chat:write", "chat:write.public"],
botScopes: ["commands", "chat:write"],
});
```

Expand All @@ -134,7 +134,7 @@ With this addition, running `slack deploy` without defining a value for `CHATBOT

## Enabling debug mode {#debug}

The included environment variable `SLACK_DEBUG` can enable a basic debug mode. Set `SLACK_DEBUG` to `true` to have all function-related payloads logged.
The included environment variable `SLACK_DEBUG` can enable a basic debug mode. Set `SLACK_DEBUG` to `true` to have all function-related payloads logged.

For local apps, add the following to your `.env` file:

Expand Down
4 changes: 2 additions & 2 deletions internal/goutils/strings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ func Test_RedactPII(t *testing.T) {
},
{
name: "Escape sensitive data from mock HTTP response",
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"}`,
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"}`,
Comment on lines -329 to -330
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧪 thought: This might reduce the quality of these tests in some perhaps odd edge cases but let's not let that block these greps!

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"}`,
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"}`,
},
{
name: "Escape from `Command` for external-auth add-secret",
Expand Down
2 changes: 1 addition & 1 deletion test/testdata/manifest-sdk-app-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export default Manifest({
"icon": "assets/icon.png",
"functions": [ReverseFunction],
"outgoingDomains": [],
"botScopes": ["commands", "chat:write", "chat:write.public"],
"botScopes": ["commands", "chat:write"],
});
2 changes: 1 addition & 1 deletion test/testdata/manifest-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export default Manifest({
"icon": "assets/icon.png",
"functions": [ReverseFunction],
"outgoingDomains": [],
"botScopes": ["commands", "chat:write", "chat:write.public"],
"botScopes": ["commands", "chat:write"],
});
Loading