Module leec

Behaviours: application, gen_statem.

Data Types

acme_operation()

acme_operation() = bin_string()

agent_key_file_info()

agent_key_file_info() = {new, bin_file_path()} | bin_file_path()

any_directory_path()

any_directory_path() = file_utils:any_directory_path()

any_file_path()

any_file_path() = file_utils:any_file_path()

any_san()

any_san() = san() | bin_san()

application_name()

application_name() = otp_utils:application_name()

bin_certificate()

bin_certificate() = binary()

bin_challenge_type()

bin_challenge_type() = bin_string()

bin_csr_key()

bin_csr_key() = bin_key()

bin_domain()

bin_domain() = net_utils:bin_fqdn()

bin_file_path()

bin_file_path() = file_utils:bin_file_path()

bin_key()

bin_key() = binary()

bin_san()

bin_san() = bin_string()

bin_string()

bin_string() = text_utils:bin_string()

bin_uri()

bin_uri() = web_utils:bin_uri()

binary_b64()

binary_b64() = binary()

bridge_spec()

bridge_spec() = trace_bridge:bridge_spec()

cert_file_path()

cert_file_path() = pem_file_path()

cert_priv_key_file_path()

cert_priv_key_file_path() = pem_file_path()

cert_req_option_id()

cert_req_option_id() = async | callback | netopts | challenge_type | sans | json

cert_req_option_map()

cert_req_option_map() = table(cert_req_option_id(), term())

certificate_provider()

certificate_provider() = letsencrypt

certificate_type()

certificate_type() = single_domain | wildcard_domain

challenge()

challenge() = table(bin_string(), bin_string())

challenge_type()

challenge_type() = 'http-01' | 'dns-01' | 'tls-sni-01'

creation_callback()

creation_callback() = fun((obtain_outcome()) -> void())

creation_outcome()

creation_outcome() = {certificate_ready, cert_file_path(), cert_priv_key_file_path()} | tagged_error()

That is: {'error', term()}

credentials_path()

credentials_path() = any_file_path()

directory_map()

directory_map() = table(acme_operation(), bin_uri())

dns_provider()

dns_provider() = ovh

domain_name()

domain_name() = net_utils:string_fqdn() | bin_domain()

environment()

environment() = staging | production

error_reason()

error_reason() = basic_utils:error_reason()

event_content()

event_content() = term()

event_type()

event_type() = gen_statem:event_type()

file_name()

file_name() = file_utils:file_name()

fsm_pid()

fsm_pid() = pid()

json()

json() = json_utils:json()

json_map_decoded()

json_map_decoded() = map()

jws()

jws() = #jws{alg = leec:jws_algorithm(), url = option(leec:bin_uri()), kid = option(leec:bin_uri()), jwk = option(leec:tls_public_key()), nonce = option(leec:nonce())}

jws_algorithm()

jws_algorithm() = 'RS256'

key_auth()

key_auth() = binary()

key_integer()

key_integer() = integer() | binary()

leec_caller_state()

leec_caller_state() = {challenge_type(), fsm_pid()}

leec_dns_state()

leec_dns_state() = #leec_dns_state{environment = leec:environment(), state_dir_path = file_utils:bin_directory_path(), work_dir_path = file_utils:bin_directory_path(), certbot_path = file_utils:bin_executable_path(), credentials_dir_path = file_utils:bin_directory_path(), cert_dir_path = file_utils:bin_directory_path(), cert_key_file = option(file_utils:bin_file_path()), domain = option(net_utils:bin_fqdn())}

leec_http_state()

leec_http_state() = #leec_http_state{environment = leec:environment(), directory_map = option(leec:directory_map()), cert_dir_path = file_utils:bin_directory_path(), cert_key_file = option(file_utils:bin_file_path()), cert_priv_key_path = option(leec:cert_priv_key_file_path()), interfacing_mode = option(leec:web_interfacing_mode()), webroot_dir_path = option(file_utils:bin_directory_path()), port = net_utils:tcp_port(), nonce = option(leec:nonce()), domain = option(net_utils:bin_fqdn()), sans = [leec:san()], agent_key_file_info = option(leec:agent_key_file_info()), agent_private_key = option(leec:tls_private_key()), jws = option(leec:jws()), account_key = option(leec:tls_public_key()), order = option(leec:order_map()), challenges = leec:uri_challenge_map(), cert_req_option_map = leec:cert_req_option_map(), json_parser_state = json_utils:parser_state(), tcp_connection_cache = leec:tcp_connection_cache()}

leec_state()

leec_state() = leec_http_state() | leec_dns_state()

milliseconds()

milliseconds() = unit_utils:milliseconds()

nonce()

nonce() = binary()

obtain_outcome()

obtain_outcome() = async | obtained_outcome()

obtained_outcome()

obtained_outcome() = {certificate_generation_success, cert_file_path(), cert_priv_key_file_path()} | {certificate_generation_failure, error_reason()}

option()

option(T) = basic_utils:option(T)

order_map()

order_map() = table(bin_string(), bin_uri())

pem_file_path()

pem_file_path() = bin_file_path()

request()

request() = atom()

rsa_private_key()

rsa_private_key() = [key_integer()]

san()

san() = ustring()

start_common_option()

start_common_option() = {environment, environment()} | {work_dir_path, any_directory_path()} | {agent_key_file_path, any_file_path()} | {cert_dir_path, any_directory_path()} | {http_timeout, milliseconds()}

start_dns_01_option()

start_dns_01_option() = {dns_provider, dns_provider()} | {cred_dir_path, any_directory_path()}

start_http_01_option()

start_http_01_option() = {interfacing_mode, web_interfacing_mode()} | {webroot_dir_path, any_directory_path()} | {port, tcp_port()}

start_option()

start_option() = start_common_option() | start_http_01_option() | start_dns_01_option()

start_outcome()

start_outcome() = {ok, leec_caller_state()} | basic_utils:tagged_error()

'ok' | gen_statem:start_ret().

state_callback_result()

state_callback_result() = fsm_utils:state_callback_result(gen_statem:action())

status()

status() = pending | processing | valid | invalid | revoked

table()

table(K, V) = map_hashtable:map_hashtable(K, V)

tagged_error()

tagged_error() = basic_utils:tagged_error()

tcp_connection_cache()

tcp_connection_cache() = table({web_utils:protocol_type(), net_utils:string_host_name(), tcp_port()}, shotgun:connection())

tcp_port()

tcp_port() = net_utils:tcp_port()

thumbprint()

thumbprint() = json()

thumbprint_map()

thumbprint_map() = table(token(), thumbprint())

tls_csr()

tls_csr() = binary_b64()

tls_private_key()

tls_private_key() = #tls_private_key{raw = leec:rsa_private_key(), b64_pair = {leec:binary_b64(), leec:binary_b64()}, file_path = file_utils:bin_file_path()}

tls_public_key()

tls_public_key() = #tls_public_key{kty = 'RSA', n = text_utils:bin_string(), e = text_utils:bin_string()}

token()

token() = ustring()

type_challenge_map()

type_challenge_map() = table(challenge_type(), challenge())

uri_challenge_map()

uri_challenge_map() = table(bin_uri(), challenge())

ustring()

ustring() = text_utils:ustring()

void()

void() = basic_utils:void()

web_interfacing_mode()

web_interfacing_mode() = webroot | slave | standalone

Function Index

callback_mode/0
caller_state_to_string/1
can_perform_dns_challenges/0
code_change/4
dns_provider_to_string/1
finalize/3
get_agent_key_path/1
get_certificate_priv_key_filename/1
get_credentials_path_for/3
get_default_cert_request_options/1
get_default_cert_request_options/2
get_ongoing_challenges/1
get_ordered_prerequisites/0
idle/3
init/1
invalid/3
is_known_challenge_type/1
is_supported_dns_provider/1
maybe_caller_state_to_string/1
obtain_cert_helper/5
obtain_certificate_for/2
obtain_certificate_for/3
pending/3
reset_state/2
send_ongoing_challenges/2
start/2
start/3
state_to_string/1
stop/1
terminate/1
terminate/3
valid/3

