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 and exits on the node’s denied port.
Sourcefn callout_error(&self, ctx: Context, message: String) -> PluginExecutionError
fn callout_error(&self, ctx: Context, message: String) -> PluginExecutionError
Builds a genuine infrastructure-failure Err (wolf-server unreachable,
timed out, or answering access_check with a status that is not an
authorization verdict). Unlike WolfRbacPlugin::reject, this exits
through the error port because the node never obtained a verdict.
Trait Implementations§
Source§impl Plugin for WolfRbacPlugin
impl Plugin for WolfRbacPlugin
Source§fn plugin_type(&self) -> &str
fn plugin_type(&self) -> &str
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
ctx: Context,
) -> Pin<Box<dyn Future<Output = Result<PluginOutput, PluginExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
ctx: Context,
) -> Pin<Box<dyn Future<Output = Result<PluginOutput, PluginExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn reads_response_body(&self) -> bool
fn reads_response_body(&self) -> bool
context.response.body. Read moreSource§fn cache_target(&self) -> Option<CacheTarget>
fn cache_target(&self) -> Option<CacheTarget>
proxy-cache half. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for WolfRbacPlugin
impl !UnwindSafe for WolfRbacPlugin
impl Freeze for WolfRbacPlugin
impl Send for WolfRbacPlugin
impl Sync for WolfRbacPlugin
impl Unpin for WolfRbacPlugin
impl UnsafeUnpin 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
§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>
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>
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