ImFusion C++ SDK 4.4.0
ImFusion::Network::StaticAuthorizationProvider Class Reference

#include <ImFusion/Base/AuthorizationProvider.h>

A most basic AuthorizationProvider that only tracks a static list of authorization headers. More...

Inheritance diagram for ImFusion::Network::StaticAuthorizationProvider:

Detailed Description

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.
Public Member Functions inherited from ImFusion::Network::AuthorizationProvider
virtual std::optional< AccessTokenaccessToken (const Filesystem::Url &url) const
 Returns a complete AccessToken if there is one.
Filesystem::Url extractServerUrl (const Filesystem::Url &url) const
 Extract the server part of the URL.

Member Function Documentation

◆ authorization()

std::string ImFusion::Network::StaticAuthorizationProvider::authorization ( const Filesystem::Url & url) const
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 ImFusion::Network::AuthorizationProvider.

◆ refreshAuthorization()

bool ImFusion::Network::StaticAuthorizationProvider::refreshAuthorization ( const Filesystem::Url & url,
int numFailedRequests )
overridevirtual

Does nothing if numFailedRequests is 0, otherwise calls removeAuthorization.

Implements ImFusion::Network::AuthorizationProvider.

◆ acquireAuthorization()

bool ImFusion::Network::StaticAuthorizationProvider::acquireAuthorization ( const Filesystem::Url & url,
const std::string & message )
overridevirtual

Returns whether there is a header for the given url.

Does nothing else.

Implements ImFusion::Network::AuthorizationProvider.

◆ removeAuthorization()

void ImFusion::Network::StaticAuthorizationProvider::removeAuthorization ( const Filesystem::Url & url)
overridevirtual

Removes the url from the headers.

Implements ImFusion::Network::AuthorizationProvider.


The documentation for this class was generated from the following file:
  • ImFusion/Base/AuthorizationProvider.h
Search Tab / S to search, Esc to close