Function Details

callback_mode/0

callback_mode() -> fsm_utils:callback_mode_ret()

caller_state_to_string/1

caller_state_to_string(LEECCallerState::leec_caller_state()) -> ustring()

can_perform_dns_challenges/0

can_perform_dns_challenges() -> boolean()

code_change/4

code_change(X1, StateName, LHState, X4) -> any()

dns_provider_to_string/1

dns_provider_to_string(DNSProvider::dns_provider()) -> ustring()

finalize/3

finalize(EventType, PreviousState, Data) -> any()

get_agent_key_path/1

get_agent_key_path(CallerState::leec_caller_state()) -> error | option(bin_file_path())

get_certificate_priv_key_filename/1

get_certificate_priv_key_filename(DomainName::domain_name()) -> file_name()

get_credentials_path_for/3

get_credentials_path_for(DNSProvider::dns_provider(), DomainName::domain_name(), AnyCredBasePath::any_directory_path()) -> credentials_path()

get_default_cert_request_options/1

get_default_cert_request_options(ChallengeType::challenge_type()) -> cert_req_option_map()

get_default_cert_request_options/2

get_default_cert_request_options(ChallengeType::challenge_type(), Async::boolean()) -> cert_req_option_map()

get_ongoing_challenges/1

get_ongoing_challenges(FsmPid::fsm_pid()) -> error | no_challenge | thumbprint_map()

get_ordered_prerequisites/0

get_ordered_prerequisites() -> [application_name()]

idle/3

idle(EventType::event_type(), PreviousState::event_content(), Data::leec_http_state()) -> state_callback_result()

init/1

init(X1::{challenge_type(), [start_option()], json_utils:parser_state(), option(bridge_spec())}) -> {ok, InitialStateName::idle, InitialData::leec_http_state()}

invalid/3

invalid(EventType, PreviousState, Data) -> any()

is_known_challenge_type/1

is_known_challenge_type(ChalType::atom()) -> boolean()

is_supported_dns_provider/1

is_supported_dns_provider(DNSProvider::atom()) -> boolean()

maybe_caller_state_to_string/1

maybe_caller_state_to_string(MaybeLEECCallerState::option(leec_caller_state())) -> ustring()

obtain_cert_helper/5

obtain_cert_helper(Domain::domain_name(), ChallengeType::challenge_type(), FsmPid::fsm_pid(), CertReqOptionMap::cert_req_option_map(), MaybeBridgeInfo::option(trace_bridge:bridge_info())) -> obtained_outcome()

obtain_certificate_for/2

obtain_certificate_for(Domain::domain_name(), LeecCallerState::leec_caller_state()) -> obtain_outcome()

obtain_certificate_for/3

obtain_certificate_for(Domain::domain_name(), LeecCallerState::leec_caller_state(), CertReqOptionMap::cert_req_option_map()) -> obtain_outcome()

pending/3

pending(EventType, PreviousState, Data) -> any()

reset_state/2

reset_state(ChallengeType::challenge_type(), AnyCertDir::any_directory_path()) -> boolean()

send_ongoing_challenges/2

send_ongoing_challenges(LCS::leec_caller_state(), TargetPid::pid()) -> void()

start/2

start(ChallengeType::challenge_type(), StartOptions::[start_option()]) -> start_outcome()

start/3

start(ChallengeType::challenge_type(), StartOptions::[start_option()], MaybeBridgeSpec::option(bridge_spec())) -> start_outcome()

state_to_string/1

state_to_string(LHS::leec_state()) -> ustring()

stop/1

stop(LCS::leec_caller_state()) -> void()

terminate/1

terminate(LEECCallerState::leec_caller_state()) -> void()

terminate/3

terminate(Reason, State, Data) -> any()

valid/3

valid(EventType, PreviousState, Data) -> any()


Generated by EDoc