See also: watts.
request_type() = oidcp | info | logout | service | credential | access_token | cred_data | undefined
state() = #state{}
allow_missing_post/2 | it is not allowed to post to urls that do not exist. |
allowed_methods/2 | return the allowed methods. |
content_types_accepted/2 | return the accepted content types (only json). |
content_types_provided/2 | return the provided content types (only json). |
delete_resource/2 | perform a deletion of a resource. |
extract_info/1* | extrac information from the request and put them into the state. |
get_json/2 | handle the get requests. |
get_return_urls/1* | get the return urls of an rsp, if valid. |
handle_queue_result/2* | handle the result of a queue request. |
init/3 | upgrade to cowboy rest. |
is_authorized/2 | check if the user is authorized to perform the request. |
is_bad_version/2* | return if the given version is bad. |
is_malformed/1* | check if the state is a malformed request. |
is_malformed/6* | check if the request is malformed. |
keep_session_alive/2* | decide if the session should be closed or not. |
malformed_request/2 | return if a request is malformed. |
perform_cookie_logout/2* | logout by deleteing the cookie. |
perform_get/4* | handle the get requests. |
perform_logout/3* | perform a logout, either by cookie or by just closing the session. |
perform_post/6* | perform a post, meaning a translation. |
post_json/2 | handle the post requests. |
request_queue_if_configured/2* | stand in the queue and request a token, if configured. |
resource_exists/2 | return if a resource exists. |
rest_init/2 | intialize the rest request by creating a state with all preparsed infos. |
rest_terminate/2 | terminate the rest request, this ensures the token is given back. |
return_json_credential/2* | return a single temp_credential (includes oidc_login) as json. |
return_json_credential_list/2* | return the credential list in json format. |
return_json_info/1* | create and return the info data. |
return_json_oidc_list/1* | return the list of supported OpenID Connect provider. |
return_json_service_list/2* | return the list of the services limited to the given keys. |
return_rsp_if_enabled/3* | return the given rsp, if it is enabled. |
safe_binary_to_integer/1* | safe conversion of binary to integer. |
service_available/2 | check if the service is available (still within the rate limit) cred_data is not checked, they always pass. |
temp_cred_id_to_url/3* | convert a temp cred Id to its url. |
temp_cred_id_to_url/4* | create the url depending on the version of the api used. |
update_cookie_or_end_session/2* | decide to update the cookie for the session or logout. |
update_cookie_or_end_session/4* | either update the cookie for the session or logout. |
verify_body/1* | verify the passed body, try to parse the json. |
verify_content_type/1* | verify the content is json or undefined. |
verify_id/1* | verify the id. |
verify_issuer/1* | verify the issuer. |
verify_method/1* | verify the method. |
verify_session/1* | verify the session, just check if it is a pid. |
verify_token/1* | verify the token passed. |
verify_type/1* | verify the request type. |
verify_version/1* | verify the passed version. |
allow_missing_post(Req::cowboy_req:req(), State::state()) -> {false, cowboy_req:req(), state()}
it is not allowed to post to urls that do not exist
allowed_methods(Req::cowboy_req:req(), State::state()) -> {[binary()], cowboy_req:req(), state()}
return the allowed methods
content_types_accepted(Req::cowboy_req:req(), State::state()) -> {[tuple()], cowboy_req:req(), state()}
return the accepted content types (only json)
content_types_provided(Req::cowboy_req:req(), State::state()) -> {[tuple()], cowboy_req:req(), state()}
return the provided content types (only json)
delete_resource(Req::cowboy_req:req(), State::state()) -> {boolean(), cowboy_req:req(), state()}
perform a deletion of a resource. this is revoking a credential
extract_info(Req::cowboy_req:req()) -> {state(), cowboy_req:req()}
extrac information from the request and put them into the state
get_json(Req::cowboy_req:req(), State::state()) -> {binary(), cowboy_req:req(), state()}
handle the get requests
get_return_urls(Rsp::undefined | binary()) -> {undefined, undefined} | {binary(), binary()}
get the return urls of an rsp, if valid
handle the result of a queue request
init(X1::any(), Req::any(), Opts::any()) -> {upgrade, protocol, cowboy_rest}
upgrade to cowboy rest
is_authorized(Req::cowboy_req:req(), State::state()) -> {boolean(), cowboy_req:req(), state()}
check if the user is authorized to perform the request
is_bad_version(Version::integer() | any(), HeaderUsed::boolean()) -> boolean()
return if the given version is bad
check if the state is a malformed request
is_malformed(Method, ContentType, Type, Id, Issuer, Body) -> boolean()
check if the request is malformed
keep_session_alive(X1::watts_session:type(), X2::atom()) -> boolean()
decide if the session should be closed or not
malformed_request(Req::cowboy_req:req(), State::state()) -> {boolean(), cowboy_req:req(), state()}
return if a request is malformed
perform_cookie_logout(Session::pid(), Req::cowboy_req:req()) -> {ok, cowboy_req:req()}
logout by deleteing the cookie
perform_get(RequestType, Id, Session, Version) -> binary()
handle the get requests. This includes:
perform_logout(Session::pid(), X2::watts_session:type(), Req::cowboy_req:req()) -> {ok, cowboy_req:req()}
perform a logout, either by cookie or by just closing the session
perform_post(Req::cowboy_req:req(), X2::credential, X3::undefined, Data::watts_service:info(), Session::pid(), Ver::integer()) -> {cowboy_req:req(), {true, binary()} | false}
perform a post, meaning a translation
post_json(Req::cowboy_req:req(), State::state()) -> {{true, binary()} | false, cowboy_req:req(), state()}
handle the post requests
stand in the queue and request a token, if configured
resource_exists(Req::cowboy_req:req(), State::state()) -> {boolean(), cowboy_req:req(), state()}
return if a resource exists
rest_init(Req0::cowboy_req:req(), Opts::any()) -> {ok, cowboy_req:req(), state()}
intialize the rest request by creating a state with all preparsed infos
rest_terminate(Req::cowboy_req:req(), State::state()) -> ok
terminate the rest request, this ensures the token is given back
return_json_credential(Cred::watts:temp_cred(), X2::integer()) -> binary()
return a single temp_credential (includes oidc_login) as json
To do
return_json_credential_list(Credentials::[map()], Version::integer()) -> binary()
return the credential list in json format
return_json_info(Session::pid()) -> binary()
create and return the info data
return_json_oidc_list(Oidc::[map()]) -> binary()
return the list of supported OpenID Connect provider
return_json_service_list(Services::[map()], Keys::[atom()]) -> binary()
return the list of the services limited to the given keys
return_rsp_if_enabled(Rsp::binary(), X2::boolean(), X3::boolean()) -> binary() | unknown_rsp | rsps_disabled
return the given rsp, if it is enabled
safe_binary_to_integer(Version::binary()) -> integer()
safe conversion of binary to integer
service_available(Req::cowboy_req:req(), State::state()) -> {boolean(), cowboy_req:req(), state()}
check if the service is available (still within the rate limit) cred_data is not checked, they always pass
temp_cred_id_to_url(Id::binary(), IssuerId::binary(), Version::pos_integer()) -> binary()
convert a temp cred Id to its url
temp_cred_id_to_url(ApiBase::binary(), Id::binary(), IssuerId::binary(), ApiVersion::pos_integer()) -> binary()
create the url depending on the version of the api used
update_cookie_or_end_session(Req::cowboy_req:req(), State::state()) -> {ok, cowboy_req:req()}
decide to update the cookie for the session or logout
update_cookie_or_end_session(X1::boolean(), Session::pid(), SessType::watts_session:type(), Req::cowboy_req:req()) -> {ok, cowboy_req:req()}
either update the cookie for the session or logout
verify_body(Data::binary()) -> undefined | map()
verify the passed body, try to parse the json
verify_content_type(X1::tuple()) -> json | undefined | unsupported
verify the content is json or undefined
verify_id(Id::binary() | undefined) -> binary() | undefined
verify the id
verify_issuer(Rsp::binary() | undefined) -> binary() | undefined | rsps_disabled | unkonwn_rsp | bad_issuer
verify the issuer
verify_method(X1::binary()) -> get | post | delete
verify the method
verify_session(X1::{ok, pid()} | any()) -> pid() | undefined
verify the session, just check if it is a pid
verify_token(Token::binary() | undefined) -> binary() | undefined | bad_token
verify the token passed
verify_type(Type::binary() | undefined) -> request_type()
verify the request type
verify_version(X1::binary() | undefined) -> integer()
verify the passed version
Generated by EDoc