pub struct FsAuthProvider { /* private fields */ }
Available on crate feature
fs-backend
only.Implementations§
Source§impl FsAuthProvider
impl FsAuthProvider
pub fn new(config: Config) -> AuthResult<Self>
Trait Implementations§
Source§impl AuthProvider for FsAuthProvider
impl AuthProvider for FsAuthProvider
Source§fn auth_config<'life0, 'life1, 'async_trait>(
&'life0 self,
token_str: &'life1 str,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn auth_config<'life0, 'life1, 'async_trait>(
&'life0 self,
token_str: &'life1 str,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch of config.json.
type Config = Config
fn healthcheck<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn register<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = AuthResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn register<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = AuthResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Register a new user, returning a token if successful.
Source§fn list_owners<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_owner_list_is_public: &'life1 str,
crate_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = AuthResult<Vec<ListedOwner>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn list_owners<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_owner_list_is_public: &'life1 str,
crate_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = AuthResult<Vec<ListedOwner>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
List the owners of a crate.
Source§fn add_owners<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
token_str: &'life1 str,
users: &'life2 [&'life3 str],
crate_name: &'life4 str,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn add_owners<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
token_str: &'life1 str,
users: &'life2 [&'life3 str],
crate_name: &'life4 str,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Add a new owner to a crate.
Source§fn remove_owners<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
token_str: &'life1 str,
users: &'life2 [&'life3 str],
crate_name: &'life4 str,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn remove_owners<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
token_str: &'life1 str,
users: &'life2 [&'life3 str],
crate_name: &'life4 str,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Remove an owner from a crate.
Source§fn publish<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
token_str: &'life1 str,
crate_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn publish<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
token_str: &'life1 str,
crate_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Verify that a user has permission to publish new versions of a crate. Read more
Source§fn auth_yank<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
token_str: &'life1 str,
crate_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn auth_yank<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
token_str: &'life1 str,
crate_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Verify that a user has permission to yank or unyank versions of a crate.
Source§fn auth_index_fetch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
token_str: &'life1 str,
_all_users_can_read_crates: &'life2 str,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn auth_index_fetch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
token_str: &'life1 str,
_all_users_can_read_crates: &'life2 str,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Verify that a user is allowed to look at the index entry for a given crate. Read more
Source§fn auth_crate_download<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
token_str: &'life1 str,
_all_users_can_read_crates: &'life2 str,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn auth_crate_download<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
token_str: &'life1 str,
_all_users_can_read_crates: &'life2 str,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Verify that a user is allowed to download a given crate. Read more
Source§fn auth_view_full_index<'life0, 'life1, 'async_trait>(
&'life0 self,
token_str: &'life1 str,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn auth_view_full_index<'life0, 'life1, 'async_trait>(
&'life0 self,
token_str: &'life1 str,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Verify that a user is allowed to view the full index. Read more
fn token_from_headers<'h>( &self, headers: &'h HeaderMap, ) -> Result<Option<&'h str>, StatusCode>
Auto Trait Implementations§
impl !Freeze for FsAuthProvider
impl !RefUnwindSafe for FsAuthProvider
impl Send for FsAuthProvider
impl Sync for FsAuthProvider
impl Unpin for FsAuthProvider
impl UnwindSafe for FsAuthProvider
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