![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Base/AuthorizationProvider.h>
A most basic AuthorizationProvider that only tracks a static list of authorization headers. More...
A most basic AuthorizationProvider that only tracks a static list of authorization headers.
Authorization headers need to be added manually and are neither refreshed nor can be acquired.
Public Member Functions | |
std::string | authorization (const Filesystem::Url &url) const override |
Get the Authorization header for the given url. | |
bool | refreshAuthorization (const Filesystem::Url &url, int numFailedRequests) override |
Does nothing if numFailedRequests is 0, otherwise calls removeAuthorization. | |
bool | acquireAuthorization (const Filesystem::Url &url, const std::string &message) override |
Returns whether there is a header for the given url. | |
void | removeAuthorization (const Filesystem::Url &url) override |
Removes the url from the headers. | |
void | addAuthorization (Filesystem::Url url, std::string header) |
Adds a new header for the given url. | |
![]() | |
Filesystem::Url | extractServerUrl (const Filesystem::Url &url) const |
Extract the server part of the URL. | |
|
overridevirtual |
Get the Authorization header for the given url.
The url is the complete url for the request that is going to be performed. Implementation should cache the value according to the server URL (see extractServerUrl). When an empty string is returned, no Authorization header should be send. This method will be called from multiple threads.
Implements AuthorizationProvider.
|
overridevirtual |
Does nothing if numFailedRequests is 0, otherwise calls removeAuthorization.
Implements AuthorizationProvider.
|
overridevirtual |
Returns whether there is a header for the given url.
Does nothing else.
Implements AuthorizationProvider.
|
overridevirtual |
Removes the url from the headers.
Implements AuthorizationProvider.