pub struct HttpPolicyClient { /* private fields */ }Expand description
Evaluates policies through a policy server implementing the OPA REST
Data API: POST <base>/v1/data/<path> with {"input": ..}, answering
{"result": ..}.
A missing result (an undefined rule) yields JsonValue::Null. The
server URL is validated with the configured UrlPolicy on every call;
the default policy requires HTTPS and a public host, so a local sidecar
needs UrlPolicy::new().allow_http().allow_private_networks().
Implementations§
Source§impl HttpPolicyClient
impl HttpPolicyClient
Sourcepub fn builder(base_url: Url) -> HttpPolicyClientBuilder
pub fn builder(base_url: Url) -> HttpPolicyClientBuilder
Starts building a client for the server at base_url.
Sourcepub fn new(base_url: Url) -> Result<Self, PolicyError>
pub fn new(base_url: Url) -> Result<Self, PolicyError>
Creates a client with the default transport and URL policy.
§Errors
Returns PolicyError::Transport when the default transport cannot
be created.
Trait Implementations§
Source§impl Debug for HttpPolicyClient
impl Debug for HttpPolicyClient
Source§impl PolicyClient for HttpPolicyClient
impl PolicyClient for HttpPolicyClient
Auto Trait Implementations§
impl !RefUnwindSafe for HttpPolicyClient
impl !UnwindSafe for HttpPolicyClient
impl Freeze for HttpPolicyClient
impl Send for HttpPolicyClient
impl Sync for HttpPolicyClient
impl Unpin for HttpPolicyClient
impl UnsafeUnpin for HttpPolicyClient
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