Skip to content

Commit

Permalink
fix name for traits (missed replaces)
Browse files Browse the repository at this point in the history
  • Loading branch information
prince-chrismc authored Dec 9, 2023
1 parent de26fe1 commit 0cfd157
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion example/traits/open-source-parsers-jsoncpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
int main() {
using sec = std::chrono::seconds;
using min = std::chrono::minutes;
using traits = jwt::traits::nlohmann_json;
using traits = jwt::traits::osp_jsoncpp;
using claim = jwt::basic_claim<traits>;

claim from_raw_json;
Expand Down
28 changes: 14 additions & 14 deletions include/jwt-cpp/traits/open-source-parsers-jsoncpp/defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@

namespace jwt {
/**
* \brief a class to store a generic [jsoncpp](https://github.com/open-source-parsers/jsoncpp) value as claim
* \brief a class to store a generic [osp_jsoncpp](https://github.com/open-source-parsers/osp_jsoncpp) value as claim
*
* This type is the specialization of the \ref basic_claim class which
* uses the standard template types.
*/
using claim = basic_claim<traits::jsoncpp>;
using claim = basic_claim<traits::osp_jsoncpp>;

/**
* Create a verifier using the default clock
* \return verifier instance
*/
inline verifier<default_clock, traits::jsoncpp> verify() {
return verify<default_clock, traits::jsoncpp>(default_clock{});
inline verifier<default_clock, traits::osp_jsoncpp> verify() {
return verify<default_clock, traits::osp_jsoncpp>(default_clock{});
}

/**
* Return a builder instance to create a new token
*/
inline builder<traits::jsoncpp> create() { return builder<traits::jsoncpp>(); }
inline builder<traits::osp_jsoncpp> create() { return builder<traits::osp_jsoncpp>(); }

#ifndef JWT_DISABLE_BASE64
/**
Expand All @@ -37,8 +37,8 @@ namespace jwt {
* \throw std::invalid_argument Token is not in correct format
* \throw std::runtime_error Base64 decoding failed or invalid json
*/
inline decoded_jwt<traits::jsoncpp> decode(const std::string& token) {
return decoded_jwt<traits::jsoncpp>(token);
inline decoded_jwt<traits::osp_jsoncpp> decode(const std::string& token) {
return decoded_jwt<traits::osp_jsoncpp>(token);
}
#endif

Expand All @@ -54,8 +54,8 @@ namespace jwt {
* \throw std::runtime_error Base64 decoding failed or invalid json
*/
template<typename Decode>
decoded_jwt<traits::jsoncpp> decode(const std::string& token, Decode decode) {
return decoded_jwt<traits::jsoncpp>(token, decode);
decoded_jwt<traits::osp_jsoncpp> decode(const std::string& token, Decode decode) {
return decoded_jwt<traits::osp_jsoncpp>(token, decode);
}

/**
Expand All @@ -64,8 +64,8 @@ namespace jwt {
* \return Parsed JWK
* \throw std::runtime_error Token is not in correct format
*/
inline jwk<traits::jsoncpp> parse_jwk(const traits::jsoncpp::string_type& token) {
return jwk<traits::jsoncpp>(token);
inline jwk<traits::osp_jsoncpp> parse_jwk(const traits::osp_jsoncpp::string_type& token) {
return jwk<traits::osp_jsoncpp>(token);
}

/**
Expand All @@ -74,15 +74,15 @@ namespace jwt {
* \return Parsed JWKs
* \throw std::runtime_error Token is not in correct format
*/
inline jwks<traits::jsoncpp> parse_jwks(const traits::jsoncpp::string_type& token) {
return jwks<traits::jsoncpp>(token);
inline jwks<traits::osp_jsoncpp> parse_jwks(const traits::osp_jsoncpp::string_type& token) {
return jwks<traits::osp_jsoncpp>(token);
}

/**
* This type is the specialization of the \ref verify_ops::verify_context class which
* uses the standard template types.
*/
using verify_context = verify_ops::verify_context<traits::jsoncpp>;
using verify_context = verify_ops::verify_context<traits::osp_jsoncpp>;
} // namespace jwt

#endif // JWT_CPP_JSONCPP_DEFAULTS_H

0 comments on commit 0cfd157

Please sign in to comment.