Skip to content

Commit b65f116

Browse files
committed
fix(providers): make the Slack profile read-only and align its docs
Slack's read methods accept GET with query-string arguments, and the token travels in the injected authorization header rather than as a query parameter, so the read-only method preset covers reads. Grant read-only access in the built-in profile and state that write methods such as chat.postMessage need an explicit rule or a read-write copy. Drop the incorrect claim that Slack reads require POST. Describe where the Slack error name surfaces (the provider_error_subtype field of the refresh status API, echoed in LAST_ERROR). Mirrors the follow-up on the upstream submission (ai-openshell#3730). Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
1 parent d7bd4bb commit b65f116

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎docs/providers/slack.mdx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,19 @@ field. The gateway classifies those like standard OAuth errors:
8787
| `invalid_client_id`, `bad_client_secret` | `oauth_invalid_client` | `fix_configuration`: correct the client material. |
8888
| `ratelimited` and other transient Slack errors | `oauth_token_endpoint_retryable` | `retry`: the gateway retries automatically. |
8989

90-
The Slack error name is kept in the provider error subtype of the refresh
91-
status so operators can see the original cause.
90+
The Slack error name is recorded as `provider_error_subtype` in the refresh
91+
status API and echoed in the `LAST_ERROR` text of the status table.
9292

9393
## Use the Provider in a Sandbox
9494

9595
```shell
9696
openshell sandbox create --name slack-sandbox --provider my-slack
9797
openshell sandbox exec slack-sandbox -- \
98-
curl -s -X POST https://slack.com/api/auth.test \
98+
curl -s https://slack.com/api/auth.test \
9999
-H "Authorization: Bearer $SLACK_USER_TOKEN"
100100
```
101101

102102
The sandbox sees only the placeholder; the sandbox proxy substitutes the
103-
current access token for requests to `slack.com`. Restrict the allowed
104-
methods with a custom profile that adds `rules` for the Slack Web API paths
105-
your workload needs.
103+
current access token for requests to `slack.com`. The profile allows read
104+
methods only; add `rules` for the specific Slack Web API paths your workload
105+
needs, including any write methods such as `chat.postMessage`.

‎providers/slack.yaml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ discovery:
4242
credentials: [user_token]
4343

4444
endpoints:
45-
# Slack Web API methods are POST even for reads, so the read-only
46-
# method preset is unusable; read-write is the minimum working preset.
45+
# Slack's read methods accept GET, so the read-only preset covers reads
46+
# while keeping write methods denied until a policy explicitly allows them.
4747
- host: slack.com
4848
port: 443
4949
protocol: rest
50-
access: read-write
50+
access: read-only
5151
enforcement: enforce

0 commit comments

Comments
 (0)