Module watts_http_rsp

the http endpoint to redirect a user to for an RSP flow.

Behaviours: cowboy_http_handler.

Description

the http endpoint to redirect a user to for an RSP flow.

Data Types

state()

state() = #state{}

Function Index

execute_or_error/5*redirect to the provider for login or trigger the plugin.
get_return_url/2*return the url to use on fail/success of plugin execution.
handle/2start a session if jwt parsing succeeded and get a queue entry, else retrun back.
handle_queue_result/2*handle the toke or error of requesting the queue.
init/3init the request handling, does nothing.
maybe_handle/3*maybe handle the request, if there are not too many per second.
redirect_to_provider/4*redirect the a provider for login.
request_queue_if_configured/2*request a token at the queue if needed.
set_cookie/2*set the cookie for session.
setup_session_and_start/3*check the parsing result and maybe start the session and trigger the needed action.
terminate/3on termination do nothing.
warning/2*log a warning.

Function Details

execute_or_error/5 *

execute_or_error(X1::watts_rsp:request_type() | {error, Reason::atom()}, Session::pid(), Rsp::watts_rsp:rsp(), Req::cowboy_req:req(), State::state()) -> {ok, cowboy_req:req(), state()}

redirect to the provider for login or trigger the plugin

get_return_url/2 *

get_return_url(X1::{ok, any()} | any(), Rsp::watts_rsp:rsp()) -> binary()

return the url to use on fail/success of plugin execution

handle/2

handle(Req::cowboy_req:req(), State::state()) -> {ok, cowboy_req:req(), state()}

start a session if jwt parsing succeeded and get a queue entry, else retrun back

handle_queue_result/2 *

handle_queue_result(X1::{ok, any()} | any(), State::state()) -> {boolean(), state()}

handle the toke or error of requesting the queue

init/3

init(Type::any(), Req::cowboy_req:req(), Opts::any()) -> {ok, cowboy_req:req(), state()}

init the request handling, does nothing

maybe_handle/3 *

maybe_handle(X1::boolean(), Req::cowboy_req:req(), State::state()) -> {ok, cowboy_req:req(), state()}

maybe handle the request, if there are not too many per second.

redirect_to_provider/4 *

redirect_to_provider(Session::pid(), Rsp::watts_rsp:rsp(), Req::cowboy_req:req(), State::state()) -> {ok, cowboy_req:req(), state()}

redirect the a provider for login

request_queue_if_configured/2 *

request_queue_if_configured(X1::boolean(), State::state()) -> {boolean(), state()}

request a token at the queue if needed.

set_cookie/2 *

set_cookie(Session::pid(), Req::cowboy_req:req()) -> {ok, cowboy_req:req()}

set the cookie for session.

setup_session_and_start/3 *

setup_session_and_start(X1::{ok, watts_rsp:rsp()} | {error, any(), binary()}, Req::cowboy_req:req(), State::state()) -> {ok, cowboy_req:req(), state()}

check the parsing result and maybe start the session and trigger the needed action.

terminate/3

terminate(Reason::any(), Req::cowboy_req:req(), State::state()) -> ok

on termination do nothing

warning/2 *

warning(Msg::string() | binary(), Params::[any()]) -> ok

log a warning


Generated by EDoc