You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/v4/writing-apps.md
+31-5Lines changed: 31 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -516,16 +516,42 @@ and Spin will map all of your `security:http` imports to the matching exports fr
516
516
517
517
By default, dependencies do not have access to Spin resources that require permission to be given in the manifest - network hosts, key-value stores, SQLite databases, variables, etc.
518
518
519
-
If a component has a dependency which requires resource access, you can grant it by setting the `dependencies_inherit_configuration` flag in the Spin component manifest:
519
+
If a component has a dependency which requires resource access, you can grant it by setting the `inherit_configuration` flag on that dependency in the Spin component manifest, listing the capabilities you want to allow to the dependency:
The permission names are the same as the corresponding permission names in the manifest:
527
+
528
+
| Name | Description |
529
+
|------|-------------|
530
+
|`ai_models`| The dependency can use all LLMs listed in the component manifest. The dependency may use the [Serverless AI API](./serverless-ai-api-guide.md). |
531
+
|`allowed_outbound_hosts`| The dependency can make network requests to all hosts listed in the component manifest. The dependency may use the (outbound) sockets, [HTTP](./http-outbound.md), [MQTT](./mqtt-outbound.md), [MySQL](./rdbms-storage.md), [PostgreSQL](./rdbms-storage.md), and [Redis](./redis-outbound.md) APIs. |
532
+
|`environment`| The dependency can read all environment variables listed in the component manifest. |
533
+
|`files`| The dependency can read all files listed in the component manifest. |
534
+
|`key_value_stores`| The dependency can access all key-value stores listed in the component manifest. The dependency may use the [key-value API](./kv-store-api-guide.md). |
535
+
|`sqlite_databases`| The dependency can access all SQLite databases listed in the component manifest. The dependency may use the [SQLite API](./sqlite-api-guide.md). |
536
+
|`variables`| The dependency can read all Spin configuration variables listed in the component manifest. The dependency may use the [variables API](./variables.md). |
537
+
538
+
The dependency does not receive any permissions other than those you list.
539
+
540
+
If you want to grant the dependency the same permissions as the main component, set `inherit_configuration` to `true`:
541
+
542
+
```toml
543
+
[component.my-app.dependencies]
544
+
"highly:trusted/dependency" = { version = "1.0.0", inherit_configuration = true }
524
545
```
525
546
526
-
This grants _all_ dependencies access to _all_resources listed in the Spin component manifest. You should therefore set this only if you trust _all_ dependencies.
547
+
If you want to grant _all_dependencies the same permissions as the parent component, you can set `dependencies_inherit_configuration = true` at the component level:
527
548
528
-
> Spin does not currently support inheritance on a dependency-by-dependency or feature-by-feature basis.
549
+
```toml
550
+
[component.my-app]
551
+
dependencies_inherit_configuration = true
552
+
[component.my-app.dependencies]
553
+
"my:dependency" = "1.0.0"# has all capabilities of the main component
0 commit comments