Goby3
3.1.5a
2024.05.23
|
#include <goby/util/thirdparty/jwt-cpp/jwt.h>
Public Types | |
using | basic_claim_t = basic_claim< json_traits > |
Public Types inherited from jwt::header< json_traits > | |
using | basic_claim_t = basic_claim< json_traits > |
Public Types inherited from jwt::payload< json_traits > | |
using | basic_claim_t = basic_claim< json_traits > |
Public Member Functions | |
JWT_CLAIM_EXPLICIT | decoded_jwt (const typename json_traits::string_type &token) |
Parses a given token. More... | |
template<typename Decode > | |
decoded_jwt (const typename json_traits::string_type &token, Decode decode) | |
Parses a given token. More... | |
const json_traits::string_type & | get_token () const noexcept |
const json_traits::string_type & | get_header () const noexcept |
const json_traits::string_type & | get_payload () const noexcept |
const json_traits::string_type & | get_signature () const noexcept |
const json_traits::string_type & | get_header_base64 () const noexcept |
const json_traits::string_type & | get_payload_base64 () const noexcept |
const json_traits::string_type & | get_signature_base64 () const noexcept |
std::unordered_map< typename json_traits::string_type, basic_claim_t > | get_payload_claims () const |
std::unordered_map< typename json_traits::string_type, basic_claim_t > | get_header_claims () const |
basic_claim_t | get_payload_claim (const typename json_traits::string_type &name) const |
basic_claim_t | get_header_claim (const typename json_traits::string_type &name) const |
Public Member Functions inherited from jwt::header< json_traits > | |
bool | has_algorithm () const noexcept |
bool | has_type () const noexcept |
bool | has_content_type () const noexcept |
bool | has_key_id () const noexcept |
json_traits::string_type | get_algorithm () const |
json_traits::string_type | get_type () const |
json_traits::string_type | get_content_type () const |
json_traits::string_type | get_key_id () const |
bool | has_header_claim (const typename json_traits::string_type &name) const noexcept |
basic_claim_t | get_header_claim (const typename json_traits::string_type &name) const |
Public Member Functions inherited from jwt::payload< json_traits > | |
bool | has_issuer () const noexcept |
bool | has_subject () const noexcept |
bool | has_audience () const noexcept |
bool | has_expires_at () const noexcept |
bool | has_not_before () const noexcept |
bool | has_issued_at () const noexcept |
bool | has_id () const noexcept |
json_traits::string_type | get_issuer () const |
json_traits::string_type | get_subject () const |
basic_claim_t::set_t | get_audience () const |
date | get_expires_at () const |
date | get_not_before () const |
date | get_issued_at () const |
json_traits::string_type | get_id () const |
bool | has_payload_claim (const typename json_traits::string_type &name) const noexcept |
basic_claim_t | get_payload_claim (const typename json_traits::string_type &name) const |
Protected Attributes | |
const json_traits::string_type | token |
Unmodifed token, as passed to constructor. More... | |
json_traits::string_type | header |
Header part decoded from base64. More... | |
json_traits::string_type | header_base64 |
Unmodified header part in base64. More... | |
json_traits::string_type | payload |
Payload part decoded from base64. More... | |
json_traits::string_type | payload_base64 |
Unmodified payload part in base64. More... | |
json_traits::string_type | signature |
Signature part decoded from base64. More... | |
json_traits::string_type | signature_base64 |
Unmodified signature part in base64. More... | |
Protected Attributes inherited from jwt::header< json_traits > | |
details::map_of_claims< json_traits > | header_claims |
Protected Attributes inherited from jwt::payload< json_traits > | |
details::map_of_claims< json_traits > | payload_claims |
Class containing all information about a decoded token
using jwt::decoded_jwt< json_traits >::basic_claim_t = basic_claim<json_traits> |
|
inline |
|
inline |
Parses a given token.
Decode | is callabled, taking a string_type and returns a string_type. It should ensure the padding of the input and then base64url decode and return the results. |
token | The token to parse |
decode | The function to decode the token |
std::invalid_argument | Token is not in correct format |
std::runtime_error | Base64 decoding failed or invalid json |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Get a header claim by name
name | the name of the desired claim |
jwt::error::claim_not_present_exception | if the claim was not present |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Get a payload claim by name
name | the name of the desired claim |
jwt::error::claim_not_present_exception | if the claim was not present |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |