Skip to content

Commit

Permalink
Update documentation, linting, and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonVides committed Dec 18, 2024
1 parent ade985d commit 0c33dc7
Show file tree
Hide file tree
Showing 13 changed files with 1,124 additions and 810 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,28 @@ jobs:
name: OTP ${{matrix.otp}}
strategy:
matrix:
otp: ['26.2', '25.3', '24.3']
rebar3: ['3.22.1']
runs-on: 'ubuntu-22.04'
otp: ['27', 26', '25']
rebar3: ['3.24.0']
runs-on: 'ubuntu-24.04'
env:
OTPVER: ${{ matrix.otp }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
rebar3-version: ${{matrix.rebar3}}
- run: rebar3 fmt --check
- run: rebar3 lint
- run: rebar3 do ct --cover
- run: rebar3 as test codecov analyze
- run: rebar3 dialyzer
if: ${{ matrix.otp == '26.2' }}
- uses: codecov/codecov-action@v3
name: Upload coverage reports to Codecov
if: ${{ matrix.otp == '26.2' }}
if: ${{ matrix.otp == '27' }}
- name: Upload code coverage
uses: codecov/codecov-action@v4
if: ${{ matrix.otp == '27' }}
with:
files: _build/test/covertool/fast_scram.covertool.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true # optional (default = false)
fail_ci_if_error: true
verbose: true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ rebar3.crashdump
*.vim
tags
priv/

doc/
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![Actions Status](https://github.com/esl/fast_scram/workflows/ci/badge.svg)](https://github.com/esl/fast_scram/actions)
[![codecov](https://codecov.io/gh/esl/fast_scram/branch/master/graph/badge.svg)](https://codecov.io/gh/esl/fast_scram)
[![Hex](http://img.shields.io/hexpm/v/fast_scram.svg)](https://hex.pm/packages/fast_scram)
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/fast_scram/)

`fast_scram` is a purely-functional Erlang implementation of the _Salted Challenge Response Authentication Mechanism_, where the challenge algorithm is implemented as a carefully-optimised NIF using [fast_pbkdf2][fast_pbkdf2].

Expand Down Expand Up @@ -235,7 +236,7 @@ If for any particular reason you want to skip compiling and loading custom NIFs,
* SCRAM: [RFC5802](https://tools.ietf.org/html/rfc5802)
* SCRAM-SHA-256 update: [RFC7677](https://tools.ietf.org/html/rfc7677)
* Password-Based Cryptography Specification (PBKDF2): [RFC8018](https://tools.ietf.org/html/rfc8018)
* HMAC: [RFC2104]( https://tools.ietf.org/html/rfc2104)
* HMAC: [RFC2104](https://tools.ietf.org/html/rfc2104)
* SHAs and HMAC-SHA: [RFC6234](https://tools.ietf.org/html/rfc6234)
[MIM]: https://github.com/esl/MongooseIM
Expand Down
80 changes: 56 additions & 24 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,39 +1,71 @@
{erl_opts, []}.

{deps, [
{fast_pbkdf2, "1.0.5"}
{fast_pbkdf2, "1.0.6"}
]}.

{project_plugins, [
rebar3_hex,
rebar3_ex_doc
{rebar3_hex, "7.0.8"},
{rebar3_ex_doc, "0.2.25"},
{rebar3_lint, "~> 3.2.6"},
{erlfmt, "1.5.0"}
]}.


{profiles, [
{test, [
{erl_opts, []},
{deps, [
{proper, "1.4.0"},
{base16, "2.0.1"}
]},
{plugins, [
{rebar3_codecov, "0.6.0"}
]},
{cover_enabled, true},
{cover_export_enabled, true}
]},
{prod, [
{erl_opts, [inline_list_funcs, deterministic]}
]}
]
}.
{test, [
{erl_opts, []},
{deps, [
{proper, "1.4.0"},
{base16, "2.0.1"}
]},
{plugins, [
{rebar3_codecov, "0.7.0"}
]},
{cover_enabled, true},
{cover_export_enabled, true}
]},
{prod, [
{erl_opts, [inline_list_funcs, deterministic]}
]}
]}.

{erlfmt, [
write,
{files, [
"src/*.{hrl,erl,app.src}",
"test/*.{hrl,erl,app.src}",
"rebar.config"
]}
]}.

{elvis, [
#{
dirs => ["src/**"],
filter => "*.erl",
ruleset => erl_files,
rules => [{elvis_style, private_data_types, disable}]
},
#{
dirs => ["."],
filter => "rebar.config",
ruleset => rebar_config
},
#{
dirs => ["src/**"],
filter => "*.hrl",
ruleset => hrl_files
}
]}.

{hex, [
{doc, #{provider => ex_doc}}
]}.
{ex_doc, [
{source_url, <<"https://github.com/esl/fast_scram">>},
{extras, [<<"README.md">>, <<"LICENSE">>]},
{main, <<"readme">>}
{source_url, <<"https://github.com/esl/fast_scram">>},
{main, <<"readme">>},
{extras, [
{'README.md', #{title => <<"README">>}},
{'LICENSE', #{title => <<"License">>}}
]},
{main, <<"readme">>}
]}.
32 changes: 16 additions & 16 deletions src/fast_scram.app.src
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{application, fast_scram,
[{description, "A fast Salted Challenge Response Authentication Mechanism"},
{vsn, git},
{registered, []},
{applications,
[kernel,
stdlib,
crypto,
fast_pbkdf2
]},
{optional_applications, [fast_pbkdf2]},
{env,[]},
{modules, []},
{licenses, ["Apache 2.0"]},
{links, [{"GitHub", "https://github.com/esl/fast_scram/"}]}
]}.
{application, fast_scram, [
{description, "A fast Salted Challenge Response Authentication Mechanism"},
{vsn, git},
{registered, []},
{applications, [
kernel,
stdlib,
crypto,
fast_pbkdf2
]},
{optional_applications, [fast_pbkdf2]},
{env, []},
{modules, []},
{licenses, ["Apache 2.0"]},
{links, [{"GitHub", "https://github.com/esl/fast_scram/"}]}
]}.
Loading

0 comments on commit 0c33dc7

Please sign in to comment.