pub struct CargoVerifier { /* private fields */ }Expand description
crates.io namespace ownership verifier.
Verifies crate ownership by cross-referencing the crates.io owners API with the user’s verified GitHub platform claim.
Usage:
ⓘ
let verifier = CargoVerifier::new();
let challenge = verifier.initiate(&package, &did, &platform).await?;
let proof = verifier.verify(&package, &did, &platform, &challenge).await?;Implementations§
Source§impl CargoVerifier
impl CargoVerifier
Sourcepub fn with_base_url(base_url: Url) -> Self
pub fn with_base_url(base_url: Url) -> Self
Create a verifier with a custom base URL (for testing).
Args:
base_url: The base URL to use instead ofhttps://crates.io.
Trait Implementations§
Source§impl Default for CargoVerifier
impl Default for CargoVerifier
Source§impl NamespaceVerifier for CargoVerifier
impl NamespaceVerifier for CargoVerifier
Source§fn initiate<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
now: DateTime<Utc>,
package_name: &'life1 PackageName,
did: &'life2 CanonicalDid,
platform: &'life3 PlatformContext,
) -> Pin<Box<dyn Future<Output = Result<VerificationChallenge, NamespaceVerifyError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn initiate<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
now: DateTime<Utc>,
package_name: &'life1 PackageName,
did: &'life2 CanonicalDid,
platform: &'life3 PlatformContext,
) -> Pin<Box<dyn Future<Output = Result<VerificationChallenge, NamespaceVerifyError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Initiate a verification challenge for the given package. Read more
Source§fn verify<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
now: DateTime<Utc>,
package_name: &'life1 PackageName,
_did: &'life2 CanonicalDid,
platform: &'life3 PlatformContext,
_challenge: &'life4 VerificationChallenge,
) -> Pin<Box<dyn Future<Output = Result<NamespaceOwnershipProof, NamespaceVerifyError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn verify<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
now: DateTime<Utc>,
package_name: &'life1 PackageName,
_did: &'life2 CanonicalDid,
platform: &'life3 PlatformContext,
_challenge: &'life4 VerificationChallenge,
) -> Pin<Box<dyn Future<Output = Result<NamespaceOwnershipProof, NamespaceVerifyError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Verify the challenge was completed and return ownership proof. Read more
Auto Trait Implementations§
impl Freeze for CargoVerifier
impl !RefUnwindSafe for CargoVerifier
impl Send for CargoVerifier
impl Sync for CargoVerifier
impl Unpin for CargoVerifier
impl UnsafeUnpin for CargoVerifier
impl !UnwindSafe for CargoVerifier
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