Skip to content
This repository has been archived by the owner on Aug 17, 2022. It is now read-only.
/ finagle-hawk Public archive

HTTP Holder-Of-Key Authentication Scheme for Finagle

License

Notifications You must be signed in to change notification settings

redbubble/finagle-hawk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.