Examples
Plugin — Auth
Authorization plugin for the Propeller manager
The Auth plugin demonstrates how to extend the Propeller manager with custom authorization logic. It runs as a WASM plugin loaded by the manager and hooks into two lifecycle points:
authorize— validates whether a request is allowed based on the task name and user contextenrich— injects additional environment variables into the task before dispatch
This plugin is compiled to wasm32-wasip1 and loaded by the Propeller manager at startup via the PROPELLER_PLUGIN_PATH environment variable.
Source Code
The source code is available in the examples/plugin-auth directory.
Loading...
Plugin Behaviour
| Action | Rule |
|---|---|
create | Denied if user_id is empty |
start | Denied if user_id is empty, or if the task was created by a different user |
| other | Always allowed |
The enrich handler injects PROPELLER_PLUGIN_AUTHZ=plugin-auth and PROPELLER_CREATED_BY=<user_id> into the task environment.
Build
cd propeller
make plugin-authYour output should look like this:
mkdir -p build/plugins
cd examples/plugin-auth && cargo build --target wasm32-wasip1 --release
cp examples/plugin-auth/target/wasm32-wasip1/release/plugin_auth.wasm build/plugins/plugin-auth.wasmUse
Place the compiled .wasm file in a directory the manager can access and set the environment variable:
export PROPELLER_PLUGIN_PATH="/path/to/plugins/plugin-auth.wasm"On startup, the manager logs:
INFO Plugin loaded: plugin-auth (wasm32-wasip1)