Struct tame_gcs::signed_url::UrlSigner [−][src]
A generator for signed URLs, which can be used to grant temporary access to specific storage resources even if the client making the request is not otherwise logged in or normally able to access to the storage resources in question.
This implements the V4 signing process
Implementations
impl<D, S> UrlSigner<D, S> where
D: DigestCalulator,
S: Signer,
[src]
D: DigestCalulator,
S: Signer,
pub fn new(digester: D, signer: S) -> Self
[src]
Creates a new UrlSigner from a DigestCalculator
implementation
capable of generating SHA256 digests of buffers, and a Signer
capable of doing RSA-SHA256 encryption. You may implement these
on your own using whatever crates you prefer, or you can use the
signing
feature which will use the excellent ring
crate
to provide implementations.
pub fn generate<'a, K, OID>(
&self,
key_provider: &K,
id: &OID,
optional: SignedUrlOptional<'_>
) -> Result<Url, Error> where
K: KeyProvider,
OID: ObjectIdentifier<'a>,
[src]
&self,
key_provider: &K,
id: &OID,
optional: SignedUrlOptional<'_>
) -> Result<Url, Error> where
K: KeyProvider,
OID: ObjectIdentifier<'a>,
Generates a new signed url for the specified resource, using a key
provider. Note that this operation is entirely local, so though this
may succeed in generating a url, the actual operation using it may fail
if the account used to sign the URL does not have sufficient permissions
for the resource. For example, if you provided a GCP service account
that had devstorage.read_only permissions for the bucket/object, this method
would succeed in generating a signed url for a POST
operation, but the actual
POST
using that url would fail as the account does not itself have permissions
for the POST
operation.
Auto Trait Implementations
impl<D, S> RefUnwindSafe for UrlSigner<D, S> where
D: RefUnwindSafe,
S: RefUnwindSafe,
D: RefUnwindSafe,
S: RefUnwindSafe,
impl<D, S> Send for UrlSigner<D, S> where
D: Send,
S: Send,
D: Send,
S: Send,
impl<D, S> Sync for UrlSigner<D, S> where
D: Sync,
S: Sync,
D: Sync,
S: Sync,
impl<D, S> Unpin for UrlSigner<D, S> where
D: Unpin,
S: Unpin,
D: Unpin,
S: Unpin,
impl<D, S> UnwindSafe for UrlSigner<D, S> where
D: UnwindSafe,
S: UnwindSafe,
D: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,