Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 96 additions & 7 deletions src/guides/build-iapp/inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@

## Input types overview

Inside the TEE, your iApp can work with four distinct categories of inputs:
Inside the TEE, your iApp can work with five distinct categories of inputs:

| Input Type | Visibility | Security Level | Purpose | How iApp Accesses It |
| --------------------- | ---------- | -------------- | ------------------------ | ---------------------- |
| **Protected Data** | Public | Encrypted | Data to be processed | Clear files in TEE |
| **Args** | Public | Clear | Configuration parameters | Command line arguments |
| **Input Files** | Public | Clear | Large datasets, models | Clear files in TEE |
| **Requester Secrets** | Private | Encrypted | User's sensitive data | Environment variables |
| Input Type | Visibility | Security Level | Purpose | How iApp Accesses It |
| --------------------- | ---------- | -------------- | -------------------------- | ---------------------- |
| **Protected Data** | Public | Encrypted | Data to be processed | Clear files in TEE |

Check notice on line 42 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L42

[Google.Passive] In general, use active voice instead of passive voice ('be processed').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('be processed').", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 42, "column": 65}}}, "severity": "INFO"}
| **Args** | Public | Clear | Configuration parameters | Command line arguments |

Check failure on line 43 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L43

[Vale.Terms] Use 'args' instead of 'Args'.
Raw output
{"message": "[Vale.Terms] Use 'args' instead of 'Args'.", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 43, "column": 5}}}, "severity": "ERROR"}
| **Input Files** | Public | Clear | Large datasets, models | Clear files in TEE |
| **Requester Secrets** | Private | Encrypted | User's sensitive data | Environment variables |
| **App Secrets** | Private | Encrypted | Developer's sensitive data | Environment variables |

## 1. Protected Data

