Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: AdRoll/erliam
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.4.0
Choose a base ref
...
head repository: AdRoll/erliam
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.4.1
Choose a head ref
  • 17 commits
  • 11 files changed
  • 2 contributors

Commits on Jun 14, 2021

  1. Update dependencies (#19)

    Co-authored-by: RTB CI Bot <[email protected]>
    Brujo Benavides and adroll-rtb-ci authored Jun 14, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    89d0555 View commit details

Commits on Jun 28, 2021

  1. Update dependencies (#20)

    Co-authored-by: RTB CI Bot <[email protected]>
    Brujo Benavides and adroll-rtb-ci authored Jun 28, 2021
    Copy the full SHA
    71f1e44 View commit details

Commits on Jul 6, 2021

  1. Restore warnings_as_errors (#21)

    Brujo Benavides authored Jul 6, 2021
    Copy the full SHA
    fd4c6d3 View commit details

Commits on Jul 12, 2021

  1. Update dependencies (#22)

    Co-authored-by: RTB CI Bot <[email protected]>
    Brujo Benavides and adroll-rtb-ci authored Jul 12, 2021
    Copy the full SHA
    6ce20ba View commit details

Commits on Aug 10, 2021

  1. Update dependencies (#23)

    Co-authored-by: RTB CI Bot <[email protected]>
    Brujo Benavides and adroll-rtb-ci authored Aug 10, 2021
    Copy the full SHA
    e4d293a View commit details

Commits on Aug 13, 2021

  1. Move from Travis to Github Actions (#24)

    Brujo Benavides authored Aug 13, 2021
    Copy the full SHA
    c48d5ed View commit details

Commits on Sep 13, 2021

  1. Update dependencies (#25)

    Co-authored-by: RTB CI Bot <[email protected]>
    Brujo Benavides and adroll-rtb-ci authored Sep 13, 2021
    Copy the full SHA
    489adb5 View commit details

Commits on Sep 20, 2021

  1. Update dependencies (#26)

    Co-authored-by: RTB CI Bot <[email protected]>
    Brujo Benavides and adroll-rtb-ci authored Sep 20, 2021
    Copy the full SHA
    ef7891c View commit details

Commits on Sep 27, 2021

  1. Update dependencies (#27)

    Co-authored-by: RTB CI Bot <[email protected]>
    Brujo Benavides and adroll-rtb-ci authored Sep 27, 2021
    Copy the full SHA
    3d36744 View commit details

Commits on Oct 4, 2021

  1. Update dependencies (#28)

    Co-authored-by: RTB CI Bot <[email protected]>
    Brujo Benavides and adroll-rtb-ci authored Oct 4, 2021
    Copy the full SHA
    2c56482 View commit details

Commits on Oct 13, 2021

  1. Update dependencies (#29)

    Co-authored-by: RTB CI Bot <[email protected]>
    Brujo Benavides and adroll-rtb-ci authored Oct 13, 2021
    Copy the full SHA
    3e9a111 View commit details

Commits on Oct 25, 2021

  1. Update dependencies (#30)

    Co-authored-by: RTB CI Bot <[email protected]>
    Brujo Benavides and adroll-rtb-ci authored Oct 25, 2021
    Copy the full SHA
    8adce91 View commit details

Commits on Dec 20, 2021

  1. Update dependencies (#31)

    Co-authored-by: RTB CI Bot <[email protected]>
    Brujo Benavides and adroll-rtb-ci authored Dec 20, 2021
    Copy the full SHA
    9ace9cf View commit details

Commits on Dec 22, 2021

  1. Add rebar3_sheldon to spell-check our code (#32)

    Brujo Benavides authored Dec 22, 2021
    Copy the full SHA
    d1f53b3 View commit details

Commits on Dec 28, 2021

  1. Update dependencies (#33)

    Co-authored-by: RTB CI Bot <[email protected]>
    Brujo Benavides and adroll-rtb-ci authored Dec 28, 2021
    Copy the full SHA
    8627fe7 View commit details

Commits on Jan 4, 2022

  1. Update dependencies (#34)

    Co-authored-by: RTB CI Bot <[email protected]>
    Brujo Benavides and adroll-rtb-ci authored Jan 4, 2022
    Copy the full SHA
    7b0e557 View commit details

Commits on Mar 1, 2022

  1. Update dependencies (#35)

    Co-authored-by: RTB CI Bot <[email protected]>
    Brujo Benavides and adroll-rtb-ci authored Mar 1, 2022
    Copy the full SHA
    59ade39 View commit details
Showing with 155 additions and 45 deletions.
  1. +38 −0 .github/workflows/erlang.yml
  2. +0 −18 .travis.yml
  3. +29 −0 aws.dict
  4. +21 −0 nextroll.dict
  5. +14 −7 rebar.config
  6. +3 −3 rebar.lock
  7. +4 −4 src/awsv4.erl
  8. +2 −2 src/erliam_srv.erl
  9. +14 −8 src/erliam_xml.erl
  10. +1 −3 src/imds.erl
  11. +29 −0 test.dict
38 changes: 38 additions & 0 deletions .github/workflows/erlang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Erlang CI

on: [push, pull_request]

jobs:

build:

runs-on: ubuntu-latest

strategy:
matrix:
otp: ['23.3']
rebar: ['3.16.1']

steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
id: setup-beam
with:
otp-version: ${{matrix.otp}}
rebar3-version: ${{matrix.rebar}}
- name: Restore _build
uses: actions/cache@v2
with:
path: _build
key: _build-cache-for-os-${{runner.os}}-otp-${{steps.setup-beam.outputs.otp-version}}-rebar3-${{steps.setup-beam.outputs.rebar3-version}}-hash-${{hashFiles('rebar.lock')}}
- name: Restore rebar3's cache
uses: actions/cache@v2
with:
path: ~/.cache/rebar3
key: rebar3-cache-for-os-${{runner.os}}-otp-${{steps.setup-beam.outputs.otp-version}}-rebar3-${{steps.setup-beam.outputs.rebar3-version}}-hash-${{hashFiles('rebar.lock')}}
- name: Compile
run: rebar3 compile
- name: Format check
run: rebar3 format --verify
- name: Run tests and verifications
run: rebar3 test
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

29 changes: 29 additions & 0 deletions aws.dict
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
amazonaws.com
access_key_id
accesskeyid
aws
aws4
aws4-hmac-sha256
aws4_request
aws_access_key
aws_secret_key
awsv4
content-length
content-type
errorformat
getsessiontoken
iam
imds
instance-id
public-hostname
request_id
s3
secret_access_key
secretaccesskey
session_token
sts
sts.amazonaws.com
us-east-1
x-amz-date
x-amz-security-token
x-amz-target
21 changes: 21 additions & 0 deletions nextroll.dict
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
%
adroll
api
args
bsd-3-clause
erlang
erliam.hrl
ets
fixme
gen_server
http
json
m:f
metadata
non-text
params
proplist
uri
url
utf-8
xml
21 changes: 14 additions & 7 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
% -*- mode: erlang -*-
{erl_opts,
[warn_unused_vars,
warn_export_all,
@@ -12,15 +11,16 @@
strict_validation,
warn_export_vars,
warn_exported_vars,
warnings_as_errors,
debug_info]}.

{minimum_otp_vsn, "20"}.
{minimum_otp_vsn, "23"}.

{cover_enabled, true}.

{cover_opts, [verbose]}.

{deps, [{jiffy, "1.0.8"}]}.
{deps, [{jiffy, "1.1.1"}]}.

{dialyzer,
[{warnings, [no_return, error_handling]},
@@ -36,10 +36,17 @@
deprecated_function_calls,
deprecated_functions]}.

{spellcheck,
[{ignore_regex,
"(eunit|=|00Z$|YYYY|yyyy|/|\\d[.]\\d|\\d\\d-\\d|:\\d\\d:|[\"][:]|[a-z][()]|[&][a-z]|<[/A-z]|[[])"},
{files, ["src/*", "include/*"]},
{additional_dictionaries, ["test.dict", "nextroll.dict", "aws.dict"]}]}.

{alias, [{test, [format, lint, hank, xref, dialyzer, eunit, cover]}]}.

{project_plugins,
[{rebar3_hex, "~> 6.11.4"},
{rebar3_format, "~> 1.0.0"},
{rebar3_lint, "~> 0.4.0"},
{rebar3_hank, "~> 1.1.2"}]}.
[{rebar3_hex, "~> 7.0.1"},
{rebar3_format, "~> 1.0.1"},
{rebar3_lint, "~> 1.0.1"},
{rebar3_hank, "~> 1.2.2"},
{rebar3_sheldon, "~> 0.4.2"}]}.
6 changes: 3 additions & 3 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{"1.2.0",
[{<<"jiffy">>,{pkg,<<"jiffy">>,<<"1.0.8">>},0}]}.
[{<<"jiffy">>,{pkg,<<"jiffy">>,<<"1.1.1">>},0}]}.
[
{pkg_hash,[
{<<"jiffy">>, <<"60E36F00BE35E5AC6E6CF2D4CAF3BDF3103D4460AFF385F543A8D7DF2D6D9613">>}]},
{<<"jiffy">>, <<"ACA10F47AA91697BF24AB9582C74E00E8E95474C7EF9F76D4F1A338D0F5DE21B">>}]},
{pkg_hash_ext,[
{<<"jiffy">>, <<"F9AE986BA5A0854EB48CF6A76192D9367086DA86C20197DA430630BE7C087A4E">>}]}
{<<"jiffy">>, <<"62E1F0581C3C19C33A725C781DFA88410D8BFF1BBAFC3885A2552286B4785C4C">>}]}
].
8 changes: 4 additions & 4 deletions src/awsv4.erl
Original file line number Diff line number Diff line change
@@ -218,7 +218,7 @@ should_encode(X, Kind) ->
path ->
[]
end,
%% note: does not encode gen-delims ()
%% note: does not encode generic delimiters ()
X > 127 orelse X < 33 orelse lists:member(X, "!$&'()*+,;=" ++ ExtraChars).

hexlify(Bin) ->
@@ -289,7 +289,7 @@ basic_headers_test() ->
?assertEqual(Expected, Actual).

aws4_example1_test() ->
%% get-vanilla-query-order-key-case from aws4 test suite
%% get-vanilla-query-order-key-case from AWSv4 test suite
Actual =
flattened_headers([#credentials{secret_access_key =
"wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY",
@@ -313,7 +313,7 @@ aws4_example1_test() ->
?assertEqual(Expected, Actual).

aws4_example2_test() ->
%% post-vanilla-query from aws4 test suite
%% post-vanilla-query from AWSv4 test suite
Actual =
flattened_headers([#credentials{secret_access_key =
"wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY",
@@ -338,7 +338,7 @@ aws4_example2_test() ->
?assertEqual(Expected, Actual).

aws4_example3_test() ->
%% get-unreserved from aws4 test suite
%% get-unreserved from AWSv4 test suite
Actual =
flattened_headers([#credentials{secret_access_key =
"wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY",
4 changes: 2 additions & 2 deletions src/erliam_srv.erl
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@
%%% @doc
%%%
%%% Server which creates and maintains an ets table containing aws credentials for use
%%% by other processes. Refreshes the credentials ?MIN_LIFETIME seconds before
%%% expiration.
%%% by other processes. Refreshes the credentials several seconds before
%%% expiration (according to what's specified as credential_min_lifetime in the configuration).
%%%
%%% @end
%%% Created : 2 Jun 2017 by Mike Watters <mike.watters@adroll.com>
22 changes: 14 additions & 8 deletions src/erliam_xml.erl
Original file line number Diff line number Diff line change
@@ -67,14 +67,20 @@ unescape_xml_text(X, [{C, R} | T]) ->

basic_decode_test() ->
Data =
<<"<GetSessionTokenResponse xmlns=\"https://sts.amazonaws.com/doc/2011-"
"06-15/\">\n <GetSessionTokenResult>\n <Credentials>\n "
" <AccessKeyId>ACCESS_KEY_ID</AccessKeyId>\n <SecretAccessKey>SECR"
"ET_ACCESS_KEY</SecretAccessKey>\n <SessionToken>SESSION_TOKEN</Se"
"ssionToken>\n <Expiration>EXPIRATION</Expiration>\n </Credentia"
"ls>\n </GetSessionTokenResult>\n <ResponseMetadata>\n <RequestId"
">REQUEST_ID</RequestId>\n </ResponseMetadata>\n </GetSessionTokenRe"
"sponse>\n">>,
<<"<GetSessionTokenResponse"
" xmlns=\"https://sts.amazonaws.com/doc/2011-06-15/\">\n"
" <GetSessionTokenResult>\n"
" <Credentials>\n"
" <AccessKeyId>ACCESS_KEY_ID</AccessKeyId>\n"
" <SecretAccessKey>SECRET_ACCESS_KEY</SecretAccessKey>\n"
" <SessionToken>SESSION_TOKEN</SessionToken>\n"
" <Expiration>EXPIRATION</Expiration>\n"
" </Credentials>\n"
" </GetSessionTokenResult>\n"
" <ResponseMetadata>\n"
" <RequestId>REQUEST_ID</RequestId>\n"
" </ResponseMetadata>\n"
" </GetSessionTokenResponse>\n">>,
?assertEqual({'GetSessionTokenResponse',
[{'GetSessionTokenResult',
[{'Credentials',
4 changes: 1 addition & 3 deletions src/imds.erl
Original file line number Diff line number Diff line change
@@ -4,8 +4,6 @@
%%% Helper module for obtaining information from an instance metadata server.
%%%
%%% @end
%%% Created : 17 Oct 2014 by Mike Watters <mike.watters@adroll.com>

-module(imds).

-export([role_name/0, zone/0, instance_id/0, public_hostname/0, get_session_token/0,
@@ -90,7 +88,7 @@ imds_response(Url, MimeTypes, Timeout, Retries) ->

%%%% INTERNAL FUNCTIONS

%% Call the given arity-1 Transform function with the result of a successful call to
%% Call the given Transform function with the result of a successful call to
%% imds_response/4, or return the error which resulted from that call.
-spec imds_transform_response(string(), [string()], function()) ->
{error, term()} | term().
29 changes: 29 additions & 0 deletions test.dict
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
20140629t022822z
3fc9b689459d738f8c88a3a48aa9e33542016b7a4052e001aaa536fca74813cb
4_request
7f28c66
8af7f11
abcdefghijklmnopqrstuvwxyz
accesskey
akidexample
bazzle
bf5f24f
cdf2500
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
example.amazonaws.com
flooble
get-unreserved
get-vanilla-query-order-key-case
kinesis.us-east-1.amazonaws.com
kinesis_20131202.liststreams
param1
param2
post-vanilla-query
secretkey
securitytoken
value1
value2
ws4_request
x-amz-content-sha256
x-yzzy
xyzzy