Behaviours: gen_server.
config() = #{action => parameter | request | revoke, service_id => binary(), queue => atom(), user_id => undefined | binary(), user_info => watts_userinfo:userinfo() | undefined, cred_state => binary() | undefined, params => map() | undefined, cred_id => binary() | undefined, term() => term()}
cred_entry() = #{name => binary(), type => binary(), valye => binary(), term() => term()}
result() = {ok, #{id => binary(), entries => [cred_entry()]}} | {ok, #{version => binary(), request_params => [any()], conf_params => [any()]}} | {oidc_login, map()} | {error, atom() | tuple() | map()}
state() = #state{}
code_change/3 | nothing done here. |
config/1* | generate a new config map, ensuring no field is missing. |
exists/2 | checks if the credential for the given user exists. |
file_lines_to_binary/2* | convert a list to binary. |
get_count/2 | return the number of credentials of a user for a specific service. |
get_cred_list/1 | get the list of all credentials for the given user. |
get_credential/2* | lookup a credential for the user. |
get_credential_count/2* | get the number of credentials of user at service. |
get_credential_list/1* | get the list of credenials for a user. |
get_params/1 | perform the 'parameter' request at the plugin for the service. |
handle_call/3 | handle calls, the only one is to serialize storing or credential. |
handle_cast/2 | handle casts, the only one is to stop the gen_server. |
handle_info/2 | nothing done here. |
handle_result/2* | handle the results or a plugin run, including validation. |
handle_result/4* | handle the results or a plugin run, including validation. |
init/1 | initialize the gen_server, doing nothing. |
log_msg/2* | generate a log message, if needed from the user message. |
maybe_drop/2* | drop the credential if allowed, else error. |
remove_credential/2* | delete the credential for the user. |
request/4 | perform a request at the service for the user. |
result_to_atom/1* | convert the result of the plugin "ok", "error" or "oidc_login" to atom. |
return/2* | convert the result to the result data type. |
revoke/2 | try to revoke the given credential for the user. |
revoke_credential/2* | revoke the credential for user, if found. |
revoke_or_drop/2* | perform the revocation or maybe drop the credential. |
run_plugin/1* | run a plugin. |
runner_config/1* | create a minimal valid runner config. |
start_link/0 | start the gen_server process linked to the supervisor. |
stop/0 | stop the process. |
store_credential/4* | store credential information. |
sync_store_credential/4* | serialize storing of the credential state in the database. |
terminate/2 | nothing done here. |
validate_credential_values/1* | validate the credential entries returned from the plugin. |
validate_credential_values/2* | validate the credential entries returned from the plugin. |
value_to_binary/1* | convert a value to binary. |
value_to_file/1* | convert a value to file. |
nothing done here
config(Config::map()) -> config()
generate a new config map, ensuring no field is missing.
exists(UserInfo::watts_userinfo:info(), CredId::binary()) -> true | false
checks if the credential for the given user exists.
file_lines_to_binary(T::[any()], File::binary()) -> binary()
convert a list to binary
get_count(UserInfo::watts_userinfo:info(), ServiceId::binary()) -> {ok, non_neg_integer()}
return the number of credentials of a user for a specific service.
get_cred_list(UserInfo::watts_userinfo:info()) -> {ok, [watts:credential()]}
get the list of all credentials for the given user.
get_credential(UserId::binary(), CredentialId::binary()) -> {ok, watts:credential()} | {error, atom()}
lookup a credential for the user
get_credential_count(UserId::binary(), ServiceId::binary()) -> {ok, integer()}
get the number of credentials of user at service
get_credential_list(UserId::binary()) -> {ok, [watts:credential()]}
get the list of credenials for a user
get_params(ServiceId::binary()) -> result()
perform the 'parameter' request at the plugin for the service.
handle calls, the only one is to serialize storing or credential.
handle casts, the only one is to stop the gen_server.
nothing done here
handle_result(X1::watts_plugin_runner:result(), Info::config()) -> result()
handle the results or a plugin run, including validation
To do
handle_result(Result, MapOrReason, Output, Info) -> result()
handle the results or a plugin run, including validation
To do
init(X1::noparams) -> {ok, state()}
initialize the gen_server, doing nothing.
log_msg(Map::#{log_msg => binary(), term() => term()}, UMsg::binary()) -> binary()
generate a log message, if needed from the user message
drop the credential if allowed, else error.
remove_credential(UserId::binary(), CredentialId::binary()) -> result()
delete the credential for the user
request(ServiceId::binary(), UserInfo::watts_userinfo:userinfo(), Interface::binary(), Params::map()) -> result()
perform a request at the service for the user.
result_to_atom(Result::atom() | binary()) -> atom()
convert the result of the plugin "ok", "error" or "oidc_login" to atom.
return(X1::result | oidc_login | error, Result::map() | atom() | tuple()) -> result()
convert the result to the result data type.
revoke(CredentialId::binary(), UserInfo::watts_userinfo:info()) -> result()
try to revoke the given credential for the user
revoke_credential(MaybeCredential, UserInfo::watts_userinfo:info()) -> result()
revoke the credential for user, if found.
perform the revocation or maybe drop the credential.
run_plugin(Config::config()) -> watts_plugin_runner:result()
run a plugin
runner_config(Config::map()) -> watts_plugin_runner:config()
create a minimal valid runner config
start_link() -> {ok, pid()}
start the gen_server process linked to the supervisor
stop() -> ok
stop the process
store_credential(UserId::binary(), ServiceId::binary(), Interface::binary(), CredentialState::binary()) -> {ok, binary()} | {error, atom()}
store credential information. The only information stored are:
sync_store_credential(UserId::binary(), ServiceId::binary(), Interface::binary(), CredState::binary()) -> {ok, binary()} | {error, Reason::atom()}
serialize storing of the credential state in the database.
terminate(Reason::any(), State::state()) -> ok
nothing done here
validate_credential_values(Credential::[map()]) -> [cred_entry()]
validate the credential entries returned from the plugin
validate_credential_values(T::[map()], ValidatedCredential::[cred_entry()]) -> [cred_entry()]
validate the credential entries returned from the plugin
value_to_binary(Val::any()) -> binary()
convert a value to binary
value_to_file(Val::any()) -> binary()
convert a value to file
Generated by EDoc