Skip to content

Commit 0ab9469

Browse files
Update workflows for new GitHub Action Runner Images (#382)
* use ubuntu-latest + update actions/cache * performance-avoid-endl https://clang.llvm.org/extra/clang-tidy/checks/performance/avoid-endl.html * misc-const-correctness https://clang.llvm.org/extra/clang-tidy/checks/misc/const-correctness.html * misc-const-correctness https://clang.llvm.org/extra/clang-tidy/checks/misc/const-correctness.html * formatting * clang format and tidy and already installed https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#language-and-runtime * explict clang-format-14 * disable include cleaner * format * format * install lcov to get patching geninfo for gcc 13 * revert "install lcov to get patching geninfo for gcc 13"
1 parent 5a4c6eb commit 0ab9469

21 files changed

+50
-49
lines changed

.clang-tidy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Checks: '-*,
2020
readability-*,
2121
-readability-magic-numbers,
2222
-readability-braces-around-statements,
23-
-readability-uppercase-literal-suffix'
23+
-readability-uppercase-literal-suffix,
24+
-misc-include-cleaner'
2425

2526
CheckOptions:
2627
- key: readability-identifier-naming.TypedefCase

.github/actions/install/cmake/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ runs:
1212
steps:
1313
- name: Cache CMake
1414
id: cache-cmake
15-
uses: actions/cache@v3
15+
uses: actions/cache@v4
1616
with:
1717
path: cmake-${{ inputs.version }}
1818
key: ${{ runner.name }}-${{ runner.os }}-${{ runner.arch }}-${{ job.container.id }}-cmake-${{ inputs.version }}

.github/workflows/cmake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
cmake --build .
7272
7373
min-req:
74-
runs-on: ubuntu-20.04
74+
runs-on: ubuntu-latest
7575
steps:
7676
- uses: actions/checkout@v4
7777
- uses: ./.github/actions/install/cmake

.github/workflows/lint.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
linter_name: clang-format
3131

3232
cmake-format:
33-
runs-on: ubuntu-20.04
33+
runs-on: ubuntu-latest
3434
strategy:
3535
fail-fast: false
3636
matrix:
@@ -48,9 +48,8 @@ jobs:
4848
linter_name: cmake-format
4949

5050
clang-tidy:
51-
runs-on: ubuntu-20.04
51+
runs-on: ubuntu-latest
5252
steps:
53-
- run: sudo apt-get install clang-tidy
5453
- uses: lukka/get-cmake@latest
5554
- uses: actions/checkout@v4
5655
- name: configure
@@ -118,7 +117,7 @@ jobs:
118117
linter_name: render-tests
119118

120119
line-ending:
121-
runs-on: ubuntu-20.04
120+
runs-on: ubuntu-latest
122121
steps:
123122
- uses: actions/checkout@v4
124123
- run: git add --renormalize .

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ A simple example is decoding a token and printing all of its [claims](https://to
4949
#include <iostream>
5050

5151
int main() {
52-
std::string token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJpc3MiOiJhdXRoMCIsInNhbXBsZSI6InRlc3QifQ.lQm3N2bVlqt2-1L-FsOjtR6uE-L4E9zJutMWKIe1v1M";
52+
std::string const token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJpc3MiOiJhdXRoMCIsInNhbXBsZSI6InRlc3QifQ.lQm3N2bVlqt2-1L-FsOjtR6uE-L4E9zJutMWKIe1v1M";
5353
auto decoded = jwt::decode(token);
5454

5555
for(auto& e : decoded.get_payload_json())
56-
std::cout << e.first << " = " << e.second << std::endl;
56+
std::cout << e.first << " = " << e.second << '\n';
5757
}
5858
```
5959

example/es256k.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ K9EDZi0mZ7VUeeNKq476CU5X940yusahgneePQrDMF2nWFEtBCOiXQ==
2424
.set_payload_claim("sample", jwt::claim(std::string{"test"}))
2525
.sign(jwt::algorithm::es256k(es256k_pub_key, es256k_priv_key, "", ""));
2626

27-
std::cout << "token:\n" << token << std::endl;
27+
std::cout << "token:\n" << token << '\n';
2828

2929
auto verify = jwt::verify()
3030
.allow_algorithm(jwt::algorithm::es256k(es256k_pub_key, es256k_priv_key, "", ""))
@@ -35,7 +35,7 @@ K9EDZi0mZ7VUeeNKq476CU5X940yusahgneePQrDMF2nWFEtBCOiXQ==
3535
verify.verify(decoded);
3636

3737
for (auto& e : decoded.get_header_json())
38-
std::cout << e.first << " = " << e.second << std::endl;
38+
std::cout << e.first << " = " << e.second << '\n';
3939
for (auto& e : decoded.get_payload_json())
40-
std::cout << e.first << " = " << e.second << std::endl;
40+
std::cout << e.first << " = " << e.second << '\n';
4141
}

example/jwks-verify.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ ARS9Ln8Wh5RsFuw/Y7Grg8FsoAVzV/Pns4cwjZG75ezXfk4UVpr4oO4B5jzazzCR
111111
auto x5c = jwk.get_x5c_key_value();
112112

113113
if (!x5c.empty() && !issuer.empty()) {
114-
std::cout << "Verifying with 'x5c' key" << std::endl;
114+
std::cout << "Verifying with 'x5c' key" << '\n';
115115
auto verifier =
116116
jwt::verify()
117117
.allow_algorithm(jwt::algorithm::rs256(jwt::helper::convert_base64_der_to_pem(x5c), "", "", ""))
@@ -123,7 +123,7 @@ ARS9Ln8Wh5RsFuw/Y7Grg8FsoAVzV/Pns4cwjZG75ezXfk4UVpr4oO4B5jzazzCR
123123
}
124124
// else if the optional 'x5c' was not present
125125
{
126-
std::cout << "Verifying with RSA components" << std::endl;
126+
std::cout << "Verifying with RSA components" << '\n';
127127
const auto modulus = jwk.get_jwk_claim("n").as_string();
128128
const auto exponent = jwk.get_jwk_claim("e").as_string();
129129
auto verifier = jwt::verify()

example/partial-claim-verifier.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <iostream>
55

66
int main() {
7-
std::string rsa_priv_key = R"(-----BEGIN PRIVATE KEY-----
7+
std::string const rsa_priv_key = R"(-----BEGIN PRIVATE KEY-----
88
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4ZtdaIrd1BPIJ
99
tfnF0TjIK5inQAXZ3XlCrUlJdP+XHwIRxdv1FsN12XyMYO/6ymLmo9ryoQeIrsXB
1010
XYqlET3zfAY+diwCb0HEsVvhisthwMU4gZQu6TYW2s9LnXZB5rVtcBK69hcSlA2k
@@ -44,9 +44,9 @@ rK0/Ikt5ybqUzKCMJZg2VKGTxg==
4444
.set_payload_claim("resource-access", role_claim)
4545
.sign(jwt::algorithm::rs256("", rsa_priv_key, "", ""));
4646

47-
std::cout << "token: " << token << std::endl;
47+
std::cout << "token: " << token << '\n';
4848

49-
std::string rsa_pub_key = R"(-----BEGIN PUBLIC KEY-----
49+
std::string const rsa_pub_key = R"(-----BEGIN PUBLIC KEY-----
5050
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuGbXWiK3dQTyCbX5xdE4
5151
yCuYp0AF2d15Qq1JSXT/lx8CEcXb9RbDddl8jGDv+spi5qPa8qEHiK7FwV2KpRE9
5252
83wGPnYsAm9BxLFb4YrLYcDFOIGULuk2FtrPS512Qea1bXASuvYXEpQNpGbnTGVs
@@ -59,9 +59,9 @@ YwIDAQAB
5959
auto decoded = jwt::decode(token);
6060

6161
for (const auto& e : decoded.get_payload_json())
62-
std::cout << e.first << " = " << e.second << std::endl;
62+
std::cout << e.first << " = " << e.second << '\n';
6363

64-
std::cout << std::endl;
64+
std::cout << '\n';
6565

6666
auto role_verifier = [](const jwt::verify_context& ctx, std::error_code& ec) {
6767
using error = jwt::error::token_verification_error;
@@ -88,8 +88,8 @@ YwIDAQAB
8888

8989
try {
9090
verifier.verify(decoded);
91-
std::cout << "Success!" << std::endl;
92-
} catch (const std::exception& ex) { std::cout << "Error: " << ex.what() << std::endl; }
91+
std::cout << "Success!" << '\n';
92+
} catch (const std::exception& ex) { std::cout << "Error: " << ex.what() << '\n'; }
9393

9494
return 0;
9595
}

example/print-claims.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
#include <jwt-cpp/jwt.h>
44

55
int main() {
6-
std::string token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJpc3MiOiJhdXRoMCIsInNhbXBsZSI6InRlc3QifQ.lQm3N2bVlqt2-"
7-
"1L-FsOjtR6uE-L4E9zJutMWKIe1v1M";
6+
const std::string token =
7+
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJpc3MiOiJhdXRoMCIsInNhbXBsZSI6InRlc3QifQ.lQm3N2bVlqt2-"
8+
"1L-FsOjtR6uE-L4E9zJutMWKIe1v1M";
89
auto decoded = jwt::decode(token);
910

1011
for (auto& e : decoded.get_payload_json())
11-
std::cout << e.first << " = " << e.second << std::endl;
12+
std::cout << e.first << " = " << e.second << '\n';
1213
}

example/private-claims.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ int main() {
3434
const auto decoded = jwt::decode(token);
3535

3636
const auto api_array = decoded.get_payload_claim("object").to_json().get("api").get("array");
37-
std::cout << "api array = " << api_array << std::endl;
37+
std::cout << "api array = " << api_array << '\n';
3838

3939
/* [verify exact claim] */
4040
jwt::verify()

0 commit comments

Comments
 (0)