Skip to content

Commit b4d947e

Browse files
authored
Update editions to 2024 (#185)
Signed-off-by: Max Lambrecht <[email protected]>
1 parent a823ff9 commit b4d947e

File tree

18 files changed

+68
-57
lines changed

18 files changed

+68
-57
lines changed

.github/actions/setup-env/action.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
name: 'Setup Environment'
2-
description: 'Install Protoc and Rust toolchain, and set up Rust dependencies cache'
2+
description: 'Install Protoc and Rust toolchain'
33
inputs:
44
github_token:
55
description: 'GitHub Token for authentication'
66
required: true
7+
78
runs:
89
using: 'composite'
910
steps:
1011
- name: Install Protoc
1112
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b #v3.0.0
13+
with:
14+
version: "25.3"
15+
repo-token: ${{ inputs.github_token }}
1216

1317
- name: Setup Rust stable toolchain
1418
uses: actions-rs/toolchain@4d3830945c2fde0cba21123066096384613b8558 # v1.0.6

.github/workflows/ci.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ jobs:
6262
with:
6363
shared-key: ${{ runner.os }}-cargo
6464

65-
- name: Install protoc
66-
uses: arduino/setup-protoc@v3
67-
with:
68-
version: "25.3"
69-
repo-token: ${{ secrets.GITHUB_TOKEN }}
70-
7165
- name: Build Rust project
7266
run: cargo build --all-targets --all-features
7367

@@ -78,4 +72,5 @@ jobs:
7872
run: cargo test --features integration-tests
7973

8074
- name: Clean up SPIRE
75+
if: ${{ always() }}
8176
run: .github/workflows/scripts/cleanup-spire.sh

spiffe/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name = "spiffe"
44
# - Update CHANGELOG.md.
55
# - Create a new tag
66
version = "0.6.7"
7-
edition = "2021"
7+
edition = "2024"
88
authors = ["Max Lambrecht <[email protected]>"]
99
description = "Rust client library implementation for SPIFFE"
1010
license = "Apache-2.0"

spiffe/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::path::Path;
22
use std::{env, fs};
33

4-
use anyhow::{ensure, Context as _};
4+
use anyhow::{Context as _, ensure};
55

66
fn main() -> anyhow::Result<()> {
77
println!("cargo:rerun-if-changed=src/proto");

spiffe/src/bundle/jwt/mod.rs

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ impl JwtBundle {
7676
/// let trust_domain = TrustDomain::new("example.org").unwrap();
7777
/// let jwt_bundle = JwtBundle::from_jwt_authorities(trust_domain, jwt_authorities).unwrap();
7878
///
79-
/// assert!(jwt_bundle
80-
/// .find_jwt_authority("C6vs25welZOx6WksNYfbMfiw9l96pMnD")
81-
/// .is_some());
79+
/// assert!(
80+
/// jwt_bundle
81+
/// .find_jwt_authority("C6vs25welZOx6WksNYfbMfiw9l96pMnD")
82+
/// .is_some()
83+
/// );
8284
/// ```
8385
pub fn from_jwt_authorities(
8486
trust_domain: TrustDomain,
@@ -181,9 +183,11 @@ mod jwt_bundle_test {
181183
.as_bytes();
182184
let trust_domain = TrustDomain::new("example.org").unwrap();
183185
let jwt_bundle = JwtBundle::from_jwt_authorities(trust_domain, bundle_bytes).unwrap();
184-
assert!(jwt_bundle
185-
.find_jwt_authority("C6vs25welZOx6WksNYfbMfiw9l96pMnD")
186-
.is_some());
186+
assert!(
187+
jwt_bundle
188+
.find_jwt_authority("C6vs25welZOx6WksNYfbMfiw9l96pMnD")
189+
.is_some()
190+
);
187191
}
188192

189193
#[test]
@@ -210,12 +214,16 @@ mod jwt_bundle_test {
210214

211215
let trust_domain = TrustDomain::new("example.org").unwrap();
212216
let jwt_bundle = JwtBundle::from_jwt_authorities(trust_domain, bundle_bytes).unwrap();
213-
assert!(jwt_bundle
214-
.find_jwt_authority("C6vs25welZOx6WksNYfbMfiw9l96pMnD")
215-
.is_some());
216-
assert!(jwt_bundle
217-
.find_jwt_authority("gHTCunJbefYtnZnTctd84xeRWyMrEsWD")
218-
.is_some());
217+
assert!(
218+
jwt_bundle
219+
.find_jwt_authority("C6vs25welZOx6WksNYfbMfiw9l96pMnD")
220+
.is_some()
221+
);
222+
assert!(
223+
jwt_bundle
224+
.find_jwt_authority("gHTCunJbefYtnZnTctd84xeRWyMrEsWD")
225+
.is_some()
226+
);
219227
}
220228

221229
#[test]

spiffe/src/bundle/x509/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! X.509 bundle types.
22
33
use crate::bundle::{Bundle, BundleRefSource};
4+
use crate::cert::Certificate;
45
use crate::cert::errors::CertificateError;
56
use crate::cert::parsing::{parse_der_encoded_bytes_as_x509_certificate, to_certificate_vec};
6-
use crate::cert::Certificate;
77
use crate::spiffe_id::TrustDomain;
88
use std::collections::HashMap;
99
use std::convert::TryFrom;

spiffe/src/cert/parsing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use crate::cert::errors::CertificateError;
21
use crate::cert::Certificate;
2+
use crate::cert::errors::CertificateError;
33
use x509_parser::certificate::X509Certificate;
44
use x509_parser::der_parser::oid::Oid;
55
use x509_parser::error::X509Error;
@@ -35,7 +35,7 @@ pub(crate) fn parse_der_encoded_bytes_as_x509_certificate(
3535
Incomplete(_) => X509Error::InvalidCertificate,
3636
Err::Error(e) => e,
3737
Err::Failure(e) => e,
38-
}))
38+
}));
3939
}
4040
};
4141
Ok(x509)

