Skip to content

Commit 57f3c96

Browse files
committed
refactor: clean up
1 parent 992f083 commit 57f3c96

File tree

1 file changed

+22
-29
lines changed

1 file changed

+22
-29
lines changed

sources/platform/collaboration/general-resource-access.md

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,9 @@ Even when a resource is restricted, you might still want to share it with someon
130130
#### How pre-signed URLs work
131131

132132
A pre-signed URL is a regular HTTPS link that includes a cryptographic signature verifying that access has been explicitly granted by someone with valid permissions.
133-
When the signed URL is used, Apify validates the signature and grants access - no API token required.
133+
When a pre-signed URL is used, Apify validates the signature and grants access without requiring an API token.
134134

135-
**Key properties**:
136-
137-
- **Works with restricted resources** – Even if “General resource access” is set to **Restricted**, the signed URL will work without asking for API token.
138-
- **Time-limited or permantent** – Links can be either **temporary** (expiring after a specified duration) or **permanent**, depending on how they’re generated.
135+
The signature can be temporary (set to expire after a specified duration) or permanent, depending on the expiration date set when it's generated.
139136

140137
#### What links can be pre-signed
141138

@@ -168,40 +165,38 @@ The response also contains:
168165

169166
:::
170167

171-
#### How to generate pre-signed URLs
172-
173168
You can create pre-signed URLs either through the Apify Console or programmatically via the Apify API client.
174169

175-
**In console:**
170+
#### How to generate pre-signed URLs in Apify Console
176171

177172
To generate a pre-signed link, you can use the **Export** button in Console, or call the appropriate API client method.
178173

179-
**1. Using the Apify Console**
180-
181174
:::note
182175

183176
The link will include a signature **only if the general resource access is set to Restricted**. For unrestricted datasets, the link will work without a signature.
184177

185178
:::
186179

187-
- **Dataset items:**
188-
1. Click the **Export** button.
189-
2. In the modal that appears, click **Copy shareable link**.
180+
**Dataset items:**
190181

191-
![Generating shareable link for a restricted storage resource](./images/general-resouce-access/copy-shareable-link.png)
182+
1. Click the **Export** button.
183+
2. In the modal that appears, click **Copy shareable link**.
192184

193-
- **Key-value store records:**
194-
1. Open a key-value store.
195-
2. Navigate to the record you want to share.
196-
3. In the **Actions** column, click the link icon to **copy signed link**.
185+
![Generating shareable link for a restricted storage resource](./images/general-resouce-access/copy-shareable-link.png)
197186

198-
![Copy pre-signed URL for KV store record](./images/general-resouce-access/copy-record-url-kv-store.png)
187+
**Key-value store records:**
199188

200-
**2. Using the Apify Client**
189+
1. Open a key-value store.
190+
2. Navigate to the record you want to share.
191+
3. In the **Actions** column, click the link icon to **copy signed link**.
192+
193+
![Copy pre-signed URL for KV store record](./images/general-resouce-access/copy-record-url-kv-store.png)
194+
195+
#### How to generate pre-signed URLs using Apify Client
201196

202197
You can generate pre-signed URLs programmatically for datasets and key-value stores:
203198

204-
- **Dataset items**
199+
**Dataset items**
205200

206201
```js
207202
import { ApifyClient } from "apify-client";
@@ -215,7 +210,7 @@ const itemsUrl = await dataset.createItemsPublicUrl({ expiresInSecs: 7 * 24 * 36
215210
const permanentItemsUrl = await dataset.createItemsPublicUrl();
216211
```
217212

218-
- **Key-value store list of keys**
213+
**Key-value store list of keys**
219214

220215
```js
221216
const store = client.keyValueStore('my-store-id');
@@ -227,7 +222,7 @@ const keysPublicUrl = await store.createKeysPublicUrl({ expiresInSecs: 24 * 3600
227222
const permanentKeysPublicUrl = await store.createKeysPublicUrl();
228223
```
229224

230-
- **Key-value store list of keys**
225+
**Key-value store record**
231226

232227
```js
233228
// Get permanent URL for a single record
@@ -240,7 +235,7 @@ If the `expiresInSecs` option is not specified, the generated link will be **per
240235

241236
:::
242237

243-
**3. Signing URLs manually (Advanced)**
238+
#### Signing URLs manually
244239

245240
If you need finer control - for example, generating links without using Apify client — you can sign URLs manually using our reference implementation.
246241

@@ -275,13 +270,13 @@ Keep in mind that when users run your public Actor, the Actor makes API calls un
275270

276271
:::
277272

278-
### How to migrate Actors to support **Restricted** general resource access
273+
### Migration guide to support restricted general resource access
279274

280275
This section provides a practical guide and best practices to help you update your public Actors so they fully support **Restricted general resource access**.
281276

282277
---
283278

284-
#### 1. Always authenticate API requests
279+
#### Always authenticate API requests
285280

286281
All API requests from your Actor should be authenticated.
287282
When using the [Apify SDK](https://docs.apify.com/sdk/js/) or [Apify Client](https://docs.apify.com/api/client/js/), this is done automatically.
@@ -294,12 +289,10 @@ If your Actor makes direct API calls, include the API token manually:
294289
});
295290
```
296291

297-
#### 2. Generate pre-signed URLs for external sharing
292+
#### Generate pre-signed URLs for external sharing
298293

299294
If your Actor outputs or shares links to storages (such as datasets or key-value store records), make sure to generate pre-signed URLs instead of hardcoding API URLs.
300295

301-
Pre-signed URLs allow secure, tokenless access for external users.
302-
303296
For example:
304297

305298
```js

0 commit comments

Comments
 (0)