AXIAM C++ SDK 1.0.0-alpha8
Authentication, authorization, JWKS & route guards (REST + mTLS)
Loading...
Searching...
No Matches
Classes | Namespaces | Enumerations | Functions
webhook.hpp File Reference
#include <chrono>
#include <cstdint>
#include <functional>
#include <optional>
#include <string>
#include "axiam/errors.hpp"
#include "axiam/sensitive.hpp"

Go to the source code of this file.

Classes

struct  axiam::webhook::Event
 A verified delivery. More...
 
struct  axiam::webhook::Options
 Optional inputs to verify(). More...
 
struct  axiam::webhook::Result
 Outcome of verify(). Contextually convertible to bool; falsy means rejected. More...
 
class  axiam::webhook::VerifyException
 Thrown by verify_or_throw() when a delivery does not verify. More...
 

Namespaces

namespace  axiam
 
namespace  axiam::webhook
 

Enumerations

enum class  axiam::webhook::VerifyError {
  axiam::webhook::kNone = 0 , axiam::webhook::kEmptySecret , axiam::webhook::kMalformedHeader , axiam::webhook::kMissingSignature ,
  axiam::webhook::kMalformedTimestamp , axiam::webhook::kTimestampHeaderMismatch , axiam::webhook::kSignatureMismatch , axiam::webhook::kTimestampOutOfTolerance
}
 Why verification failed. More...
 

Functions

const char * axiam::webhook::to_string (VerifyError error) noexcept
 Stable, secret-free description of a VerifyError.
 
Result axiam::webhook::verify (const Sensitive< std::string > &secret, const std::string &signature_header, const std::string &body, const Options &options=Options{})
 Verify a webhook delivery.
 
Result axiam::webhook::verify (const std::string &secret, const std::string &signature_header, const std::string &body, const Options &options=Options{})
 Overload for a secret that is not already wrapped. Prefer the Sensitive form.
 
Event axiam::webhook::verify_or_throw (const Sensitive< std::string > &secret, const std::string &signature_header, const std::string &body, const Options &options=Options{})
 Throwing twin of verify(), for handlers that prefer an exception.