XRootD
Loading...
Searching...
No Matches
XrdHttpChecksumHandler Class Reference

#include <XrdHttpChecksumHandler.hh>

Collaboration diagram for XrdHttpChecksumHandler:

Public Types

using XrdHttpChecksumRawPtr = XrdHttpChecksumHandlerImpl::XrdHttpChecksumRawPtr

Public Member Functions

 XrdHttpChecksumHandler ()=default
void configure (const char *csList)
XrdHttpChecksumRawPtr getChecksumToRunWantDigest (const std::string &wantDigest) const
XrdHttpChecksumRawPtr getChecksumToRunWantReprDigest (const std::map< std::string, uint8_t > &wantReprDigest) const
const std::vector< std::string > & getNonIANAConfiguredCksums () const

Detailed Description

This class allows to handle xrd http checksum algorithm selection based on what the user provided as a digest

Definition at line 87 of file XrdHttpChecksumHandler.hh.

Member Typedef Documentation

◆ XrdHttpChecksumRawPtr

Constructor & Destructor Documentation

◆ XrdHttpChecksumHandler()

XrdHttpChecksumHandler::XrdHttpChecksumHandler ( )
default

Member Function Documentation

◆ configure()

void XrdHttpChecksumHandler::configure ( const char * csList)
inline

Configure this handler.

Exceptions
runtime_exceptionif no algorithm in the csList is compatible with HTTP
Parameters
csListthe list coming from the server configuration. Should be under the format 0:adler32,1:sha512

Definition at line 97 of file XrdHttpChecksumHandler.hh.

97{ pImpl.configure(csList); }

◆ getChecksumToRunWantDigest()

XrdHttpChecksumRawPtr XrdHttpChecksumHandler::getChecksumToRunWantDigest ( const std::string & wantDigest) const
inline

Returns the checksum to run from the user "Want-Digest" provided string

Parameters
wantDigestthe digest string under the format "sha-512,sha-256;q=0.8,sha;q=0.6,md5;q=0.4,adler32;q=0.2"
Returns
the checksum to run depending on the userDigest provided string The logic behind it is simple: returns the first userDigest provided that matches the one configured. If none is matched, the first algorithm configured on the server side will be returned. If no HTTP-IANA compatible checksum algorithm has been configured or NO checksum algorithm have been configured, nullptr will be returned.

Definition at line 106 of file XrdHttpChecksumHandler.hh.

106{ return pImpl.getChecksumToRunWantDigest(wantDigest); }

◆ getChecksumToRunWantReprDigest()

XrdHttpChecksumRawPtr XrdHttpChecksumHandler::getChecksumToRunWantReprDigest ( const std::map< std::string, uint8_t > & wantReprDigest) const
inline

Returns the checksum to run from the user "Want-Repr-Digest" header provided values (already parsed in a map <digestName, preference>)

Parameters
wantReprDigestthe map containing the user want-repr-digest values
Returns
the checksum to run depending on the map in parameter. If the map contains checksums that are not configured on the server, it will return the first configured checksum on the server. If multiple configured checksums are configured and multiple checksums are requested, it will return the one with the highest preference. If same preference, the checksum returned will be the first one of the alphabetically ordered configured checksum

Definition at line 116 of file XrdHttpChecksumHandler.hh.

116{ return pImpl.getChecksumToRunWantReprDigest(wantReprDigest); }

◆ getNonIANAConfiguredCksums()

const std::vector< std::string > & XrdHttpChecksumHandler::getNonIANAConfiguredCksums ( ) const
inline

Returns the checksums that are incompatible with HTTP --> the ones that we do not know whether the result should be base64 encoded or not

Definition at line 122 of file XrdHttpChecksumHandler.hh.

122{ return pImpl.getNonIANAConfiguredCksums(); }

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