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

Authentication extension points for server transports. More...

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

Go to the source code of this file.

Classes

struct  mcp::server::AuthRequest
 Transport-neutral authentication input. More...
 
struct  mcp::server::AuthIdentity
 Authenticated principal and associated claims. More...
 
class  mcp::server::AuthProvider
 Abstract authentication provider used by server integrations. More...
 
class  mcp::server::StaticBearerAuthProvider
 Static bearer-token AuthProvider for small embedded deployments and tests. More...
 
struct  mcp::server::StaticBearerAuthProvider::Entry
 

Functions

bool mcp::server::detail::ascii_iequals (std::string_view lhs, std::string_view rhs)
 
bool mcp::server::detail::constant_time_string_equal (std::string_view lhs, std::string_view rhs)
 
std::string_view mcp::server::detail::trim_ascii (std::string_view value)
 
std::string_view mcp::server::detail::bearer_token_from_authorization (std::string_view authorization)
 
core::Error mcp::server::make_auth_error (std::string message, std::string detail={})
 Build a structured authentication failure for transports.
 

Variables

constexpr std::string_view mcp::server::AuthErrorCategory = "auth"
 Stable core::Error category used for server authentication failures.
 
constexpr std::string_view mcp::server::DefaultAuthChallenge = "Bearer"
 Default HTTP challenge used when a transport has no custom policy.
 

Detailed Description

Authentication extension points for server transports.