26#ifndef ROUTER_SRC_REST_MRS_SRC_HELPER_TOKEN_JWT_H_
27#define ROUTER_SRC_REST_MRS_SRC_HELPER_TOKEN_JWT_H_
32#ifdef RAPIDJSON_NO_SIZETYPEDEFINE
36#include <rapidjson/document.h>
55 bool verify(
const std::string &secret)
const;
56 std::string
sign(
const std::string &secret)
const;
Definition: jwt_holder.h:31
std::string parts[3]
Definition: jwt_holder.h:33
std::vector< std::string > get_payload_claim_names() const
Definition: jwt.cc:161
static void parse(const std::string &token, JwtHolder *out)
Definition: jwt.cc:61
const Value * get_payload_claim_custom(const std::string &name) const
Definition: jwt.cc:165
rapidjson::Value Value
Definition: jwt.h:44
Document header_
Definition: jwt.h:75
std::string signature_
Definition: jwt.h:77
Document payload_
Definition: jwt.h:76
JwtHolder holder_
Definition: jwt.h:74
std::string sign(const std::string &secret) const
Definition: jwt.cc:206
std::string get_header_claim_algorithm() const
Definition: jwt.cc:132
static Jwt create(const JwtHolder &holder)
Definition: jwt.cc:86
std::string get_token() const
Definition: jwt.h:64
Jwt()
Definition: jwt.h:48
bool verify(const std::string &secret) const
Definition: jwt.cc:187
bool valid_
Definition: jwt.h:73
static std::vector< std::string > get_payload_names(const Value &v)
Definition: jwt.cc:150
std::string get_header_claim_type() const
Definition: jwt.cc:141
rapidjson::Document Document
Definition: jwt.h:45
bool is_valid() const
Definition: jwt.cc:172
Define rapidjson::SizeType to be std::uint64_t.
struct result result
Definition: result.h:34