mirror of
https://github.com/processone/ejabberd.git
synced 2024-10-31 15:21:38 +01:00
ce99db0595
1. Add a request handler in ejabberd_http and explain how to configure the http listener so that the challenges can be solved. 2. Make acme configuration optional by providing defaults in ejabberd_acme. 3. Save the CA that the account has been created in so that it creates a new account when connecting to a new CA. 4. Small spec change in acme configuration.
54 lines
1.2 KiB
Erlang
54 lines
1.2 KiB
Erlang
|
|
-record(challenge, {
|
|
type = <<"http-01">> :: bitstring(),
|
|
status = pending :: pending | valid | invalid,
|
|
uri = "" :: url(),
|
|
token = <<"">> :: bitstring()
|
|
}).
|
|
|
|
-record(data_acc, {
|
|
id :: list(),
|
|
ca_url :: url(),
|
|
key :: jose_jwk:key()
|
|
}).
|
|
-type data_acc() :: #data_acc{}.
|
|
|
|
-record(data_cert, {
|
|
domain :: bitstring(),
|
|
pem :: pem(),
|
|
path :: string()
|
|
}).
|
|
-type data_cert() :: #data_cert{}.
|
|
|
|
%%
|
|
%% Types
|
|
%%
|
|
|
|
%% Acme configuration
|
|
-type acme_config() :: [{ca_url, url()} | {contact, bitstring()}].
|
|
|
|
%% The main data type that ejabberd_acme keeps
|
|
-type acme_data() :: proplist().
|
|
|
|
%% The list of certificates kept in data
|
|
-type data_certs() :: proplist(bitstring(), data_cert()).
|
|
|
|
%% The certificate saved in pem format
|
|
-type pem() :: bitstring().
|
|
|
|
-type nonce() :: string().
|
|
-type url() :: string().
|
|
-type proplist() :: [{_, _}].
|
|
-type proplist(X,Y) :: [{X,Y}].
|
|
-type dirs() :: #{string() => url()}.
|
|
-type jws() :: map().
|
|
-type handle_resp_fun() :: fun(({ok, proplist(), proplist()}) -> {ok, _, nonce()}).
|
|
|
|
-type acme_challenge() :: #challenge{}.
|
|
|
|
%% Options
|
|
-type account_opt() :: string().
|
|
-type verbose_opt() :: string().
|
|
-type domains_opt() :: string().
|
|
|