cxxmcp 1.1.6
C++ MCP SDK
Loading...
Searching...
No Matches
www_auth.hpp File Reference

WWW-Authenticate challenge models and parser boundary. More...

#include <cctype>
#include <optional>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "cxxmcp/auth/types.hpp"
#include "cxxmcp/core/result.hpp"

Go to the source code of this file.

Classes

struct  mcp::auth::WwwAuthenticateChallenge
 Parsed authentication challenge from a WWW-Authenticate header. More...
 
class  mcp::auth::WwwAuthenticateParser
 Parser boundary for HTTP authentication challenges. More...
 
class  mcp::auth::DefaultWwwAuthenticateParser
 Default RFC-style parser for WWW-Authenticate challenge headers. More...
 

Functions

bool mcp::auth::detail::is_http_token_char (char value)
 
bool mcp::auth::detail::is_token68_char (char value)
 
void mcp::auth::detail::skip_ows (std::string_view input, std::size_t &pos)
 
std::string mcp::auth::detail::parse_token (std::string_view input, std::size_t &pos)
 
std::string mcp::auth::detail::ascii_lower (std::string value)
 
bool mcp::auth::detail::ascii_iequals (std::string_view lhs, std::string_view rhs)
 
core::Error mcp::auth::detail::www_auth_parse_error (std::string message)
 
core::Result< std::string > mcp::auth::detail::parse_quoted_string (std::string_view input, std::size_t &pos)
 
bool mcp::auth::detail::comma_starts_parameter (std::string_view input, std::size_t pos)
 
bool mcp::auth::detail::starts_parameter (std::string_view input, std::size_t pos)
 
std::optional< std::string > mcp::auth::resource_metadata_url (const WwwAuthenticateChallenge &challenge)
 Returns the MCP OAuth protected-resource metadata URL, when present.
 
bool mcp::auth::insufficient_scope (const WwwAuthenticateChallenge &challenge)
 Returns true for an OAuth insufficient_scope challenge.
 
std::optional< std::string > mcp::auth::first_resource_metadata_url (const std::vector< WwwAuthenticateChallenge > &challenges)
 Returns the first resource_metadata parameter in parsed challenges.
 
core::Result< std::vector< WwwAuthenticateChallenge > > mcp::auth::parse_www_authenticate (const std::string &header_value)
 Parse a WWW-Authenticate header with the default parser.
 

Variables

constexpr core::StringConstant mcp::auth::WwwAuthenticateResourceMetadataParam
 
constexpr core::StringConstant mcp::auth::WwwAuthenticateErrorParam {"error"}
 
constexpr core::StringConstant mcp::auth::WwwAuthenticateScopeParam {"scope"}
 
constexpr core::StringConstant mcp::auth::WwwAuthenticateInsufficientScopeError
 

Detailed Description

WWW-Authenticate challenge models and parser boundary.

Variable Documentation

◆ WwwAuthenticateInsufficientScopeError

constexpr core::StringConstant mcp::auth::WwwAuthenticateInsufficientScopeError
inlineconstexpr
Initial value:
{
"insufficient_scope"}

◆ WwwAuthenticateResourceMetadataParam

constexpr core::StringConstant mcp::auth::WwwAuthenticateResourceMetadataParam
inlineconstexpr
Initial value:
{
"resource_metadata"}