MediaWiki master
Wikimedia\FileBackend\SwiftAuthProvider Class Reference

Provides authentication to swift file backend. More...

Public Member Functions

 __construct (array $config, MultiHttpClient $http, LoggerInterface $logger)
 
 authTokenHeaders (array $creds)
 
 getAuthentication ()
 Get the cached auth token.
 
 getAuthFailureResponse ()
 Get a synthetic response to return from requestWithAuth() or requestMultiWithAuth() if the request could not be issued due to failure of a prior authentication request.
 
 refreshAuthentication ()
 Fetch the auth token from the server, without caching.
 
 setLogger (LoggerInterface $logger)
 

Public Attributes

const AUTH_FAILURE_ERROR = 'Could not connect due to prior authentication failure'
 

Detailed Description

Provides authentication to swift file backend.

Access: internal

Definition at line 16 of file SwiftAuthProvider.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\FileBackend\SwiftAuthProvider::__construct ( array $config,
MultiHttpClient $http,
LoggerInterface $logger )

Member Function Documentation

◆ authTokenHeaders()

Wikimedia\FileBackend\SwiftAuthProvider::authTokenHeaders ( array $creds)
Returns
array

Definition at line 180 of file SwiftAuthProvider.php.

◆ getAuthentication()

Wikimedia\FileBackend\SwiftAuthProvider::getAuthentication ( )

Get the cached auth token.

Returns
array|null Credential map

Definition at line 71 of file SwiftAuthProvider.php.

◆ getAuthFailureResponse()

Wikimedia\FileBackend\SwiftAuthProvider::getAuthFailureResponse ( )

Get a synthetic response to return from requestWithAuth() or requestMultiWithAuth() if the request could not be issued due to failure of a prior authentication request.

This failure should not be logged as an HTTP error since the original failure would have been logged.

Returns
array

Definition at line 202 of file SwiftAuthProvider.php.

◆ refreshAuthentication()

Wikimedia\FileBackend\SwiftAuthProvider::refreshAuthentication ( )

Fetch the auth token from the server, without caching.

Returns
array|null Credential map

Definition at line 125 of file SwiftAuthProvider.php.

◆ setLogger()

Wikimedia\FileBackend\SwiftAuthProvider::setLogger ( LoggerInterface $logger)

Member Data Documentation

◆ AUTH_FAILURE_ERROR

const Wikimedia\FileBackend\SwiftAuthProvider::AUTH_FAILURE_ERROR = 'Could not connect due to prior authentication failure'

The documentation for this class was generated from the following file: