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

#include <cose_auth.h>

Inherits ccf::AuthnPolicy.

Inherited by ccf::ActiveMemberCOSESign1AuthnPolicy.

Public Member Functions

 MemberCOSESign1AuthnPolicy (std::optional< std::string > gov_msg_type_=std::nullopt)
 
 ~MemberCOSESign1AuthnPolicy ()
 
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 = "member_cose_sign1"
 

Protected Attributes

std::optional< std::string > gov_msg_type = std::nullopt
 

Static Protected Attributes

static const OpenAPISecuritySchema security_schema
 

Detailed Description

Member COSE Sign1 Authentication Policy

Allows ccf.gov.msg.type and ccf.gov.msg.proposal_id protected header entries, to specify the type of governance action, and which proposal it refers to.

Constructor & Destructor Documentation

◆ MemberCOSESign1AuthnPolicy()

ccf::MemberCOSESign1AuthnPolicy::MemberCOSESign1AuthnPolicy ( std::optional< std::string >  gov_msg_type_ = std::nullopt)

◆ ~MemberCOSESign1AuthnPolicy()

ccf::MemberCOSESign1AuthnPolicy::~MemberCOSESign1AuthnPolicy ( )
default

Member Function Documentation

◆ authenticate()

std::unique_ptr< AuthnIdentity > ccf::MemberCOSESign1AuthnPolicy::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::MemberCOSESign1AuthnPolicy::get_openapi_security_schema ( ) const
inlineoverridevirtual

Implements ccf::AuthnPolicy.

◆ get_security_scheme_name()

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

Implements ccf::AuthnPolicy.

◆ set_unauthenticated_error()

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

Reimplemented from ccf::AuthnPolicy.

Member Data Documentation

◆ gov_msg_type

std::optional<std::string> ccf::MemberCOSESign1AuthnPolicy::gov_msg_type = std::nullopt
protected

◆ security_schema

const OpenAPISecuritySchema ccf::MemberCOSESign1AuthnPolicy::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 member identity registered with this service."}})
static constexpr auto SECURITY_SCHEME_NAME
Definition cose_auth.h:121

◆ SECURITY_SCHEME_NAME

constexpr auto ccf::MemberCOSESign1AuthnPolicy::SECURITY_SCHEME_NAME = "member_cose_sign1"
staticconstexpr

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