pub struct WolfRbacPlugin {
server: String,
appid: String,
header_prefix: String,
ssl_verify: bool,
timeout: Duration,
rejected_code: u16,
client: Arc<OutboundClient>,
}Expand description
Checks a wolf RBAC token against a wolf-server access_check endpoint.
Fields§
§server: Stringwolf-server base URL (e.g. http://127.0.0.1:12180).
appid: StringExpected application id; also used as a fallback when a token omits it.
header_prefix: StringPrefix prepended to the UserId/Username/Nickname response headers.
ssl_verify: boolWhether TLS certificates are verified on the callout.
timeout: DurationWhole-call deadline for the wolf-server callout.
rejected_code: u16Denial status code (401).
client: Arc<OutboundClient>Implementations§
Source§impl WolfRbacPlugin
impl WolfRbacPlugin
Sourcepub fn from_config(
config: &HashMap<String, Value>,
resources: &Arc<PluginResources>,
) -> Result<Self, String>
pub fn from_config( config: &HashMap<String, Value>, resources: &Arc<PluginResources>, ) -> Result<Self, String>
Builds the plugin from node config.
Accepted keys:
server(string, default"http://127.0.0.1:12180"): wolf-server base URL that/wolf/rbac/access_checkis called on.appid(string, default"unset"): application id used as theappIDrequest argument when a token carries none.header_prefix(string, default"X-"): prefix for the identity headers injected on an allowed request.ssl_verify(bool, defaultfalse): verify wolf-server’s TLS cert.timeout_ms(u64, default10000): callout deadline.
type: wolf-rbac
config:
server: http://wolf-server:12180
appid: restful
header_prefix: X-
ssl_verify: falseSourcefn reject(
&self,
ctx: Context,
message: &str,
) -> Result<PluginOutput, PluginExecutionError>
fn reject( &self, ctx: Context, message: &str, ) -> Result<PluginOutput, PluginExecutionError>
Builds a denial routed through the node’s error port.
Trait Implementations§
Source§impl Plugin for WolfRbacPlugin
impl Plugin for WolfRbacPlugin
Source§fn plugin_type(&self) -> &str
fn plugin_type(&self) -> &str
Unique identifier for the plugin type (e.g., “proxy-rewrite”, “upstream”).
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: Context,
_named_inputs: &'life1 HashMap<String, Value>,
) -> Pin<Box<dyn Future<Output = Result<PluginOutput, PluginExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: Context,
_named_inputs: &'life1 HashMap<String, Value>,
) -> Pin<Box<dyn Future<Output = Result<PluginOutput, PluginExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Executes the plugin logic against the request/response context. Read more
Auto Trait Implementations§
impl Freeze for WolfRbacPlugin
impl !RefUnwindSafe for WolfRbacPlugin
impl Send for WolfRbacPlugin
impl Sync for WolfRbacPlugin
impl Unpin for WolfRbacPlugin
impl UnsafeUnpin for WolfRbacPlugin
impl !UnwindSafe for WolfRbacPlugin
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more