redbubble / finagle-hawk   0.3.0

BSD 3-clause "New" or "Revised" License GitHub

HTTP Holder-Of-Key Authentication Scheme for Finagle

Scala versions: 2.12

Build status

HAWK Support for Finagle/Finch

HTTP Holder-Of-Key Authentication Scheme (Hawk) support for Finagle.

Note that it currently doesn't support Response Payload Validation.

Almost all of this library is Finagle agnostic, only HawkAuthenticateRequestFilter is tied to Finagle.

If you like this, you might like other open source code from Redbubble:

  • rb-scala-utils - Miscellaneous utilities (common code) for building Scala-based services, using Finch (on which this project depends).
  • finch-template - A template project for Finch-based services.
  • rb-graphql-template - A template for Scala HTTP GraphQL services.
  • finch-sangria - A simple wrapper for using Sangria from within Finch;

Setup

You will need to add something like the following to your build.sbt:

resolvers += Resolver.jcenterRepo

libraryDependencies += "com.redbubble" %% "finagle-hawk" % "0.3.1"

Usage

val creds = Credentials(KeyId("Key ID"), Key("8e2dd2949b0e30c544336f73f94e2df3"), Sha256)

object AuthenticationFilter extends HawkAuthenticateRequestFilter(creds)

val authenticatedService = AuthenticationFilter andThen service

Release

For contributors, a cheat sheet to making a new release:

$ git commit -m "New things" && git push
$ git tag -a v0.0.3 -m "v0.0.3"
$ git push --tags
$ ./sbt publish

Contributing

Issues and pull requests are welcome. Code contributions should be aligned with the above scope to be included, and include unit tests.