Skip to content

Commit f7a1d26

Browse files
committed
initial commit
0 parents  commit f7a1d26

19 files changed

+1933
-0
lines changed

.credo.exs

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# This file contains the configuration for Credo and you are probably reading
2+
# this after creating it with `mix credo.gen.config`.
3+
#
4+
# If you find anything wrong or unclear in this file, please report an
5+
# issue on GitHub: https://github.com/rrrene/credo/issues
6+
#
7+
%{
8+
#
9+
# You can have as many configs as you like in the `configs:` field.
10+
configs: [
11+
%{
12+
#
13+
# Run any config using `mix credo -C <name>`. If no config name is given
14+
# "default" is used.
15+
name: "default",
16+
#
17+
# These are the files included in the analysis:
18+
files: %{
19+
#
20+
# You can give explicit globs or simply directories.
21+
# In the latter case `**/*.{ex,exs}` will be used.
22+
included: ["lib/", "src/", "web/", "apps/"],
23+
excluded: [~r"/_build/", ~r"/deps/"]
24+
},
25+
#
26+
# If you create your own checks, you must specify the source files for
27+
# them here, so they can be loaded by Credo before running the analysis.
28+
requires: [],
29+
#
30+
# Credo automatically checks for updates, like e.g. Hex does.
31+
# You can disable this behaviour below:
32+
check_for_updates: true,
33+
#
34+
# If you want to enforce a style guide and need a more traditional linting
35+
# experience, you can change `strict` to `true` below:
36+
strict: false,
37+
#
38+
# If you want to use uncolored output by default, you can change `color`
39+
# to `false` below:
40+
color: true,
41+
#
42+
# You can customize the parameters of any check by adding a second element
43+
# to the tuple.
44+
#
45+
# To disable a check put `false` as second element:
46+
#
47+
# {Credo.Check.Design.DuplicatedCode, false}
48+
#
49+
checks: [
50+
{Credo.Check.Consistency.ExceptionNames},
51+
{Credo.Check.Consistency.LineEndings},
52+
{Credo.Check.Consistency.MultiAliasImportRequireUse},
53+
{Credo.Check.Consistency.ParameterPatternMatching},
54+
{Credo.Check.Consistency.SpaceAroundOperators},
55+
{Credo.Check.Consistency.SpaceInParentheses},
56+
{Credo.Check.Consistency.TabsOrSpaces},
57+
58+
# For some checks, like AliasUsage, you can only customize the priority
59+
# Priority values are: `low, normal, high, higher`
60+
{Credo.Check.Design.AliasUsage, priority: :low},
61+
62+
# For others you can set parameters
63+
64+
# If you don't want the `setup` and `test` macro calls in ExUnit tests
65+
# or the `schema` macro in Ecto schemas to trigger DuplicatedCode, just
66+
# set the `excluded_macros` parameter to `[:schema, :setup, :test]`.
67+
{Credo.Check.Design.DuplicatedCode, excluded_macros: []},
68+
69+
# You can also customize the exit_status of each check.
70+
# If you don't want TODO comments to cause `mix credo` to fail, just
71+
# set this value to 0 (zero).
72+
{Credo.Check.Design.TagTODO, exit_status: 2},
73+
{Credo.Check.Design.TagFIXME},
74+
75+
{Credo.Check.Readability.FunctionNames},
76+
{Credo.Check.Readability.LargeNumbers},
77+
{Credo.Check.Readability.MaxLineLength, priority: :low, max_length: 85},
78+
{Credo.Check.Readability.ModuleAttributeNames},
79+
{Credo.Check.Readability.ModuleDoc},
80+
{Credo.Check.Readability.ModuleNames},
81+
{Credo.Check.Readability.ParenthesesOnZeroArityDefs},
82+
{Credo.Check.Readability.ParenthesesInCondition},
83+
{Credo.Check.Readability.PredicateFunctionNames},
84+
{Credo.Check.Readability.PreferImplicitTry},
85+
{Credo.Check.Readability.RedundantBlankLines},
86+
{Credo.Check.Readability.StringSigils},
87+
{Credo.Check.Readability.TrailingBlankLine},
88+
{Credo.Check.Readability.TrailingWhiteSpace},
89+
{Credo.Check.Readability.VariableNames},
90+
{Credo.Check.Readability.Semicolons},
91+
{Credo.Check.Readability.SpaceAfterCommas},
92+
93+
{Credo.Check.Refactor.DoubleBooleanNegation},
94+
{Credo.Check.Refactor.CondStatements},
95+
{Credo.Check.Refactor.CyclomaticComplexity},
96+
{Credo.Check.Refactor.FunctionArity, max_arity: 8},
97+
{Credo.Check.Refactor.MatchInCondition},
98+
{Credo.Check.Refactor.NegatedConditionsInUnless},
99+
{Credo.Check.Refactor.NegatedConditionsWithElse},
100+
{Credo.Check.Refactor.Nesting},
101+
{Credo.Check.Refactor.PipeChainStart},
102+
{Credo.Check.Refactor.UnlessWithElse},
103+
104+
{Credo.Check.Warning.BoolOperationOnSameValues},
105+
{Credo.Check.Warning.IExPry},
106+
{Credo.Check.Warning.IoInspect},
107+
{Credo.Check.Warning.OperationOnSameValues},
108+
{Credo.Check.Warning.OperationWithConstantResult},
109+
{Credo.Check.Warning.UnusedEnumOperation},
110+
{Credo.Check.Warning.UnusedFileOperation},
111+
{Credo.Check.Warning.UnusedKeywordOperation},
112+
{Credo.Check.Warning.UnusedListOperation},
113+
{Credo.Check.Warning.UnusedPathOperation},
114+
{Credo.Check.Warning.UnusedRegexOperation},
115+
{Credo.Check.Warning.UnusedStringOperation},
116+
{Credo.Check.Warning.UnusedTupleOperation},
117+
118+
# Controversial and experimental checks (opt-in, just remove `, false`)
119+
#
120+
{Credo.Check.Refactor.ABCSize, false},
121+
{Credo.Check.Refactor.AppendSingleItem, false},
122+
{Credo.Check.Refactor.VariableRebinding, false},
123+
{Credo.Check.Warning.MapGetUnsafePass, false},
124+
125+
# Deprecated checks (these will be deleted after a grace period)
126+
{Credo.Check.Readability.Specs, false},
127+
{Credo.Check.Warning.NameRedeclarationByAssignment, false},
128+
{Credo.Check.Warning.NameRedeclarationByCase, false},
129+
{Credo.Check.Warning.NameRedeclarationByDef, false},
130+
{Credo.Check.Warning.NameRedeclarationByFn, false},
131+
132+
# Custom checks can be created using `mix credo.gen.check`.
133+
#
134+
]
135+
}
136+
]
137+
}

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# The directory Mix will write compiled artifacts to.
2+
/_build
3+
4+
# If you run "mix test --cover", coverage assets end up here.
5+
/cover
6+
7+
# The directory Mix downloads your dependencies sources to.
8+
/deps
9+
10+
# Where 3rd-party dependencies like ExDoc output generated docs.
11+
/doc
12+
13+
# Ignore .fetch files in case you like to edit your project deps locally.
14+
/.fetch
15+
16+
# If the VM crashes, it generates a dump, let's ignore it too.
17+
erl_crash.dump
18+
19+
# Also ignore archive artifacts (built via "mix archive.build").
20+
*.ez
21+
22+
tags
23+
24+
/test/testsuite

LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright (c) 2017 handnot2 ([email protected])
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Sigaws
2+
3+
An Elixir library to sign and verify HTTP requests using AWS Signature V4.
4+
5+
## Installation
6+
7+
This package can be installed by adding `sigaws` to your list of dependencies
8+
in `mix.exs`:
9+
10+
```elixir
11+
def deps do
12+
[{:sigaws, "~> 0.1.0"}]
13+
end
14+
```
15+
16+
## Documentation
17+
18+
+ [Blog](https://handnot2.github.io/blog/elixir/aws-signature-sigaws)
19+
+ [Module Doc](https://hexdocs.pm/sigaws)
20+
+ [Plug built using this](https://hexdocs.pm/plug_sigaws)
21+
22+
## Test Suite
23+
24+
Part of the tests in this package rely on AWS Signature Version 4 Test Suite.
25+
This test suite should be downloaded and unpacked before running the tests.
26+
27+
```sh
28+
$ mkdir -p test/testsuite
29+
$ cd test/testsuite
30+
$ wget https://s3.amazonaws.com/awsdocs/aws-sig-v4-test-suite.zip
31+
$ unzip aws-sig-v4-test-suite.zip
32+
```

config/config.exs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file is responsible for configuring your application
2+
# and its dependencies with the aid of the Mix.Config module.
3+
use Mix.Config
4+
5+
# This configuration is loaded before any dependency and is restricted
6+
# to this project. If another project depends on this project, this
7+
# file won't be loaded nor affect the parent project. For this reason,
8+
# if you want to provide default values for your application for
9+
# 3rd-party users, it should be done in your "mix.exs" file.
10+
11+
# You can configure for your application as:
12+
#
13+
# config :sigaws, key: :value
14+
#
15+
# And access this configuration in your application as:
16+
#
17+
# Application.get_env(:sigaws, :key)
18+
#
19+
# Or configure a 3rd-party app:
20+
#
21+
# config :logger, level: :info
22+
#
23+
24+
# It is also possible to import configuration files, relative to this
25+
# directory. For example, you can emulate configuration per environment
26+
# by uncommenting the line below and defining dev.exs, test.exs and such.
27+
# Configuration from the imported file will override the ones defined
28+
# here (which is why it is important to import them last).
29+
#
30+
# import_config "#{Mix.env}.exs"

0 commit comments

Comments
 (0)