Skip to content

Commit 6622ce2

Browse files
committedDec 18, 2024
Update documentation, linting, and formatting
1 parent ade985d commit 6622ce2

13 files changed

+1124
-810
lines changed
 

‎.github/workflows/ci.yml

+13-9
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,28 @@ jobs:
1212
name: OTP ${{matrix.otp}}
1313
strategy:
1414
matrix:
15-
otp: ['26.2', '25.3', '24.3']
16-
rebar3: ['3.22.1']
17-
runs-on: 'ubuntu-22.04'
15+
otp: ['27', '26', '25']
16+
rebar3: ['3.24.0']
17+
runs-on: 'ubuntu-24.04'
1818
env:
1919
OTPVER: ${{ matrix.otp }}
2020
steps:
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2222
- uses: erlef/setup-beam@v1
2323
with:
2424
otp-version: ${{matrix.otp}}
2525
rebar3-version: ${{matrix.rebar3}}
26+
- run: rebar3 fmt --check
27+
- run: rebar3 lint
2628
- run: rebar3 do ct --cover
2729
- run: rebar3 as test codecov analyze
2830
- run: rebar3 dialyzer
29-
if: ${{ matrix.otp == '26.2' }}
30-
- uses: codecov/codecov-action@v3
31-
name: Upload coverage reports to Codecov
32-
if: ${{ matrix.otp == '26.2' }}
31+
if: ${{ matrix.otp == '27' }}
32+
- name: Upload code coverage
33+
uses: codecov/codecov-action@v4
34+
if: ${{ matrix.otp == '27' }}
3335
with:
36+
files: _build/test/covertool/fast_scram.covertool.xml
3437
token: ${{ secrets.CODECOV_TOKEN }}
35-
fail_ci_if_error: true # optional (default = false)
38+
fail_ci_if_error: true
39+
verbose: true

‎.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ rebar3.crashdump
2121
*.vim
2222
tags
2323
priv/
24-
24+
doc/

‎README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![Actions Status](https://github.com/esl/fast_scram/workflows/ci/badge.svg)](https://github.com/esl/fast_scram/actions)
44
[![codecov](https://codecov.io/gh/esl/fast_scram/branch/master/graph/badge.svg)](https://codecov.io/gh/esl/fast_scram)
55
[![Hex](http://img.shields.io/hexpm/v/fast_scram.svg)](https://hex.pm/packages/fast_scram)
6+
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/fast_scram/)
67

78
`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].
89

@@ -235,7 +236,7 @@ If for any particular reason you want to skip compiling and loading custom NIFs,
235236
* SCRAM: [RFC5802](https://tools.ietf.org/html/rfc5802)
236237
* SCRAM-SHA-256 update: [RFC7677](https://tools.ietf.org/html/rfc7677)
237238
* Password-Based Cryptography Specification (PBKDF2): [RFC8018](https://tools.ietf.org/html/rfc8018)
238-
* HMAC: [RFC2104]( https://tools.ietf.org/html/rfc2104)
239+
* HMAC: [RFC2104](https://tools.ietf.org/html/rfc2104)
239240
* SHAs and HMAC-SHA: [RFC6234](https://tools.ietf.org/html/rfc6234)
240241

241242
[MIM]: https://github.com/esl/MongooseIM

‎rebar.config

+56-24
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,71 @@
11
{erl_opts, []}.
22

33
{deps, [
4-
{fast_pbkdf2, "1.0.5"}
4+
{fast_pbkdf2, "1.0.6"}
55
]}.
66

77
{project_plugins, [
8-
rebar3_hex,
9-
rebar3_ex_doc
8+
{rebar3_hex, "7.0.8"},
9+
{rebar3_ex_doc, "0.2.25"},
10+
{rebar3_lint, "~> 3.2.6"},
11+
{erlfmt, "1.5.0"}
1012
]}.
1113

12-
1314
{profiles, [
14-
{test, [
15-
{erl_opts, []},
16-
{deps, [
17-
{proper, "1.4.0"},
18-
{base16, "2.0.1"}
19-
]},
20-
{plugins, [
21-
{rebar3_codecov, "0.6.0"}
22-
]},
23-
{cover_enabled, true},
24-
{cover_export_enabled, true}
25-
]},
26-
{prod, [
27-
{erl_opts, [inline_list_funcs, deterministic]}
28-
]}
29-
]
30-
}.
15+
{test, [
16+
{erl_opts, []},
17+
{deps, [
18+
{proper, "1.4.0"},
19+
{base16, "2.0.1"}
20+
]},
21+
{plugins, [
22+
{rebar3_codecov, "0.7.0"}
23+
]},
24+
{cover_enabled, true},
25+
{cover_export_enabled, true}
26+
]},
27+
{prod, [
28+
{erl_opts, [inline_list_funcs, deterministic]}
29+
]}
30+
]}.
31+
32+
{erlfmt, [
33+
write,
34+
{files, [
35+
"src/*.{hrl,erl,app.src}",
36+
"test/*.{hrl,erl,app.src}",
37+
"rebar.config"
38+
]}
39+
]}.
40+
41+
{elvis, [
42+
#{
43+
dirs => ["src/**"],
44+
filter => "*.erl",
45+
ruleset => erl_files,
46+
rules => [{elvis_style, private_data_types, disable}]
47+
},
48+
#{
49+
dirs => ["."],
50+
filter => "rebar.config",
51+
ruleset => rebar_config
52+
},
53+
#{
54+
dirs => ["src/**"],
55+
filter => "*.hrl",
56+
ruleset => hrl_files
57+
}
58+
]}.
3159

3260
{hex, [
3361
{doc, #{provider => ex_doc}}
3462
]}.
3563
{ex_doc, [
36-
{source_url, <<"https://github.com/esl/fast_scram">>},
37-
{extras, [<<"README.md">>, <<"LICENSE">>]},
38-
{main, <<"readme">>}
64+
{source_url, <<"https://github.com/esl/fast_scram">>},
65+
{main, <<"readme">>},
66+
{extras, [
67+
{'README.md', #{title => <<"README">>}},
68+
{'LICENSE', #{title => <<"License">>}}
69+
]},
70+
{main, <<"readme">>}
3971
]}.

‎src/fast_scram.app.src

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
{application, fast_scram,
2-
[{description, "A fast Salted Challenge Response Authentication Mechanism"},
3-
{vsn, git},
4-
{registered, []},
5-
{applications,
6-
[kernel,
7-
stdlib,
8-
crypto,
9-
fast_pbkdf2
10-
]},
11-
{optional_applications, [fast_pbkdf2]},
12-
{env,[]},
13-
{modules, []},
14-
{licenses, ["Apache 2.0"]},
15-
{links, [{"GitHub", "https://github.com/esl/fast_scram/"}]}
16-
]}.
1+
{application, fast_scram, [
2+
{description, "A fast Salted Challenge Response Authentication Mechanism"},
3+
{vsn, git},
4+
{registered, []},
5+
{applications, [
6+
kernel,
7+
stdlib,
8+
crypto,
9+
fast_pbkdf2
10+
]},
11+
{optional_applications, [fast_pbkdf2]},
12+
{env, []},
13+
{modules, []},
14+
{licenses, ["Apache-2.0"]},
15+
{links, [{"GitHub", "https://github.com/esl/fast_scram/"}]}
16+
]}.

0 commit comments

Comments
 (0)
Failed to load comments.