diff --git a/.github/workflows/cross-platform.yml b/.github/workflows/cross-platform.yml index 25343b86e..5a1211ea8 100644 --- a/.github/workflows/cross-platform.yml +++ b/.github/workflows/cross-platform.yml @@ -17,7 +17,7 @@ jobs: run: choco install openssl - if: matrix.os == 'macos-latest' - run: cp /usr/local/opt/openssl@1.1/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/ + run: sudo cp /usr/local/opt/openssl@1.1/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/ - uses: actions/checkout@v3 - run: cmake -E make_directory ${{ github.workspace }}/build diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c57f60ee..fc2e61273 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,7 +59,7 @@ elseif(${JWT_SSL_LIBRARY} MATCHES "LibreSSL") elseif(${JWT_SSL_LIBRARY} MATCHES "wolfSSL") find_package(PkgConfig REQUIRED) pkg_check_modules(wolfssl REQUIRED IMPORTED_TARGET wolfssl) - list(TRANSFORM wolfssl_INCLUDE_DIRS APPEND "/wolfssl") # This is required to access OpenSSL compatability API + list(TRANSFORM wolfssl_INCLUDE_DIRS APPEND "/wolfssl") # This is required to access OpenSSL compatibility API endif() if(JWT_EXTERNAL_PICOJSON) @@ -114,7 +114,7 @@ endif() if(${JWT_SSL_LIBRARY} MATCHES "wolfSSL") target_link_libraries(jwt-cpp INTERFACE PkgConfig::wolfssl) - # This is required to access OpenSSL compatability API + # This is required to access OpenSSL compatibility API target_include_directories(jwt-cpp INTERFACE ${wolfssl_INCLUDE_DIRS}) target_compile_definitions(jwt-cpp INTERFACE OPENSSL_EXTRA OPENSSL_ALL) endif() diff --git a/README.md b/README.md index 93fb1ce2b..9aea7c85e 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ jwt::basic_claim claim(json::object({{"json", t This allows for complete freedom when picking which libraries you want to use. For more information, [read this page](docs/traits.md)). -For your convience there are serval traits implementation which provide some popular JSON libraries. They are: +For your convenience there are serval traits implementation which provide some popular JSON libraries. They are: [![picojson][picojson]](https://github.com/kazuho/picojson) [![nlohmann][nlohmann]](https://github.com/nlohmann/json) @@ -82,7 +82,7 @@ For your convience there are serval traits implementation which provide some pop In order to maintain compatibility, [picojson](https://github.com/kazuho/picojson) is still used to provide a specialized `jwt::claim` along with all helpers. Defining `JWT_DISABLE_PICOJSON` will remove this optional dependency. It's possible to directly include the traits defaults for the other JSON libraries. See the [traits examples](https://github.com/Thalhammer/jwt-cpp/tree/master/example/traits) for details. -As for the base64 requirements of JWTs, this libary provides `base.h` with all the required implentation; However base64 implementations are very common, with varying degrees of performance. When providing your own base64 implementation, you can define `JWT_DISABLE_BASE64` to remove the jwt-cpp implementation. +As for the base64 requirements of JWTs, this library provides `base.h` with all the required implementation; However base64 implementations are very common, with varying degrees of performance. When providing your own base64 implementation, you can define `JWT_DISABLE_BASE64` to remove the jwt-cpp implementation. ### Getting Started diff --git a/cmake/jwt-cpp-config.cmake.in b/cmake/jwt-cpp-config.cmake.in index 88ca67d4f..029f3586c 100644 --- a/cmake/jwt-cpp-config.cmake.in +++ b/cmake/jwt-cpp-config.cmake.in @@ -7,7 +7,7 @@ include(CMakeFindDependencyMacro) if(${JWT_SSL_LIBRARY} MATCHES "wolfSSL") find_dependency(PkgConfig REQUIRED) pkg_check_modules(wolfssl REQUIRED IMPORTED_TARGET wolfssl) - list(TRANSFORM wolfssl_INCLUDE_DIRS APPEND "/wolfssl") # This is required to access OpenSSL compatability API + list(TRANSFORM wolfssl_INCLUDE_DIRS APPEND "/wolfssl") # This is required to access OpenSSL compatibility API else() find_dependency(${JWT_SSL_LIBRARY} REQUIRED) endif() diff --git a/docs/faqs.md b/docs/faqs.md index 0d0a6e9e4..48b107fd7 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -8,7 +8,7 @@ This is the expected behaviour. While the integrity of tokens is ensured by the the contents of the token are only **encoded and not encrypted**. This means you can be sure the token has not been modified by an unauthorized party, but you should not store confidential information in it. Anyone with access to the token can read all the claims you put into it. They can however not modify -them unless they have the (private or symetric) key used to generate the token. If you need to put +them unless they have the (private or symmetric) key used to generate the token. If you need to put confidential information into it, current industry recommends generating a random id and store the data on your server, using the id to look it up whenever you need. @@ -54,7 +54,7 @@ This was brought up in [#212](https://github.com/Thalhammer/jwt-cpp/issues/212#i [#101](https://github.com/Thalhammer/jwt-cpp/issues/101) as it's an excellent question. It simply was not required to handle the required keys in JWTs for signing or verification. All the the mandatory keys are numeric, -string or arrary types which required type definitions and access. +string or array types which required type definitions and access. The alternative is to use the `to_json()` method and use the libraries own APIs to pick the data type you need. diff --git a/docs/ssl.md b/docs/ssl.md index 0b3fe6fdd..4f001ac53 100644 --- a/docs/ssl.md +++ b/docs/ssl.md @@ -15,5 +15,5 @@ cmake . -DJWT_SSL_LIBRARY:STRING=wolfSSL ## Notes -JWT-CPP relies on the OpenSSL API, as a result both LibreSSL and wolfSSL need to include their respective compatability layers. +JWT-CPP relies on the OpenSSL API, as a result both LibreSSL and wolfSSL need to include their respective compatibility layers. Most system already have OpenSSL so it's important to make sure when compiling your application it only includes one. Otherwise you may have missing symbols when linking. diff --git a/example/traits/README.md b/example/traits/README.md index 42ecceb0f..c31464b54 100644 --- a/example/traits/README.md +++ b/example/traits/README.md @@ -1,6 +1,6 @@ # Traits Examples -These example require upstream CMake installation to work. There are expections: +These example require upstream CMake installation to work. There are exceptions: - For Boost.JSON headers must be located by custom CMake. - For PicoJSON headers must be located by custom CMake. diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h index a51edf93f..3074bee30 100644 --- a/include/jwt-cpp/jwt.h +++ b/include/jwt-cpp/jwt.h @@ -493,7 +493,7 @@ namespace jwt { * * \param certstr String containing the certificate encoded as pem * \param pw Password used to decrypt certificate (leave empty if not encrypted) - * \param ec error_code for error_detection (gets cleared if no error ocurred) + * \param ec error_code for error_detection (gets cleared if no error occurred) */ inline std::string extract_pubkey_from_cert(const std::string& certstr, const std::string& pw, std::error_code& ec) { @@ -547,7 +547,7 @@ namespace jwt { * \brief Convert the certificate provided as DER to PEM. * * \param cert_der_str String containing the certificate encoded as base64 DER - * \param ec error_code for error_detection (gets cleared if no error occures) + * \param ec error_code for error_detection (gets cleared if no error occurs) */ inline std::string convert_der_to_pem(const std::string& cert_der_str, std::error_code& ec) { ec.clear(); @@ -589,7 +589,7 @@ namespace jwt { * * \param cert_base64_der_str String containing the certificate encoded as base64 DER * \param decode The function to decode the cert - * \param ec error_code for error_detection (gets cleared if no error occures) + * \param ec error_code for error_detection (gets cleared if no error occurs) */ template std::string convert_base64_der_to_pem(const std::string& cert_base64_der_str, Decode decode, @@ -643,7 +643,7 @@ namespace jwt { * (here)[https://tools.ietf.org/html/rfc7517#section-4.7] * * \param cert_base64_der_str String containing the certificate encoded as base64 DER - * \param ec error_code for error_detection (gets cleared if no error occures) + * \param ec error_code for error_detection (gets cleared if no error occurs) */ inline std::string convert_base64_der_to_pem(const std::string& cert_base64_der_str, std::error_code& ec) { auto decode = [](const std::string& token) { @@ -675,7 +675,7 @@ namespace jwt { * * \param key String containing the certificate encoded as pem * \param password Password used to decrypt certificate (leave empty if not encrypted) - * \param ec error_code for error_detection (gets cleared if no error occures) + * \param ec error_code for error_detection (gets cleared if no error occurs) */ inline evp_pkey_handle load_public_key_from_string(const std::string& key, const std::string& password, std::error_code& ec) { @@ -729,7 +729,7 @@ namespace jwt { * * \param key String containing a private key as pem * \param password Password used to decrypt key (leave empty if not encrypted) - * \param ec error_code for error_detection (gets cleared if no error occures) + * \param ec error_code for error_detection (gets cleared if no error occurs) */ inline evp_pkey_handle load_private_key_from_string(const std::string& key, const std::string& password, std::error_code& ec) { @@ -770,7 +770,7 @@ namespace jwt { * * \param key String containing the certificate encoded as pem * \param password Password used to decrypt certificate (leave empty if not encrypted) - * \param ec error_code for error_detection (gets cleared if no error occures) + * \param ec error_code for error_detection (gets cleared if no error occurs) */ inline evp_pkey_handle load_public_ec_key_from_string(const std::string& key, const std::string& password, std::error_code& ec) { @@ -825,7 +825,7 @@ namespace jwt { * * \param key String containing a private key as pem * \param password Password used to decrypt key (leave empty if not encrypted) - * \param ec error_code for error_detection (gets cleared if no error occures) + * \param ec error_code for error_detection (gets cleared if no error occurs) */ inline evp_pkey_handle load_private_ec_key_from_string(const std::string& key, const std::string& password, std::error_code& ec) { @@ -1972,7 +1972,7 @@ namespace jwt { // TODO(prince-chrismc): I am not convienced this is meaningful anymore static_assert( value, - "object_type must implementate the subscription operator '[]' taking string_type as an arguement"); + "object_type must implementate the subscription operator '[]' taking string_type as an argument"); }; template @@ -2148,14 +2148,14 @@ namespace jwt { /** * Serialize claim to output stream from wrapped JSON value - * \return ouput stream + * \return output stream */ std::ostream& operator<<(std::ostream& os) { return os << val; } /** * Get type of contained JSON value * \return Type - * \throw std::logic_error An internal error occured + * \throw std::logic_error An internal error occurred */ json::type get_type() const { return json_traits::get_type(val); } @@ -2427,7 +2427,7 @@ namespace jwt { public: using basic_claim_t = basic_claim; /** - * Check if algortihm is present ("alg") + * Check if algorithm is present ("alg") * \return true if present, false otherwise */ bool has_algorithm() const noexcept { return has_header_claim("alg"); } @@ -2497,7 +2497,7 @@ namespace jwt { template class decoded_jwt : public header, public payload { protected: - /// Unmodifed token, as passed to constructor + /// Unmodified token, as passed to constructor typename json_traits::string_type token; /// Header part decoded from base64 typename json_traits::string_type header; @@ -2871,7 +2871,7 @@ namespace jwt { // The configured default leeway for this verification size_t default_leeway{0}; - // The claim key to apply this comparision on + // The claim key to apply this comparison on typename json_traits::string_type claim_key{}; // Helper method to get a claim from the jwt in this context @@ -3171,7 +3171,7 @@ namespace jwt { * Check is casesensitive. * * \param type Type Header Parameter to check for. - * \param locale Localization functionality to use when comapring + * \param locale Localization functionality to use when comparing * \return *this to allow chaining */ verifier& with_type(const typename json_traits::string_type& type, std::locale locale = std::locale{}) { @@ -3432,7 +3432,7 @@ namespace jwt { bool has_key_operations() const noexcept { return has_jwk_claim("key_ops"); } /** - * Check if algortihm is present ("alg") + * Check if algorithm is present ("alg") * \return true if present, false otherwise */ bool has_algorithm() const noexcept { return has_jwk_claim("alg"); }