Skip to content

Commit cac9ff3

Browse files
authored
docs: updates to input schema section (#1002)
update wording change blockquotes to notes reformat tables style changes
1 parent e73aff2 commit cac9ff3

File tree

3 files changed

+128
-100
lines changed

3 files changed

+128
-100
lines changed

sources/platform/actors/development/actor_definition/input_schema/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
22
title: Input schema
33
sidebar_position: 2
4-
description: Learn how to define and easily validate a schema for your Actor's input with code examples. Provide an autogenerated input UI for your Actor's users.
4+
description: Learn how to define and validate a schema for your Actor's input with code examples. Provide an autogenerated input UI for your Actor's users.
55
slug: /actors/development/actor-definition/input-schema
66
---
77

8-
**Learn how to define and easily validate a schema for your Actor's input with code examples. Provide an autogenerated input UI for your Actor's users.**
8+
**Learn how to define and validate a schema for your Actor's input with code examples. Provide an autogenerated input UI for your Actor's users.**
99

1010
---
1111

12-
Input schema describes the input of an Actor. It's a JSON object consisting of various field types supported by the Apify platform. The Apify platform then generates a user interface for the Actor and also validates the input passed to it when it's been started by the API or by using the Apify Console UI.
12+
The input schema defines the input parameters for an Actor. It's a `JSON` object comprising various field types supported by the Apify platform. Based on the input schema, the Apify platform automatically generates a user interface for the Actor. It also validates the input data passed to the Actor when it's executed through the API or the Apify Console UI.
1313

14-
This is an example of an **auto-generated UI** for [Website Content Crawler](https://apify.com/apify/website-content-crawler).
14+
The following is an example of an auto-generated UI for the [Website Content Crawler](https://apify.com/apify/website-content-crawler) Actor.
1515

1616
![Website Content Crawler input UI](./images/input-ui-website-content-crawler.png)
1717

18-
with an **input schema** defined this way:
18+
With an input schema defined as follows:
1919

2020
```json5
2121
{
@@ -78,4 +78,4 @@ The actual input object passed from the autogenerated input UI to the Actor then
7878
}
7979
```
8080

81-
The following chapters will guide you through the complete [input schema specification](./specification.md), and explain how you can also safely use the input schema to enable users to pass [secrets](./secret_input.md).
81+
Next, let's take a look at [input schema specification](./specification.md), and the possibility of using input schema to enable users to pass [secrets](./secret_input.md).

sources/platform/actors/development/actor_definition/input_schema/secret_input.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@ description: Learn about making some Actor input fields secret and encrypted. Id
44
slug: /actors/development/actor-definition/input-schema/secret-input
55
---
66

7-
# [](#secret-input)Secret input
8-
97
**Learn about making some Actor input fields secret and encrypted. Ideal for passing passwords, API tokens, or login cookies to Actors.**
108

119
---
1210

13-
The secret input feature allows you to mark some Actor input fields as secret, causing them to be encrypted when saving an input for an Actor. The input can then be decrypted only inside the Actor.
11+
The secret input feature lets you mark specific input fields of an Actor as sensitive. When you save the Actor's input configuration, the values of these marked fields get encrypted. The encrypted input data can only be decrypted within the Actor. This provides an extra layer of security for sensitive information like API keys, passwords, or other confidential data.
1412

15-
## Setting an input field as secret
13+
## How to set a secret input field
1614

17-
To make an input field secret, just add a `"isSecret": true` setting to the input field in the Actor's [input schema](./index.md), like this:
15+
To make an input field secret, you need to add a `"isSecret": true` setting to the input field in the Actor's [input schema](./index.md), like this:
1816

1917
<!-- eslint-skip -->
2018
```json
@@ -36,13 +34,18 @@ To make an input field secret, just add a `"isSecret": true` setting to the inpu
3634
```
3735

3836
The editor for this input field will then turn into a secret input, and when you edit the field value, it will be stored encrypted.
37+
3938
<img src={require("./images/secret-input-editor.png").default} alt="Secret input editor" style={{ width: '100%', maxWidth: '822px' }}/>
4039

40+
:::note Type restriction
41+
4142
This is only available for `string` inputs, and the editor type is limited to `textfield` or `textarea`.
4243

43-
## Reading secret input fields
44+
:::
4445

45-
When you read the Actor input through `Actor.getInput()`, the encrypted fields are automatically decrypted, without any additional code needed (starting with the [`apify` package](https://www.npmjs.com/package/apify) version 3.1.0).
46+
## Read secret input fields
47+
48+
When you read the Actor input through `Actor.getInput()`, the encrypted fields are automatically decrypted (starting with the [`apify` package](https://www.npmjs.com/package/apify) version 3.1.0).
4649

4750
<!-- eslint-skip -->
4851
```js
@@ -66,12 +69,12 @@ If you read the `INPUT` key from the Actor run's default key-value store directl
6669

6770
## Encryption mechanism
6871

69-
The encryption mechanism used for encrypting the secret input fields is the same dual encryption as in [PGP](https://en.wikipedia.org/wiki/Pretty_Good_Privacy#/media/File:PGP_diagram.svg).
72+
The encryption mechanism used for encrypting the secret input fields is the same dual encryption as in [PGP](https://en.wikipedia.org/wiki/Pretty_Good_Privacy#/media/File:PGP_diagram.svg). The secret input field is encrypted using a random key, using the `aes-256-gcm` cipher, and then the key is encrypted using a 2048-bit RSA key.
73+
74+
The RSA key is unique for each combination of user and Actor, ensuring that no Actor can decrypt input intended for runs of another Actor by the same user, and no user can decrypt input runs of the same Actor by a different user. This isolation of decryption keys enhances the security of sensitive input data.
7075

71-
The secret input field is encrypted using a random key, using the `aes-256-gcm` cipher, and then the key is encrypted using a 2048-bit RSA key.
72-
The RSA key is unique for every user and Actor combination. No Actor can decrypt input meant for runs of another Actor by the same user, and no user can decrypt input runs of the same Actor by a different user.
76+
During Actor execution, the decryption keys are passed as environment variables, restricting the decryption of secret input fields to occur solely within the context of the Actor run. This approach prevents unauthorized access to sensitive input data outside the Actor's execution environment.
7377

74-
The decryption keys are passed to the Actor runs as environment variables, so the input decryption happens only inside of the Actor run.
7578

7679
## Example Actor
7780

0 commit comments

Comments
 (0)