Expand Down Expand Up @@ -356,6 +357,94 @@
});
```

## 5. App Secrets

Check warning on line 360 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L360

[Google.Headings] '5. App Secrets' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] '5. App Secrets' should use sentence-style capitalization.", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 360, "column": 4}}}, "severity": "WARNING"}

**What they are:** App Secrets are confidential data owned by the iApp developer

Check notice on line 362 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L362

[Google.Contractions] Use 'they're' instead of 'they are'.
Raw output
{"message": "[Google.Contractions] Use 'they're' instead of 'they are'.", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 362, "column": 8}}}, "severity": "INFO"}
that are provisioned during app deployment and made available to your iApp

Check notice on line 363 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L363

[Google.Passive] In general, use active voice instead of passive voice ('are provisioned').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('are provisioned').", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 363, "column": 6}}}, "severity": "INFO"}
during execution. They are stored securely in the Secret Management Service

Check notice on line 364 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L364

[Google.Contractions] Use 'they're' instead of 'They are'.
Raw output
{"message": "[Google.Contractions] Use 'they're' instead of 'They are'.", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 364, "column": 19}}}, "severity": "INFO"}

Check notice on line 364 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L364

[Google.Passive] In general, use active voice instead of passive voice ('are stored').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('are stored').", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 364, "column": 24}}}, "severity": "INFO"}
(SMS) and only accessible within the Trusted Execution Environment (TEE).

**When to use:** Use App Secrets for API keys, private keys, tokens, database
credentials, or any sensitive data that belongs to the app developer and needs
to be available to the iApp during execution. Unlike Requester Secrets (which
are provided by users), App Secrets are configured once by the developer and

Check notice on line 370 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L370

[Google.Passive] In general, use active voice instead of passive voice ('are provided').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('are provided').", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 370, "column": 1}}}, "severity": "INFO"}

Check notice on line 370 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L370

[Google.Passive] In general, use active voice instead of passive voice ('are configured').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('are configured').", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 370, "column": 37}}}, "severity": "INFO"}
remain constant across all executions.

::: info

App Secrets are different from Requester Secrets:

- **App Secrets**: Owned by the app developer, configured once during deployment
- **Requester Secrets**: Owned by the user executing the iApp, provided per
execution

:::

### How to Use App Secrets in Your iApp

Check warning on line 383 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L383

[Google.Headings] 'How to Use App Secrets in Your iApp' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'How to Use App Secrets in Your iApp' should use sentence-style capitalization.", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 383, "column": 5}}}, "severity": "WARNING"}

App Secrets are configured in your `iapp.config.json` during development and

Check notice on line 385 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L385

[Google.Passive] In general, use active voice instead of passive voice ('are configured').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('are configured').", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 385, "column": 13}}}, "severity": "INFO"}
automatically deployed with your iApp. For deployment details, see the
[Build Your iApp guide](/references/iapp-generator/building-your-iexec-app).

#### Configuration in iapp.config.json

Check failure on line 389 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L389

[Vale.Terms] Use 'iApp' instead of 'iapp'.
Raw output
{"message": "[Vale.Terms] Use 'iApp' instead of 'iapp'.", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 389, "column": 23}}}, "severity": "ERROR"}

Add your App Secret to the project configuration:

```json
{
"defaultChain": "arbitrum",
"projectName": "my-iapp",
"template": "JavaScript",
"appSecret": "{\"API_KEY\":\"sk-1234567890abcdef\",\"DATABASE_URL\":\"postgresql://user:pass@host:5432/db\"}"
}
```

::: warning

- **Size limit**: App secrets are limited to 4096 kB maximum

Check warning on line 404 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L404

[Google.Colons] ': A' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': A' should be in lowercase.", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 404, "column": 17}}}, "severity": "WARNING"}

Check notice on line 404 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L404

[Google.Passive] In general, use active voice instead of passive voice ('are limited').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('are limited').", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 404, "column": 31}}}, "severity": "INFO"}
- **Immutable**: Once set, app secrets cannot be changed without redeploying the

Check notice on line 405 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L405

[Google.Contractions] Use 'can't' instead of 'cannot'.
Raw output
{"message": "[Google.Contractions] Use 'can't' instead of 'cannot'.", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 405, "column": 40}}}, "severity": "INFO"}

Check notice on line 405 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L405

[Google.Passive] In general, use active voice instead of passive voice ('be changed').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('be changed').", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 405, "column": 47}}}, "severity": "INFO"}
iApp
- **Security**: App secrets are encrypted and only accessible within the TEE

Check notice on line 407 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L407

[Google.Passive] In general, use active voice instead of passive voice ('are encrypted').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('are encrypted').", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 407, "column": 29}}}, "severity": "INFO"}
environment
- **Ownership**: App secrets belong to the iApp developer, not the user
executing the iApp

:::

### How to Access App Secrets

Check warning on line 414 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L414

[Google.Headings] 'How to Access App Secrets' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'How to Access App Secrets' should use sentence-style capitalization.", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 414, "column": 5}}}, "severity": "WARNING"}

App secrets are exposed as environment variables following the `IEXEC_APP_DEVELOPER_SECRET` naming pattern.

Check notice on line 416 in src/guides/build-iapp/inputs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/inputs.md#L416

[Google.Passive] In general, use active voice instead of passive voice ('are exposed').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('are exposed').", "location": {"path": "src/guides/build-iapp/inputs.md", "range": {"start": {"line": 416, "column": 13}}}, "severity": "INFO"}

::: code-group

```python [Python]
import os
import json

# Get your app secret
app_secret = os.environ.get('IEXEC_APP_DEVELOPER_SECRET')

if app_secret:
# Parse JSON (multiple secrets)
secrets = json.loads(app_secret)
api_key = secrets.get('API_KEY')
database_url = secrets.get('DATABASE_URL')
```

```javascript [JavaScript]
// Get your app secret
const appSecret = process.env.IEXEC_APP_DEVELOPER_SECRET;

if (appSecret) {
// Parse JSON (multiple secrets)
const secrets = JSON.parse(appSecret);
const apiKey = secrets.API_KEY;
const databaseUrl = secrets.DATABASE_URL;
}
```

:::

## Testing Inputs Locally

Use iApp Generator to test different input types:
Expand Down
Loading