MCPcopy Create free account
hub / github.com/3rdparty/libprocess / WWWAuthenticate

Class WWWAuthenticate

include/process/http.hpp:426–453  ·  view source on GitHub ↗

https://tools.ietf.org/html/rfc2617.

Source from the content-addressed store, hash-verified

424
425// https://tools.ietf.org/html/rfc2617.
426class WWWAuthenticate
427{
428public:
429 static constexpr const char* NAME = "WWW-Authenticate";
430
431 WWWAuthenticate(
432 const std::string& authScheme,
433 const hashmap<std::string, std::string>& authParam)
434 : authScheme_(authScheme),
435 authParam_(authParam) {}
436
437 static Try<WWWAuthenticate> create(const std::string& value);
438
439 std::string authScheme();
440 hashmap<std::string, std::string> authParam();
441
442private:
443 // According to RFC, HTTP/1.1 server may return multiple challenges
444 // with a 401 (Authenticate) response. Each challenage is in the
445 // format of 'auth-scheme 1*SP 1#auth-param' and each challenage may
446 // use a different auth-scheme.
447 // https://tools.ietf.org/html/rfc2617#section-4.6
448 //
449 // TODO(gilbert): We assume there is only one authenticate challenge.
450 // Multiple challenges should be supported as well.
451 std::string authScheme_;
452 hashmap<std::string, std::string> authParam_;
453};
454
455} // namespace header {
456

Callers 1

createMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected