diff --git a/LICENSE b/LICENSE index 2e6efa7..27308ba 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2023, Benoit Chesneau . +Copyright (c) 2015-2024, Benoit Chesneau . All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index 9cfb0c5..6c70858 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # [certifi](https://github.com/certifi/erlang-certifi) -[![Build Status](https://github.com/certifi/erlang-certifi/workflows/build/badge.svg)](https://github.com/certifi/erlang-certifi) +[![CI](https://github.com/certifi/erlang-certifi/actions/workflows/erlang.yml/badge.svg)](https://github.com/certifi/erlang-certifi/actions/workflows/erlang.yml) +[![Hex](https://img.shields.io/hexpm/v/certifi.svg)](https://hex.pm/packages/certifi) +[![HexDocs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/certifi) This Erlang library contains a CA bundle that you can reference in your Erlang application. This is useful for systems that do not have CA bundles that @@ -29,22 +31,16 @@ You can also retrieve the path to the file and load it by yourself if needed: Path = certifi:cacertfile(). ``` -## Build & test +## Development + +Testing: ```shell -$ rebar3 eunit +rebar3 eunit ``` -## Documentation generation - -### Edoc - -#### Generate public API -`rebar3 edoc` - -#### Generate private API -`rebar3 as edoc_private edoc` +Documentation: -### ExDoc - -`rebar3 ex_doc --output edoc` \ No newline at end of file +```shell +rebar3 ex_doc +``` diff --git a/rebar.config b/rebar.config index 024e6bc..aa48b5f 100644 --- a/rebar.config +++ b/rebar.config @@ -1,8 +1,12 @@ +{minimum_otp_vsn, "21.3"}. + {erl_first_files, ["src/certifi_pt.erl"]}. -{erl_opts, [deterministic %% Added since OTP 20 - ,{platform_define, "^2", 'OTP_20_AND_ABOVE'} - ]}. +{profiles, [ + %% Since OTP 20 + {default, [{erl_opts, [deterministic, {platform_define, "^2", 'OTP_20_AND_ABOVE'}]}]}, + {docs, [{erl_opts, []}]} +]}. {project_plugins, [rebar3_hex, rebar3_ex_doc]}. @@ -12,8 +16,8 @@ {ex_doc, [ {extras, [ - {"README.md", #{title => "Overview"}}, - {"LICENSE", #{title => "License"}} + {"README.md", #{title => "Overview"}}, + {"LICENSE", #{title => "License"}} ]}, {main, "README.md"}, {source_url, "https://github.com/certifi/erlang-certifi"}, diff --git a/src/certifi.erl b/src/certifi.erl index 7be01a3..431b941 100644 --- a/src/certifi.erl +++ b/src/certifi.erl @@ -1,5 +1,5 @@ -module(certifi). -%% Causes the parse transformation function Module:parse_transform/2 +%% Causes the parse transformation function Module:parse_transform/2 %% to be applied to the parsed code before the code is checked for errors. -compile({parse_transform, certifi_pt}). @@ -7,9 +7,10 @@ cacerts/0]). %% @doc CACertFile gives the path to the file with an X.509 certificate list -%% containing the Mozilla CA Certificate that can then be used via the -%% cacertfile setting in ssl options passed to the connect function. - +%% containing the Mozilla CA Certificate. +%% +%% The file is used via the `cacertfile' setting in {@link //ssl/ssl} options, +%% passed to the `ssl:connect/2,3,4' function. -spec cacertfile() -> Result when Result :: file:filename_all(). cacertfile() -> @@ -25,8 +26,10 @@ cacertfile() -> filename:join(PrivDir, "cacerts.pem"). %% @doc CACerts builds an X.509 certificate list containing the Mozilla CA -%% Certificate that can then be used via the cacerts setting in ssl options -%% passed to the connect function. +%% Certificate. +%% +%% The certificate list is used via the `cacerts' setting in {@link //ssl/ssl} +%% options, passed to the `connect/2,3,4' function. -spec cacerts() -> [binary(),...]. cacerts() -> - ok. \ No newline at end of file + ok.