spiffe/src/endpoint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ mod tests {
8181
}
8282

8383
macro_rules! validate_socket_path_error_tests {
84-
($($name:ident: $value:expr,)*) => {
84+
($($name:ident: $value:expr_2021,)*) => {
8585
$(
8686
#[test]
8787
fn $name() {

spiffe/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ pub(crate) mod proto {
110110
pub mod workload_api;
111111

112112
// Core SPIFFE types and utilities re-exported for simplified access.
113+
pub use bundle::BundleSource;
113114
pub use bundle::jwt::{JwtBundle, JwtBundleError, JwtBundleSet};
114115
pub use bundle::x509::{X509Bundle, X509BundleError, X509BundleSet};
115-
pub use bundle::BundleSource;
116116
pub use spiffe_id::{SpiffeId, SpiffeIdError, TrustDomain};
117+
pub use svid::SvidSource;
117118
pub use svid::jwt::{JwtSvid, JwtSvidError};
118119
pub use svid::x509::{X509Svid, X509SvidError};
119-
pub use svid::SvidSource;
120120

121121
#[cfg(feature = "workload-api")]
122122
pub use workload_api::client::WorkloadApiClient;

spiffe/src/spiffe_id/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ mod spiffe_id_tests {
352352
use super::*;
353353

354354
macro_rules! spiffe_id_success_tests {
355-
($($name:ident: $value:expr,)*) => {
355+
($($name:ident: $value:expr_2021,)*) => {
356356
$(
357357
#[test]
358358
fn $name() {
@@ -429,7 +429,7 @@ mod spiffe_id_tests {
429429
}
430430

431431
macro_rules! spiffe_id_error_tests {
432-
($($name:ident: $value:expr,)*) => {
432+
($($name:ident: $value:expr_2021,)*) => {
433433
$(
434434
#[test]
435435
fn $name() {
@@ -577,7 +577,7 @@ mod trust_domain_tests {
577577
use std::str::FromStr;
578578

579579
macro_rules! trust_domain_success_tests {
580-
($($name:ident: $value:expr,)*) => {
580+
($($name:ident: $value:expr_2021,)*) => {
581581
$(
582582
#[test]
583583
fn $name() {
@@ -596,7 +596,7 @@ mod trust_domain_tests {
596596
}
597597

598598
macro_rules! trust_domain_error_tests {
599-
($($name:ident: $value:expr,)*) => {
599+
($($name:ident: $value:expr_2021,)*) => {
600600
$(
601601
#[test]
602602
fn $name() {

0 commit comments

Comments
 (0)