XRootD
Loading...
Searching...
No Matches
XrdClHttpTokenFileParser.hh
Go to the documentation of this file.
1#ifndef XRDCLHTTP_TOKENFILEPARSER_HH
2#define XRDCLHTTP_TOKENFILEPARSER_HH
3
4#include "XrdClHttpOps.hh"
5
6#include <string>
7
8namespace XrdClHttp {
9
10// Reads the tokens held by the given token file and appends the corresponding
11// 'Authorization' headers to the <src> and/or <dst> header lists.
12//
13// A JSON token file holds the tokens in the 'src' and/or 'dst' properties,
14// any other file holds the <src> token in the first line and the <dst> one
15// in the second line. An absent or empty token means the corresponding side
16// is given no token at all.
17//
18// Returns false if the file cannot be opened or holds no token at all, in
19// which case no header is appended.
20bool ParseTokenFile( const std::string &token_file,
21 CurlCopyOp::Headers &src_hdrs,
22 CurlCopyOp::Headers &dst_hdrs );
23
24}
25
26#endif // XRDCLHTTP_TOKENFILEPARSER_HH
std::vector< std::pair< std::string, std::string > > Headers
bool ParseTokenFile(const std::string &token_file, CurlCopyOp::Headers &src_hdrs, CurlCopyOp::Headers &dst_hdrs)