Skip to content

Commit d964fc5

Browse files
authored
Docs: Clarify behavior of API keys
1 parent 73a5e98 commit d964fc5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

docs/developing/http-apis.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ request to the app. Briefly:
2424
curl -H "Authorization: Bearer 49Np9sqkYV4g_FpOQk1p0j1yJlvoHrZm9SVhQt7H2-9" https://alpha-api.sandstorm.io/
2525
```
2626

27+
## Key Security Consideration
28+
29+
API tokens and sharing tokens are essentially the same: Grants of capabilities. This means that an API
30+
key also allows users to redeem it as a sharing link of the form `https://sandstorm.example.com/shared/$API_TOKEN`.
31+
You must not use the scope of the /apiPath to limit the access granted via an API key. You should use
32+
`roleAssignment` on offer templates, described below, to limit the access granted via an API key.
33+
2734
## Configuring an app to permit requests via the API subdomain
2835

2936
The handling of inbound HTTP API requests is configured in `sandstorm-pkgdef.capnp`. Look for this
@@ -154,9 +161,7 @@ automatically refreshes the IFRAME every 5 minutes.
154161

155162
* `forSharing`: **Boolean (optional)** true if this token should
156163
represent the anonymous user. You can use this to detach the token
157-
from the user who created it. **Note** that this also allows users
158-
to redeem it as a sharing link of the form
159-
`https://sandstorm.example.com/shared/$API_TOKEN`.
164+
from the user who created it.
160165

161166
* `clipboardButton`: **String (optional)** to display a copy-to-clipboard
162167
button in either the top left or top right corner of the `IFRAME`.

0 commit comments

Comments
 (0)