conf_parameter() = #{name => binary(), type => binary(), default => any()}
conf_parameters() = [conf_parameter()]
connection() = #{type => local | ssh, user => undefined | string(), passwd => undefined | string(), host => undefined | string(), port => undefined | integer(), ssh_dir => undefined | string(), ssh_key_pass => undefined | string()}
info() = #{id => binary(), allow_same_state => boolean(), authz => watts_service_authz:config(), cmd => binary(), connection => connection(), cred_limit => infinite | integer(), description => binary(), enabled => boolean(), parallel_runner => infinite | integer(), params => [parameter_set()], pass_access_token => boolean(), plugin_conf => map(), plugin_features => map(), plugin_timeout => infinity | integer(), plugin_version => undefined | binary(), queue => atom(), term() => term()}
limited_info() = #{id => binary(), description => binary(), cred_limit => infinite | integer(), pass_access_token => boolean(), enabled => boolean(), params => [], limit_reached => boolean(), cred_count => integer(), authorized => boolean(), authz_tooltip => binary()}
parameter() = #{key => binary(), name => binary(), description => binary(), type => atom(), mandatory => boolean()}
parameter_set() = [parameter()]
add/1 | add a service to the ets database, used during initialization. |
add_queue/2* | add a queue to jobs. |
allows_same_state/1 | wether the plugin may return the same state twice. |
are_params_valid/2 | check if the passed request parameters are valid for the service. |
convert_to_type/2* | convert the valut to the given type. |
exists/1 | return if a service with the given id exists. |
filter_list_for_user/2* | filter the list of services for a user, to hide them. |
fulfills_paramset/2* | check if the list of keys are fullfilling the given parameter set. |
gen_queue_name/1* | generate the name of a queue: the atom 'watts_service-ID'. |
get_and_validate_parameter/1* | get and validate the parameter from the plugin. |
get_credential_limit/1 | get the credential limit for a service. |
get_info/1 | get the info for a sepcific service id. |
get_list/0 | get a list of all services currently configured. |
get_list/1 | get the list of all services for a user. |
get_queue/1 | get the queue name (an atom) for a service id. |
is_allowed/2 | checks if a user is allowed to use the given service. |
is_allowed/3* | checking the service authorization rules see watts_service_authz. |
is_enabled/1 | return if a service, given by the id, is enabled. |
is_secure_plugin_or_allowed/3* | check and log if a plugin supports stdin of if insecure plugins are allowed. |
is_valid_key/1* | return if a key is valid. |
is_valid_key_char/1* | ceck if the character is valid within a key. |
list_skipped_parameter_and_delete_config/1* | list the skipped parameter from the config and delete the raw config. |
maybe_warn_default/4* | print a warning if using the default value from the plugin. |
maybe_warning_about_using_env/1* | write a warning about not supporting environment anymore. |
start_runner_queue_if_needed/1* | start the runnuner queue if needed. |
to_atom/1* | convert the binary to an existing atom or unknown. |
to_conf_type/1* | convert the type to a configuration type. |
to_request_type/1* | convert the type to a request type. |
to_valid_type/2* | try to convert the type to an atom and find it in the given list. |
update_conf_parameter/5* | check the conversion results and update the config if all okay. |
update_limits_for_user/2* | update the list for the user with limits and permissions. |
update_params/1 | update the parameter of a service by running the plugin. |
update_service/2* | update the config of the service in the ets. |
validate_call_parameter/9* | validate one parameter for a call (part of a parameter set). |
validate_call_parameter_set/2* | validate a single parameter set. |
validate_call_parameter_set/5* | validate a call parameter set and keep track of the result. |
validate_call_parameter_sets/2* | validate the call parameter sets. |
validate_call_parameter_sets/3* | validate the call parameter sets and keep track of the result Itterate through each parameter set, validating it. |
validate_conf_parameter/2* | validate configuration parameter. |
validate_conf_parameter/3* | validate the configuration parameter and keep track of the result. |
validate_params_and_update_db/3* | validate the parameter returned from the plugin and maybe update the ets. |
add(ServiceInfo::info()) -> {ok, binary()} | {error, invalid_config}
add a service to the ets database, used during initialization
add_queue(Id::binary(), NumRunner::integer()) -> ok
add a queue to jobs
allows_same_state(ServiceId::binary()) -> boolean()
wether the plugin may return the same state twice
are_params_valid(Params::map(), ServiceId::info() | limited_info() | binary()) -> boolean()
check if the passed request parameters are valid for the service
convert_to_type(Value::binary(), X2::atom()) -> {ok, binary() | atom()} | {error, bad_value}
convert the valut to the given type.
exists(ServiceId::binary()) -> boolean()
return if a service with the given id exists
filter_list_for_user(UserInfo::watts_userinfo:info(), ServiceList::[info()]) -> {ok, [info()]}
filter the list of services for a user, to hide them.
fulfills_paramset(Params::[binary()], List::parameter_set()) -> boolean()
check if the list of keys are fullfilling the given parameter set
gen_queue_name(Id::binary()) -> atom()
generate the name of a queue: the atom 'watts_service-ID'. Where ID is the id of the service.
get_and_validate_parameter(X1::{ok, {binary(), info()}} | any()) -> ok | {error, not_found}
get and validate the parameter from the plugin.
get_credential_limit(ServiceId::binary()) -> {ok, integer() | infinite}
get the credential limit for a service
get_info(ServiceId::binary()) -> {ok, info()} | {error, Reason::atom()}
get the info for a sepcific service id
get_list() -> {ok, [info()]}
get a list of all services currently configured.
get_list(UserInfo::watts_userinfo:userinfo()) -> {ok, [limited_info()]}
get the list of all services for a user
get_queue(ServiceId::binary()) -> {ok, atom()}
get the queue name (an atom) for a service id
is_allowed(UserInfo::watts_userinfo:userinfo(), ServiceId::binary()) -> boolean()
checks if a user is allowed to use the given service
See also: is_allowed/3.
is_allowed(ServiceId::binary(), UserInfo::watts_userinfo:userinfo(), AuthzConf::watts_service_authz:config()) -> boolean()
checking the service authorization rules see watts_service_authz
is_enabled(ServiceId::binary()) -> boolean()
return if a service, given by the id, is enabled
is_secure_plugin_or_allowed(X1::map(), X2::boolean(), Id::binary()) -> boolean()
check and log if a plugin supports stdin of if insecure plugins are allowed
is_valid_key(Key::binary()) -> boolean()
return if a key is valid.
is_valid_key_char(X1::integer()) -> boolean()
ceck if the character is valid within a key
list the skipped parameter from the config and delete the raw config
maybe_warn_default(X1::boolean(), Id::binary(), Name::binary(), Default::any()) -> ok
print a warning if using the default value from the plugin
maybe_warning_about_using_env(X1::info()) -> ok
write a warning about not supporting environment anymore
start_runner_queue_if_needed(X1::info()) -> {ok, atom()}
start the runnuner queue if needed.
to_atom(Type::binary()) -> atom()
convert the binary to an existing atom or unknown.
to_conf_type(Type::binary()) -> atom()
convert the type to a configuration type.
to_request_type(Type::binary()) -> atom()
convert the type to a request type.
to_valid_type(Type::binary(), ValidTypes::[atom()]) -> atom()
try to convert the type to an atom and find it in the given list.
update_conf_parameter(Name::binary(), Valid::boolean(), Default::{ok, any()} | {error, any()}, Type::atom(), Info::info()) -> {boolean(), info()}
check the conversion results and update the config if all okay.
update_limits_for_user(UserInfo::watts_userinfo:info(), ServiceList::[info()]) -> {ok, [limited_info()]}
update the list for the user with limits and permissions
update_params(Id::binary()) -> ok | {error, not_found}
update the parameter of a service by running the plugin
update_service(Id::binary(), NewInfo::info()) -> ok | {error, Reason::atom()}
update the config of the service in the ets.
validate_call_parameter(Key::binary(), X2::boolean(), X3::boolean(), Name::binary(), Desc::binary(), Type::atom(), Param::map(), Id::binary(), ParamSet::parameter_set()) -> {boolean(), parameter_set()}
validate one parameter for a call (part of a parameter set)
validate_call_parameter_set(Set::parameter_set(), Info::info()) -> {boolean(), info()}
validate a single parameter set. a singe set is a list of maps, each containing the specificaiton of one parameter
validate_call_parameter_set(T::parameter_set(), Info::info(), ParamSet::parameter_set(), Keys::[binary()], Result::boolean()) -> {boolean(), info()}
validate a call parameter set and keep track of the result. also update at the end the params list within the info with each new set.
validate_call_parameter_sets(Params::[parameter_set()], Info::info()) -> {boolean(), info()}
validate the call parameter sets
validate_call_parameter_sets(T::[parameter_set()], Info::info(), Result::boolean()) -> {boolean(), info()}
validate the call parameter sets and keep track of the result Itterate through each parameter set, validating it.
validate_conf_parameter(Params::conf_parameters(), Info::info()) -> {boolean(), info()}
validate configuration parameter
validate_conf_parameter(T::conf_parameters(), Info::info(), Result::boolean()) -> {boolean(), info()}
validate the configuration parameter and keep track of the result.
validate_params_and_update_db(Id::binary(), Info::info(), X3::{ok, map()} | any()) -> ok | {error, not_found}
validate the parameter returned from the plugin and maybe update the ets
Generated by EDoc