pub struct OssCallbackVerifyLayer { /* private fields */ }Expand description
只支持 tokio + axum 验证成功会把oss发过来的body以String形式放在extensions里:VerifiedOssCallbackBody
Implementations§
Source§impl OssCallbackVerifyLayer
impl OssCallbackVerifyLayer
Sourcepub fn new(callback_url_path: &str) -> Self
pub fn new(callback_url_path: &str) -> Self
callback_url_path: 在设置callbackUrl时的路径部分
因为如果应用部署在代理如nginx后面,nginx可能会配置把路径前缀剥离掉; 或者axum如果是嵌套路由,那么在layer的service里看到的uri.path()也不是完整路径, 此时需要使用(如果路径没有被nginx等剥离)axum::extract::OriginalUri来获取完整路径。 为了简化起见,这里直接让用户传入callbackUrl里的路径部分
注意:传入的是没有经过url encode的原始路径
Trait Implementations§
Source§impl Clone for OssCallbackVerifyLayer
impl Clone for OssCallbackVerifyLayer
Source§fn clone(&self) -> OssCallbackVerifyLayer
fn clone(&self) -> OssCallbackVerifyLayer
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for OssCallbackVerifyLayer
impl !RefUnwindSafe for OssCallbackVerifyLayer
impl Send for OssCallbackVerifyLayer
impl Sync for OssCallbackVerifyLayer
impl Unpin for OssCallbackVerifyLayer
impl UnsafeUnpin for OssCallbackVerifyLayer
impl !UnwindSafe for OssCallbackVerifyLayer
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