config.pl -- Make HTTP locations known to JSON code
- swish_reply_config(+Request, +Options) is semidet
- Emit a configuration object to the client if the client requests for '.../swish_config.json', regardless of the path prefix.
- swish_config_hash(-Hash, +Options) is det
- True if Hash is the SHA1 of the SWISH config.
- config(-Key, -Value) is nondet[multifile]
- swish_config(-Key, -Value) is nondet[multifile]
- Define a name/value pair that will end up in the SWISH config
- login_item(-Server, -Item) is nondet[multifile]
- This hook is called to find all possible login options. It
should bind Item to an HTML description for html//1 that must be
clicked to login with this option. The item may have the
following HTML attributes:
- This must be present and provides the first argument for the login/2 hook.
- The login is realised in a popup to avoid reloading the
current swish page. If Style is
popup, a browser popup window is used. This is necessary for identity providers that refuse to open inside a frame. The default is
iframe, which handles the login inside an
iframeelement in a modal popup.
The Item is often an image. The image must have a class
login-with. Below is an example to login with Google:
swish_config:login_item(Item) :- http_absolute_location(icons('social_google_box.png'), Img, ), Item = img([ src(Img), class('login-with'), 'data-server'(google), title('Login with Google') ]).
- login(+Server, +Request) is det[multifile]
- If a login item with
'data-server'(+Server)is clicked, the HTTP handler with id
loginis called. This handler figures the selected login server and calls this hook.
- user_info(+Request, -Server, -UserInfo:dict) is semidet[multifile]
- Each login facility must provide this hook. The hook should
succeed if-and-only-if the user is logged in using this facility
and the hook must bind UserInfo with a dict that contains the
- User name (id) if the logged in user.
- Common name of the logged in user.
- Email address of the logged in user.
- If present, URL is used to indicate the currently logged in user.
- Authentication method used. Currently one of
- URL that must be used to logout. Needed if
auth_methodis not one of the HTTP authentication methods (
If this hook fails the user is not logged in.
- source_alias(?Alias, ?Options) is nondet[multifile]
- Multifile hook that defines properties of file_search_path/2
aliases wrt. storage handling. Defined options are:
- One of
- The New Tab search form searches in files that satisfy the given pattern in the matching directories. Pattern is handed to expand_file_name/2.