@@ -808,7 +808,7 @@ namespace jwt {
808808 * \brief Load a public key from a string.
809809 *
810810 * The string should contain a pem encoded certificate or public key
811- *
811+ *
812812 * \deprecated Use the templated version helper::load_private_key_from_string with error::ecdsa_error
813813 *
814814 * \param key String containing the certificate encoded as pem
@@ -872,7 +872,7 @@ namespace jwt {
872872 * The string should contain a pem encoded certificate or public key
873873 *
874874 * \deprecated Use the templated version helper::load_private_key_from_string with error::ecdsa_error
875- *
875+ *
876876 * \param key String containing the certificate or key encoded as pem
877877 * \param password Password used to decrypt certificate or key (leave empty if not encrypted)
878878 * \throw ecdsa_exception if an error occurred
@@ -887,7 +887,7 @@ namespace jwt {
887887
888888 /* *
889889 * \brief Load a private key from a string.
890- *
890+ *
891891 * \deprecated Use the templated version helper::load_private_key_from_string with error::ecdsa_error
892892 *
893893 * \param key String containing a private key as pem
@@ -1077,7 +1077,7 @@ namespace jwt {
10771077 * \brief Load a private key from a string.
10781078 *
10791079 * \deprecated Use the templated version helper::load_private_key_from_string with error::ecdsa_error
1080- *
1080+ *
10811081 * \param key String containing a private key as pem
10821082 * \param password Password used to decrypt key (leave empty if not encrypted)
10831083 * \throw ecdsa_exception if an error occurred
@@ -1372,7 +1372,7 @@ namespace jwt {
13721372 struct hmacsha {
13731373 /* *
13741374 * Construct new hmac algorithm
1375- *
1375+ *
13761376 * \param key Key to use for HMAC
13771377 * \param md Pointer to hash function
13781378 * \param name Name of the algorithm
@@ -1381,7 +1381,7 @@ namespace jwt {
13811381 : secret(std::move(key)), md(md), alg_name(std::move(name)) {}
13821382 /* *
13831383 * Sign jwt data
1384- *
1384+ *
13851385 * \param data The data to sign
13861386 * \param ec error_code filled with details on error
13871387 * \return HMAC signature for the given data
@@ -1402,7 +1402,7 @@ namespace jwt {
14021402 }
14031403 /* *
14041404 * Check if signature is valid
1405- *
1405+ *
14061406 * \param data The data to check signature against
14071407 * \param signature Signature provided by the jwt
14081408 * \param ec Filled with details about failure.
@@ -1423,7 +1423,7 @@ namespace jwt {
14231423 }
14241424 /* *
14251425 * Returns the algorithm name provided to the constructor
1426- *
1426+ *
14271427 * \return algorithm's name
14281428 */
14291429 std::string name () const { return alg_name; }
@@ -1442,7 +1442,7 @@ namespace jwt {
14421442 struct rsa {
14431443 /* *
14441444 * Construct new rsa algorithm
1445- *
1445+ *
14461446 * \param public_key RSA public key in PEM format
14471447 * \param private_key RSA private key or empty string if not available. If empty, signing will always fail.
14481448 * \param public_key_password Password to decrypt public key pem.
@@ -1495,7 +1495,7 @@ namespace jwt {
14951495 }
14961496 /* *
14971497 * Check if signature is valid
1498- *
1498+ *
14991499 * \param data The data to check signature against
15001500 * \param signature Signature provided by the jwt
15011501 * \param ec Filled with details on failure
@@ -2053,13 +2053,13 @@ namespace jwt {
20532053 };
20542054 /* *
20552055 * RS256 algorithm.
2056- *
2056+ *
20572057 * This data structure is used to describe the RSA256 and can be used to verify JWTs
20582058 */
20592059 struct rs256 : public rsa {
20602060 /* *
20612061 * \brief Construct new instance of algorithm
2062- *
2062+ *
20632063 * \param public_key RSA public key in PEM format
20642064 * \param private_key RSA private key or empty string if not available. If empty, signing will always fail.
20652065 * \param public_key_password Password to decrypt public key pem.
@@ -2459,11 +2459,13 @@ namespace jwt {
24592459 struct is_valid_json_array {
24602460 template <typename T>
24612461 using value_type_t = typename T::value_type;
2462+ using front_base_type = typename std::decay<decltype (std::declval<array_type>().front())>::type;
24622463
24632464 static constexpr auto value = std::is_constructible<value_type, array_type>::value &&
24642465 is_iterable<array_type>::value &&
24652466 is_detected<value_type_t , array_type>::value &&
2466- std::is_same<typename array_type::value_type, value_type>::value;
2467+ std::is_same<typename array_type::value_type, value_type>::value &&
2468+ std::is_same<front_base_type, value_type>::value;
24672469 };
24682470
24692471 template <typename string_type, typename integer_type>
@@ -3728,9 +3730,9 @@ namespace jwt {
37283730 * Specify a claim to check for using the specified operation.
37293731 * This is helpful for implementating application specific authentication checks
37303732 * such as the one seen in partial-claim-verifier.cpp
3731- *
3733+ *
37323734 * \snippet{trimleft} partial-claim-verifier.cpp verifier check custom claim
3733- *
3735+ *
37343736 * \param name Name of the claim to check for
37353737 * \param fn Function to use for verifying the claim
37363738 * \return *this to allow chaining
@@ -3743,9 +3745,9 @@ namespace jwt {
37433745 /* *
37443746 * Specify a claim to check for equality (both type & value).
37453747 * See the private-claims.cpp example.
3746- *
3748+ *
37473749 * \snippet{trimleft} private-claims.cpp verify exact claim
3748- *
3750+ *
37493751 * \param name Name of the claim to check for
37503752 * \param c Claim to check for
37513753 * \return *this to allow chaining
@@ -3756,13 +3758,13 @@ namespace jwt {
37563758
37573759 /* *
37583760 * \brief Add an algorithm available for checking.
3759- *
3761+ *
37603762 * This is used to handle incomming tokens for predefined algorithms
37613763 * which the authorization server is provided. For example a small system
37623764 * where only a single RSA key-pair is used to sign tokens
3763- *
3765+ *
37643766 * \snippet{trimleft} example/rsa-verify.cpp allow rsa algorithm
3765- *
3767+ *
37663768 * \tparam Algorithm any algorithm such as those provided by jwt::algorithm
37673769 * \param alg Algorithm to allow
37683770 * \return *this to allow chaining
@@ -4122,18 +4124,18 @@ namespace jwt {
41224124 * Default clock class using std::chrono::system_clock as a backend.
41234125 */
41244126 struct default_clock {
4125- /* *
4127+ /* *
41264128 * Gets the current system time
4127- * \return time_point of the host system
4129+ * \return time_point of the host system
41284130 */
41294131 date now () const { return date::clock::now (); }
41304132 };
41314133
41324134 /* *
41334135 * Create a verifier using the default_clock.
4134- *
4135- *
4136- *
4136+ *
4137+ *
4138+ *
41374139 * \param c Clock instance to use
41384140 * \return verifier instance
41394141 */
@@ -4153,7 +4155,7 @@ namespace jwt {
41534155 /* *
41544156 * \brief Decode a token. This can be used to to help access important feild like 'x5c'
41554157 * for verifying tokens. See associated example rsa-verify.cpp for more details.
4156- *
4158+ *
41574159 * \tparam json_traits JSON implementation traits
41584160 * \tparam Decode is callable, taking a string_type and returns a string_type.
41594161 * It should ensure the padding of the input and then base64url decode and
@@ -4172,7 +4174,7 @@ namespace jwt {
41724174 /* *
41734175 * Decode a token. This can be used to to help access important feild like 'x5c'
41744176 * for verifying tokens. See associated example rsa-verify.cpp for more details.
4175- *
4177+ *
41764178 * \tparam json_traits JSON implementation traits
41774179 * \param token Token to decode
41784180 * \return Decoded token
@@ -4194,10 +4196,10 @@ namespace jwt {
41944196 return jwk<json_traits>(jwk_);
41954197 }
41964198 /* *
4197- * Parse a JSON Web Key Set. This can be used to to help access
4199+ * Parse a JSON Web Key Set. This can be used to to help access
41984200 * important feild like 'x5c' for verifying tokens. See example
41994201 * jwks-verify.cpp for more information.
4200- *
4202+ *
42014203 * \tparam json_traits JSON implementation traits
42024204 * \param jwks_ string buffer containing the JSON object
42034205 * \return Parsed JSON object containing the data of the JWK SET string
0 commit comments