• Stars
    star
    21
  • Rank 1,084,038 (Top 22 %)
  • Language
    Scala
  • License
    Apache License 2.0
  • Created almost 9 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Scala library to sign HTTP requests to AWS services.

NOTE: this project is deprecated in favor of a broader library for this and other AWS features. See here: https://github.com/aws4s/aws4s

AWS Request Signer

Helper to evaluate the signing headers for HTTP requests to Amazon Web Services. This is a Scala port of (part of) the Java aws-signing-request-interceptor.

I originally needed this library to support AWS' Elasticsearch Service, but this library is 'AWS service agnostic'.

Import via SBT

Currently available for scala 2.10, 2.11 and 2.12. In your build.sbt file,

resolvers += Resolver.jcenterRepo

libraryDependencies += "io.ticofab" %% "aws-request-signer" % "0.5.2"

Usage

The procedure to sign AWS Api requests is described on the official documentation. The idea is that each request must be signed through the evaluation of a hash which depends on the very request itself. The resulting string can then be added to the request either as a header or as a query param. This library focuses on the header way.

You first need to instantiate the signer, for example:

val awsCredentialProvider = new StaticCredentialsProvider(new BasicAWSCredentials("YOUR-ID", "YOUR-SECRET"))
val service = "es"
val region = "eu-central-1"
def clock(): LocalDateTime = LocalDateTime.now(ZoneId.of("UTC"))
val signer = io.ticofab.AwsSigner(awsCredentialProvider, region, service, clock)

Then use it for each request, via

def getSignedHeaders(uri: String,
                     method: String,
                     queryParams: Map[String, String],
                     headers: Map[String, String],
                     payload: Option[Array[Byte]]): Map[String, String]

Check the examples in the test folder of this project. Once you have the headers, add them to your HTTP request and fire it.

Implementations

aws-request-signer-proxy implements this package as a Dockerized proxy application, and provides an example integration with the Play framework.

Dependencies

License

Copyright 2016, 2017 Fabio Tiriticco - Fabway

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

More Repositories

1

android-gpx-parser

A library to parse XML Gpx files, built for Android.
Java
119
star
2

akka-cluster-kubernetes

Code for our talk about achieving elasticity with Akka Cluster and Kubernetes
Scala
33
star
3

play-scala-webjars-react

The React.js tutorial implemented using Play, Scala and Webjars. Accompanies a blog post.
Scala
29
star
4

simple-play-websocket-server

Example WebSocket server built with Scala and Play Framework.
Scala
29
star
5

deep-learning-with-scala

Repository for the talk 'From Zero To Deep Learning With Scala'
Scala
28
star
6

akka-http-websocket-example

Scala
20
star
7

reactive-pipeline-rsocket

Scala
11
star
8

play-scala-akka-example

Scala
9
star
9

codility-scala-lessons

Codility lessons implemented in Scala
Scala
7
star
10

reactive-kraken

Scala / Akka library for the Kraken exchange API.
Scala
7
star
11

cloudmatch

2019 version of my cloudmatch project
Scala
6
star
12

simple-websocket-client

A very simple html / javascript WebSocket client
6
star
13

akka-http-distributed-websockets

Distributed websockets with Akka Http, handled by remote actors.
Scala
6
star
14

The-Things-Network-Android-SDK

Android SDK to listen to information travelling on The Things Network
Java
4
star
15

scala-with-cats-exercises

Exercises in the book "Scala with Cats" - https://www.underscore.io/books/scala-with-cats/
Scala
3
star
16

speakertogether

Scala
2
star
17

Scala-RabbitMQ-Example

Scala client listening to a RabbitMQ queue.
Scala
2
star
18

android-websocket-test

Experiment with websockets on android
Java
2
star
19

cartaccia

A quick actor model example built for a friend (using Akka HTTP)
Scala
2
star
20

ActorDemo

Simple app to show the basics of Actor supervision and failure handling in Akka & Scala.
Scala
1
star
21

stream-thinking-workshop

Examples for a Stream Thinking Workshop with Akka Streams
Scala
1
star
22

scala-akka-streams-meetup

Scala Akka Streams example using meetup.com's streaming API
Scala
1
star
23

ticofab

1
star
24

cloudmatch_android_sdk

Embed CloudMatch in your app and enable device-to-device gesture communication.
Java
1
star
25

scala-jobs-processing-approaches

Four different approaches to Scala jobs processing: plain Scala, RxScala, Akka Actors, Akka Streams.
Scala
1
star
26

AkkaBackoffSupervisorExample

Akka Backoff Supervisor Example
Scala
1
star
27

akka-cluster-router-group-example

Example usage of Akka Cluster with ClusterRouterGroup.
Scala
1
star
28

MaterialNavigationDrawer

Example of putting together a NavigationDrawer following the Material Design guidelines. Using the support library for retrocompatibility.
Java
1
star
29

simple-play-scala-reactjs-refluxjs-server

An example of a server built using Scala, Play, WebJars, ReactJS and RefluxJS.
Scala
1
star