Skip to content

Commit

Permalink
update docs/index.md for config file options. Closes #4
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeshbal65 committed Feb 17, 2021
1 parent ee82cf7 commit a556733
Showing 1 changed file with 24 additions and 27 deletions.
51 changes: 24 additions & 27 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ description: "Steampipe plugin for querying Slack Conversations, Groups, Users a

The Slack plugin is used to query conversations, users and other data.


## Installation

Download and install the latest Slack plugin:
Expand All @@ -23,8 +22,9 @@ Installing plugin slack...
$
```

## Connection Configuration

## Configure API Token
Connection configurations are defined using HCL in one or more Steampipe config files. Steampipe will load ALL configuration files from ~/.steampipe/config that have a .spc extension. A config file may contain multiple connections.

API tokens in Slack are associated with Apps. To use Steampipe, you need to
create an App in Slack with the appropriate permissions.
Expand All @@ -36,26 +36,23 @@ create an App in Slack with the appropriate permissions.
5. (Re-)Install your app.
6. Get the user oauth token for your team. It looks like `xoxp-2556146250-EXAMPLE-1646968370949-df954218b5da5b8614c85cc454136b27`

Set Slack API token as an environment variable (Mac, Linux):
### Configure API Token

```bash
export SLACK_TOKEN="xoxp-2556146250-EXAMPLE-1646968370949-df954218b5da5b8614c85cc454136b27"
```
The default connection. This uses standard Application Default Credentials (ADC) against the Slack

Run a query:

```bash
$ steampipe query
Welcome to Steampipe v0.0.11
Type ".inspect" for more information.
> select * from slack_connection;
+-------------------------+------+--------+-----------+-----------+---------------+--------+
| url | team | user | team_id | user_id | enterprise_id | bot_id |
+-------------------------+------+--------+-----------+-----------+---------------+--------+
| https://acme.slack.com/ | ACME | dwight | T02GD4B7C | U03GC6A7E | | |
+-------------------------+------+--------+-----------+-----------+---------------+--------+
```hcl
connection "steampipe_cli" {
plugin = "slack"
}
```

A connection to a specific workspace, using non default Credentials.
```hcl
connection "steampipe_cli_admin" {
plugin = "slack"
token = "xoxp-2556146250-EXAMPLE-1646968370949-df954218b5da5b8614c85cc454136b27"
}
```

## Permissions and Scopes

Expand All @@ -64,12 +61,12 @@ Steampipe requires different permissions for each table. We recommend granting a
of the scopes in the table below, but you can restrict them to specific tables if you
prefer.

| Table | Scope Required |
|--|--|
| `slack_access_log` | `admin` ([paid plan required](https://slack.com/help/articles/360002084807-View-Access-Logs-for-your-workspace)) |
| `slack_connection` | _None_ |
| `slack_conversation` | `channels:read`, `groups:read`, `im:read`, `mpim:read` |
| `slack_emoji` | `emoji:read` |
| `slack_group` | `usergroups:read` |
| `slack_search` | `search:read` |
| `slack_user` | `users:read`, `users:read.email` |
| Table | Scope Required |
| -------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `slack_access_log` | `admin` ([paid plan required](https://slack.com/help/articles/360002084807-View-Access-Logs-for-your-workspace)) |
| `slack_connection` | _None_ |
| `slack_conversation` | `channels:read`, `groups:read`, `im:read`, `mpim:read` |
| `slack_emoji` | `emoji:read` |
| `slack_group` | `usergroups:read` |
| `slack_search` | `search:read` |
| `slack_user` | `users:read`, `users:read.email` |

0 comments on commit a556733

Please sign in to comment.