mirror of
https://github.com/arun11299/cpp-jwt.git
synced 2025-05-17 18:28:33 +00:00
Added new parameters for decode API
This commit is contained in:
parent
de38b3a82a
commit
09bc72c9f7
6 changed files with 107 additions and 6 deletions
include/jwt
|
@ -101,6 +101,47 @@ struct headers_param
|
|||
MappingConcept headers_;
|
||||
};
|
||||
|
||||
/**
|
||||
*/
|
||||
struct verify_param
|
||||
{
|
||||
verify_param(bool v)
|
||||
: verify_(v)
|
||||
{}
|
||||
|
||||
bool get() const { return verify_; }
|
||||
|
||||
bool verify_;
|
||||
};
|
||||
|
||||
/**
|
||||
*/
|
||||
template <typename Sequence>
|
||||
struct algorithms_param
|
||||
{
|
||||
algorithms_param(Sequence&& seq)
|
||||
: seq_(std::forward<Sequence>(seq))
|
||||
{}
|
||||
|
||||
Sequence get() && { return std::move(seq_); }
|
||||
const Sequence& get() const& { return seq_; }
|
||||
|
||||
Sequence seq_;
|
||||
};
|
||||
|
||||
/**
|
||||
*/
|
||||
struct leeway_param
|
||||
{
|
||||
leeway_param(uint32_t v)
|
||||
: leeway_(v)
|
||||
{}
|
||||
|
||||
uint32_t get() const noexcept { return leeway_; }
|
||||
|
||||
uint32_t leeway_;
|
||||
};
|
||||
|
||||
} // END namespace detail
|
||||
|
||||
// Useful typedef
|
||||
|
@ -181,6 +222,22 @@ headers(MappingConcept&& mc)
|
|||
return { std::forward<MappingConcept>(mc) };
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
detail::verify_param
|
||||
verify(bool v)
|
||||
{
|
||||
return { v };
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
detail::leeway_param
|
||||
leeway(uint32_t l)
|
||||
{
|
||||
return { l };
|
||||
}
|
||||
|
||||
} // END namespace params
|
||||
} // END namespace jwt
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue