Struct jsonrpsee_core::server::access_control::AccessControl
source · pub struct AccessControl { /* private fields */ }
Expand description
Define access on control on HTTP layer.
Implementations§
source§impl AccessControl
impl AccessControl
sourcepub fn verify_host(&self, host: &str) -> Result<(), Error>
pub fn verify_host(&self, host: &str) -> Result<(), Error>
Validate incoming request by host.
host
is the return value from the host header
sourcepub fn verify_origin(&self, origin: Option<&str>, host: &str) -> Result<(), Error>
pub fn verify_origin(&self, origin: Option<&str>, host: &str) -> Result<(), Error>
Validate incoming request by origin.
host
is the return value from the host header
origin
is the value from the origin header
.
sourcepub fn verify_headers<T, I, II>(
&self,
header_names: I,
cors_request_headers: II
) -> Result<(), Error>where
T: AsRef<str>,
I: Iterator<Item = T>,
II: Iterator<Item = T>,
pub fn verify_headers<T, I, II>(
&self,
header_names: I,
cors_request_headers: II
) -> Result<(), Error>where
T: AsRef<str>,
I: Iterator<Item = T>,
II: Iterator<Item = T>,
Validate incoming request by CORS(access-control-request-headers
).
header_name: all keys of the header in the request
cors_request_headers: values of access-control-request-headers
headers.
sourcepub fn allowed_headers(&self) -> &AllowHeaders
pub fn allowed_headers(&self) -> &AllowHeaders
Return the allowed headers we’ve set
Trait Implementations§
source§impl Clone for AccessControl
impl Clone for AccessControl
source§fn clone(&self) -> AccessControl
fn clone(&self) -> AccessControl
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more