StorageSignedUrlSigner class final
Creates and verifies time-limited URLs for private storage downloads.
The signature covers the HTTP method, path, expiration, and every non-signature query parameter. Callers should authorize the requested object before issuing a URL; possession of a valid URL grants temporary access to that exact request path on an application using the same secret.
Constructors
- StorageSignedUrlSigner(String secret)
-
Creates a HMAC-SHA256 signer from
secret.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sign(
Uri url, {required DateTime expiresAt, String method = 'GET'}) → Uri -
Adds an expiration and HMAC signature to
url. -
toString(
) → String -
A string representation of this object.
inherited
-
verify(
Uri url, {String method = 'GET', DateTime? now}) → bool -
Returns whether
urlhas a valid, unexpired signature formethod.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited