CCF
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Attributes | List of all members
ccf::UserCOSESign1AuthnPolicy Class Reference

#include <cose_auth.h>

Inherits ccf::AuthnPolicy.

Inherited by ccf::TypedUserCOSESign1AuthnPolicy.

Public Member Functions

 UserCOSESign1AuthnPolicy (const std::string &msg_type_name_="ccf.msg.type", const std::string &msg_created_at_name_="ccf.msg.created_at")
 
 ~UserCOSESign1AuthnPolicy ()
 
std::unique_ptr< AuthnIdentityauthenticate (ccf::kv::ReadOnlyTx &tx, const std::shared_ptr< ccf::RpcContext > &ctx, std::string &error_reason) override
 
void set_unauthenticated_error (std::shared_ptr< ccf::RpcContext > ctx, std::string &&error_reason) override
 
std::optional< OpenAPISecuritySchemaget_openapi_security_schema () const override
 
std::string get_security_scheme_name () override
 
- Public Member Functions inherited from ccf::AuthnPolicy
virtual ~AuthnPolicy ()=default
 

Static Public Attributes

static constexpr auto SECURITY_SCHEME_NAME = "user_cose_sign1"
 

Protected Member Functions

virtual std::unique_ptr< UserCOSESign1AuthnIdentity_authenticate (ccf::kv::ReadOnlyTx &tx, const std::shared_ptr< ccf::RpcContext > &ctx, std::string &error_reason)
 

Static Protected Attributes

static const OpenAPISecuritySchema security_schema
 

Detailed Description

User COSE Sign1 Authentication Policy

Allows parametrising two optional protected header entries which are exposed to the endpoint if present.

Constructor & Destructor Documentation

◆ UserCOSESign1AuthnPolicy()

ccf::UserCOSESign1AuthnPolicy::UserCOSESign1AuthnPolicy ( const std::string &  msg_type_name_ = "ccf.msg.type",
const std::string &  msg_created_at_name_ = "ccf.msg.created_at" 
)
inline

◆ ~UserCOSESign1AuthnPolicy()

ccf::UserCOSESign1AuthnPolicy::~UserCOSESign1AuthnPolicy ( )
default

Member Function Documentation

◆ _authenticate()

std::unique_ptr< UserCOSESign1AuthnIdentity > ccf::UserCOSESign1AuthnPolicy::_authenticate ( ccf::kv::ReadOnlyTx tx,
const std::shared_ptr< ccf::RpcContext > &  ctx,
std::string &  error_reason 
)
protectedvirtual

◆ authenticate()

std::unique_ptr< AuthnIdentity > ccf::UserCOSESign1AuthnPolicy::authenticate ( ccf::kv::ReadOnlyTx tx,
const std::shared_ptr< ccf::RpcContext > &  ctx,
std::string &  error_reason 
)
overridevirtual

Implements ccf::AuthnPolicy.

◆ get_openapi_security_schema()

std::optional< OpenAPISecuritySchema > ccf::UserCOSESign1AuthnPolicy::get_openapi_security_schema ( ) const
inlineoverridevirtual

Implements ccf::AuthnPolicy.

◆ get_security_scheme_name()

std::string ccf::UserCOSESign1AuthnPolicy::get_security_scheme_name ( )
inlineoverridevirtual

Implements ccf::AuthnPolicy.

◆ set_unauthenticated_error()

void ccf::UserCOSESign1AuthnPolicy::set_unauthenticated_error ( std::shared_ptr< ccf::RpcContext ctx,
std::string &&  error_reason 
)
overridevirtual

Reimplemented from ccf::AuthnPolicy.

Member Data Documentation

◆ security_schema

const OpenAPISecuritySchema ccf::UserCOSESign1AuthnPolicy::security_schema
staticprotected
Initial value:
=
std::make_pair(
nlohmann::json{
{"type", "http"},
{"scheme", "cose_sign1"},
{"description",
"Request payload must be a COSE Sign1 document, with expected "
"protected headers. "
"Signer must be a user identity registered with this service."}})
static constexpr auto SECURITY_SCHEME_NAME
Definition cose_auth.h:190

◆ SECURITY_SCHEME_NAME

constexpr auto ccf::UserCOSESign1AuthnPolicy::SECURITY_SCHEME_NAME = "user_cose_sign1"
staticconstexpr

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