pub struct YesAuthProvider(/* private fields */);
Available on crate feature
yes-backend
only.Expand description
In the config specify auth_allow_full_access_without_any_checks: true
to give full access to the registry,
including crate publishing, to anyone who can connect to it.
Implementations§
Source§impl YesAuthProvider
impl YesAuthProvider
pub fn new(yes_config: Config) -> AuthResult<Self>
Trait Implementations§
Source§impl AuthProvider for YesAuthProvider
impl AuthProvider for YesAuthProvider
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,
_token: &'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,
_token: &'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: &'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: &'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: &'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: &'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: &'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: &'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: &'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: &'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_config<'life0, 'life1, 'async_trait>(
&'life0 self,
_token: &'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: &'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. Called only if the server is configured to do so.
Source§fn auth_index_fetch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_token: &'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_index_fetch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_token: &'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 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: &'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_crate_download<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_token: &'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 is allowed to download a given crate. Read more
Source§fn auth_view_full_index<'life0, 'life1, 'async_trait>(
&'life0 self,
_token: &'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: &'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 YesAuthProvider
impl RefUnwindSafe for YesAuthProvider
impl Send for YesAuthProvider
impl Sync for YesAuthProvider
impl Unpin for YesAuthProvider
impl UnwindSafe for YesAuthProvider
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