pub struct ValidateGitHubWebhookLayer<Secret> { /* private fields */ }
Expand description
Layer that applies the ValidateGitHubWebhook middleware which authorizes all requests using
the X-Hub-Signature-256
header.
Implementations§
Source§impl<Secret> ValidateGitHubWebhookLayer<Secret>
impl<Secret> ValidateGitHubWebhookLayer<Secret>
Sourcepub fn new(webhook_secret: Secret) -> Self
pub fn new(webhook_secret: Secret) -> Self
Authorize requests using the X-Hub-Signature-256
header. If the signature specified in
that header is not signed using the webhook_secret
secret, the request will fail.
The webhook_secret
parameter can be any type that implements AsRef<[u8]>
such as
String
. However, using secrecy::SecretString
is recommended to prevent the secret from
being printed in any logs.
Trait Implementations§
Source§impl<Secret: Clone> Clone for ValidateGitHubWebhookLayer<Secret>
impl<Secret: Clone> Clone for ValidateGitHubWebhookLayer<Secret>
Source§fn clone(&self) -> ValidateGitHubWebhookLayer<Secret>
fn clone(&self) -> ValidateGitHubWebhookLayer<Secret>
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 moreSource§impl<S, Secret> Layer<S> for ValidateGitHubWebhookLayer<Secret>
impl<S, Secret> Layer<S> for ValidateGitHubWebhookLayer<Secret>
Auto Trait Implementations§
impl<Secret> Freeze for ValidateGitHubWebhookLayer<Secret>where
Secret: Freeze,
impl<Secret> RefUnwindSafe for ValidateGitHubWebhookLayer<Secret>where
Secret: RefUnwindSafe,
impl<Secret> Send for ValidateGitHubWebhookLayer<Secret>where
Secret: Send,
impl<Secret> Sync for ValidateGitHubWebhookLayer<Secret>where
Secret: Sync,
impl<Secret> Unpin for ValidateGitHubWebhookLayer<Secret>where
Secret: Unpin,
impl<Secret> UnwindSafe for ValidateGitHubWebhookLayer<Secret>where
Secret: UnwindSafe,
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