Struct bulwark_config::Plugin
source · pub struct Plugin {
pub reference: String,
pub path: String,
pub weight: f64,
pub config: Map<String, Value>,
pub permissions: Permissions,
}
Expand description
The configuration for an individual plugin.
This structure will be wrapped by structs in the host environment.
Fields§
§reference: String
The plugin reference key. Should be limited to ASCII lowercase a-z plus underscores. Maximum 96 characters.
path: String
The path to the plugin WASM file.
weight: f64
A weight to multiply this plugin’s decision values by.
A 1.0 value has no effect on the decision. See bulwark_decision::Decision::weight
.
config: Map<String, Value>
JSON-serializable configuration passed into the plugin environment.
The host environment will not do anything with this value beyond serialization.
permissions: Permissions
The permissions granted to this plugin.
Any attempt to perform an operation within the plugin sandbox that requires a permission to be set will fail.
Implementations§
source§impl Plugin
impl Plugin
sourcepub fn config_to_json(&self) -> Result<Vec<u8>, ConfigSerializationError>
pub fn config_to_json(&self) -> Result<Vec<u8>, ConfigSerializationError>
Serializes the config
value to JSON bytes.
Trait Implementations§
source§impl<'v_a> ValidateArgs<'v_a> for Plugin
impl<'v_a> ValidateArgs<'v_a> for Plugin
type Args = ()
fn validate_args(&self, args: Self::Args) -> Result<(), ValidationErrors>
Auto Trait Implementations§
impl RefUnwindSafe for Plugin
impl Send for Plugin
impl Sync for Plugin
impl Unpin for Plugin
impl UnwindSafe for Plugin
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more