UrlSigner class final

Signs and verifies URLs with HMAC-SHA256 (Laravel URL::signedRoute).

The signature covers the path and query string (not the scheme/host), so links stay valid behind reverse proxies that rewrite the host; this is a documented deviation from Laravel, which signs the absolute URL.

Constructors

UrlSigner(List<int> key)
UrlSigner.fromAppKey(String appKey)
Builds a signer from an APP_KEY value (base64:... or raw text).
factory

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(String pathAndQuery, {DateTime? expires}) → String
Appends expires (optional) and signature to pathAndQuery.
toString() → String
A string representation of this object.
inherited
verify(Uri uri, {DateTime? now}) → bool
Whether uri carries a valid, unexpired signature.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

expiresParam → const String
signatureParam → const String