pub trait AuthorizationProvider: DynClone + Debug + Sync + Send {
    // Required methods
    fn sign(
        &self,
        request: &mut Request<'_, RequestBody<'_>>
    ) -> Result<(), AuthorizationError>;
    fn async_sign<'a>(
        &'a self,
        request: &'a mut Request<'_, AsyncRequestBody<'_>>
    ) -> Pin<Box<dyn Future<Output = Result<(), AuthorizationError>> + Send + 'a, Global>>;
}
Expand description

七牛鉴权签名接口

对 HTTP 请求进行签名

Required Methods§

fn sign( &self, request: &mut Request<'_, RequestBody<'_>> ) -> Result<(), AuthorizationError>

使用指定的鉴权方式对 HTTP 请求进行签名

该方法的异步版本为 Self::async_sign

fn async_sign<'a>( &'a self, request: &'a mut Request<'_, AsyncRequestBody<'_>> ) -> Pin<Box<dyn Future<Output = Result<(), AuthorizationError>> + Send + 'a, Global>>

使用指定的鉴权方式对异步 HTTP 请求进行签名

Implementations on Foreign Types§

§

impl<T> AuthorizationProvider for Box<T, Global>where T: AuthorizationProvider + ?Sized, Box<T, Global>: DynClone + Debug + Sync + Send,

§

fn sign( &self, request: &mut Request<'_, RequestBody<'_>> ) -> Result<(), AuthorizationError>

§

fn async_sign<'a>( &'a self, request: &'a mut Request<'_, AsyncRequestBody<'_>> ) -> Pin<Box<dyn Future<Output = Result<(), AuthorizationError>> + Send + 'a, Global>>

§

impl<T> AuthorizationProvider for Arc<T>where T: AuthorizationProvider + ?Sized, Arc<T>: DynClone + Debug + Sync + Send,

§

fn sign( &self, request: &mut Request<'_, RequestBody<'_>> ) -> Result<(), AuthorizationError>

§

fn async_sign<'a>( &'a self, request: &'a mut Request<'_, AsyncRequestBody<'_>> ) -> Pin<Box<dyn Future<Output = Result<(), AuthorizationError>> + Send + 'a, Global>>

§

impl<'b, T> AuthorizationProvider for &'b mut Twhere T: 'b + AuthorizationProvider + ?Sized, &'b mut T: DynClone + Debug + Sync + Send,

§

fn sign( &self, request: &mut Request<'_, RequestBody<'_>> ) -> Result<(), AuthorizationError>

§

fn async_sign<'a>( &'a self, request: &'a mut Request<'_, AsyncRequestBody<'_>> ) -> Pin<Box<dyn Future<Output = Result<(), AuthorizationError>> + Send + 'a, Global>>

§

impl<T> AuthorizationProvider for Rc<T>where T: AuthorizationProvider + ?Sized, Rc<T>: DynClone + Debug + Sync + Send,

§

fn sign( &self, request: &mut Request<'_, RequestBody<'_>> ) -> Result<(), AuthorizationError>

§

fn async_sign<'a>( &'a self, request: &'a mut Request<'_, AsyncRequestBody<'_>> ) -> Pin<Box<dyn Future<Output = Result<(), AuthorizationError>> + Send + 'a, Global>>

§

impl<'b, T> AuthorizationProvider for &'b Twhere T: 'b + AuthorizationProvider + ?Sized, &'b T: DynClone + Debug + Sync + Send,

§

fn sign( &self, request: &mut Request<'_, RequestBody<'_>> ) -> Result<(), AuthorizationError>

§

fn async_sign<'a>( &'a self, request: &'a mut Request<'_, AsyncRequestBody<'_>> ) -> Pin<Box<dyn Future<Output = Result<(), AuthorizationError>> + Send + 'a, Global>>

Implementors§

§

impl AuthorizationProvider for Authorization<'_>

§

impl<P> AuthorizationProvider for CredentialAuthorizationV1<P>where P: CredentialProvider + Clone,

§

impl<P> AuthorizationProvider for CredentialAuthorizationV2<P>where P: CredentialProvider + Clone,

§

impl<P> AuthorizationProvider for DownloadUrlCredentialAuthorization<P>where P: CredentialProvider + Clone,

§

impl<P> AuthorizationProvider for UploadTokenAuthorization<P>where P: UploadTokenProvider + Clone,