Skip to content

Commit b57d05a

Browse files
committed
fix: lint
1 parent 540ca2d commit b57d05a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

sources/platform/actors/development/actor_definition/dataset_schema/validation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ async with Actor:
132132
except ApifyApiError as error:
133133
if 'invalidItems' in error.data:
134134
validation_errors = error.data['invalidItems']
135+
135136
```
136137
</TabItem>
137138
</Tabs>

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,12 @@ await datasetClient.update({
128128
Even when a resource is restricted, you might still want to share it with someone outside your team — for example, to send a PDF report to a client, or include a screenshot in an automated email or Slack message. In these cases, **storage resources** (like key-value stores, datasets, and request queues) support generating **pre-signed URLs**. These are secure, time-limited links that let others access individual files without needing an Apify account or authentication.
129129

130130
#### How pre-signed URLs work
131+
131132
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.
132133
When the signed URL is used, Apify validates the signature and grants temporary access only to the file or record it refers to - no API token required.
133134

134135
**Key properties**:
136+
135137
- **Works with restricted resources** – Even if “General resource access” is set to **Restricted**, the signed URL will work without asking for API token.
136138
**Time-limited (optional)** – Links can be either **temporary** (expiring after a specified duration) or **permanent**, depending on how they’re generated.
137139
**Lightweight** - Ideal for embedding in emails, webhooks, reports, or notifications where authentication isn’t possible.
@@ -162,11 +164,13 @@ the API response includes automatically generated fields:
162164
These automatically generated URLs are **valid for 14 days**.
163165

164166
The response also contains:
167+
165168
- `consoleUrl` - provides a stable link to the resource's page in the Apify Console. Unlike a direct API link, Console link will prompt unauthenticated users to sign in, ensuring they have required permissions to view the resource.
166169

167170
:::
168171

169172
#### How to generate pre-signed URLs
173+
170174
You can create pre-signed URLs either through the Apify Console or programmatically via the API or SDK.
171175

172176
**In console:**
@@ -181,7 +185,7 @@ The link will include a signature **only if the general resource access is set t
181185

182186
:::
183187

184-
- **Dataset items:**
188+
- **Dataset items:**
185189
1. Click the **Export** button.
186190
2. In the modal that appears, click **Copy shareable link**.
187191

@@ -199,6 +203,7 @@ The link will include a signature **only if the general resource access is set t
199203
You can generate pre-signed URLs programmatically for datasets and key-value stores:
200204

201205
- **Dataset items**
206+
202207
```js
203208
import { ApifyClient } from "apify-client";
204209
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
@@ -212,6 +217,7 @@ const permanentItemsUrl = await dataset.createItemsPublicUrl();
212217
```
213218

214219
- **Key-value store list of keys**
220+
215221
```js
216222
const store = client.keyValueStore('my-store-id');
217223

@@ -223,6 +229,7 @@ const permanentKeysPublicUrl = await store.createKeysPublicUrl();
223229
```
224230

225231
- **Key-value store list of keys**
232+
226233
```js
227234
// Get permanent URL for a single record
228235
const recordUrl = store.getRecordPublicUrl('report.pdf');
@@ -263,6 +270,7 @@ To test your public Actor, run it using an account with **General resource acces
263270
:::
264271

265272
In practice, this means that:
273+
266274
- All API requests made by your Actor must include a valid API token.
267275
- When using the Apify SDK or Apify Client, this is handled automatically.
268276
- Avoid relying on URLs that require unrestricted access or authentication by default.
@@ -275,6 +283,7 @@ Keep in mind that when users run your public Actor, the Actor makes API calls un
275283
:::
276284

277285
### How to migrate Actors to support **Restricted** general resource access
286+
278287
This section provides a practical guide and best practices to help you update your public Actors so they fully support **Restricted general resource access**.
279288

280289
---
@@ -285,13 +294,15 @@ All API requests from your Actor should use authenticated methods.
285294
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.
286295

287296
If your Actor makes direct API calls, include the API token manually:
297+
288298
```js
289299
const response = await fetch(`https://api.apify.com/v2/key-value-stores/${storeId}`, {
290300
headers: { Authorization: `Bearer ${process.env.APIFY_TOKEN}` },
291301
});
292302
```
293303

294304
#### 2. Generate pre-signed URLs for external sharing
305+
295306
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.
296307

297308
Pre-signed URLs allow secure, tokenless access for external users.
@@ -324,6 +335,7 @@ Unauthenticated users will be prompted to sign in, ensuring they have required p
324335
:::
325336

326337
#### Test your Actor under restricted access
338+
327339
Before publishing or updating your Actor, it’s important to verify that it works correctly for users with **restricted general resource access**.
328340

329341
You can easily test this by switching your own account’s setting to **Restricted**, or by creating an organization under your account and enabling restricted access there. This approach ensures your tests accurately reflect how your public Actor will behave for end users.

0 commit comments

Comments
 (0)