Skip to content

Commit d7a60a1

Browse files
authored
Update docs for resource capability of cel plugin (#297)
1 parent 8fa0df7 commit d7a60a1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/cel_plugin.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,24 @@ federationServer, err := federation.NewFederationService(federation.FederationSe
171171
})
172172
```
173173

174+
## Resource Capability
175+
176+
By default, plugins do not have access to Environment variables, File System, or Network. This helps to run plugins securely, but there may be cases where you want to allow access to these resources.
177+
In such cases, you can enable access to each resource by configuring as follows:
178+
179+
```proto
180+
option (grpc.federation.file).plugin.export = {
181+
name: "regexp"
182+
capability {
183+
network: {} // enable network access via HTTP/HTTPS
184+
env { names: ["foo"] } // enable access to `FOO` environment variable
185+
file_system { mount_path: "/" } // enable access to file system from mount point `/`
186+
}
187+
}
188+
```
189+
190+
For more details, please refer to the sample that uses this configuration in [_examples/21_wasm_net](../_examples/21_wasm_net/).
191+
174192
# How it works
175193

176194
Host and wasm plugin using stdio to exchange data.

0 commit comments

Comments
 (0)