A loose implementation of Hawk Bewit in Kotlin multi-platform, supporting JVM, Android, iOS, and JavaScript.
While Hawk never gained wide traction as an HTTP authentication scheme, we still find common need for an S3-style URI authorization scheme, in which a URI can be:
-
signed to validate that it has not been tampered with, and
-
set to expire.
Hawk bewits serve this purpose well, without re-inventing the wheel.
However, this is a single-purpose library inspired by Hawk, not a full hawk-compatible implementation. Bewits generated by this library are not compatible with bewits generated by other Hawk-compatible libraries:
-
we do not implement the header-mode and the
dlg
,app
andext
attributes -
we do validate the URL scheme to protect against protocol downgrade attacks
-
the hawk version is set to
1a
, not1
to indicate incompatibility with Hawk
-
Sign resource links, like images, for temporary access from locations that do not support the underlying site auth protocol e.g. clipboards and external applications.
-
Sign links sent to users out of band e.g. emails.
-
Sign links sent to 3rd parties to easily access some resource for a limited time.
-
etc.