Skip to content

Commit

Permalink
Corrected a few typos (Thalhammer#297)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Mc <[email protected]>
  • Loading branch information
criadoperez and prince-chrismc authored Jul 25, 2023
1 parent ad08c68 commit 6fed66d
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cross-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
run: choco install openssl

- if: matrix.os == 'macos-latest'
run: cp /usr/local/opt/[email protected]/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/
run: sudo cp /usr/local/opt/[email protected]/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/

- uses: actions/checkout@v3
- run: cmake -E make_directory ${{ github.workspace }}/build
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jwt::basic_claim<my_favorite_json_library_traits> 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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmake/jwt-cpp-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions docs/faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/ssl.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion example/traits/README.md
Original file line number Diff line number Diff line change
@@ -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.
32 changes: 16 additions & 16 deletions include/jwt-cpp/jwt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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<typename Decode>
std::string convert_base64_der_to_pem(const std::string& cert_base64_der_str, Decode decode,
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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<typename object_type, typename value_type, typename string_type>
Expand Down Expand Up @@ -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); }

Expand Down Expand Up @@ -2427,7 +2427,7 @@ namespace jwt {
public:
using basic_claim_t = basic_claim<json_traits>;
/**
* 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"); }
Expand Down Expand Up @@ -2497,7 +2497,7 @@ namespace jwt {
template<typename json_traits>
class decoded_jwt : public header<json_traits>, public payload<json_traits> {
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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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{}) {
Expand Down Expand Up @@ -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"); }
Expand Down

0 comments on commit 6fed66d

Please sign in to comment.