Skip to content

Commit

Permalink
Merge pull request #3126 from jarhodes314/feat/poc-multiple-c8ys
Browse files Browse the repository at this point in the history
refactor: add support to `define_tedge_config` for (optionally) multi-value fields
  • Loading branch information
jarhodes314 authored Oct 7, 2024
2 parents 7f1f0da + 3936b7d commit 300fb77
Show file tree
Hide file tree
Showing 31 changed files with 2,112 additions and 201 deletions.
94 changes: 63 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ pem = "1.0"
pin-project = { version = "1.1.3", features = [] }
plugin_sm = { path = "crates/core/plugin_sm" }
predicates = "2.1"
pretty_assertions = "1.4.1"
prettyplease = "0.2.22"
proc-macro2 = "1"
proptest = "1.0"
quote = "1"
Expand Down
6 changes: 3 additions & 3 deletions crates/common/axum_tls/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub fn load_ssl_config(
let cert_key = cert_path.key();
let key_key = key_path.key();
let ca_key = ca_path.key();
if let Some((cert, key)) = load_certificate_and_key(cert_path, key_path)? {
if let Some((cert, key)) = load_certificate_and_key(&cert_path, &key_path)? {
let trust_store = match ca_path.or_none() {
Some(path) => path
.load_trust_store()
Expand All @@ -103,8 +103,8 @@ pub fn load_ssl_config(
type CertKeyPair = (Vec<Vec<u8>>, Vec<u8>);

fn load_certificate_and_key(
cert_path: OptionalConfig<impl PemReader>,
key_path: OptionalConfig<impl PemReader>,
cert_path: &OptionalConfig<impl PemReader>,
key_path: &OptionalConfig<impl PemReader>,
) -> anyhow::Result<Option<CertKeyPair>> {
let paths = tedge_config::all_or_nothing((cert_path.as_ref(), key_path.as_ref()))
.map_err(|e| anyhow!("{e}"))?;
Expand Down
2 changes: 1 addition & 1 deletion crates/common/tedge_config/src/tedge_config_cli/figment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl TEdgeEnv {
tracing::subscriber::NoSubscriber::default(),
|| lowercase_name.parse::<crate::WritableKey>(),
)
.map(|key| key.as_str().to_owned())
.map(|key| key.to_string())
.map_err(|err| {
let is_read_only_key = matches!(err, crate::ParseKeyError::ReadOnly(_));
if is_read_only_key && !WARNINGS.lock().unwrap().insert(lowercase_name.clone()) {
Expand Down
Loading

0 comments on commit 300fb77

Please sign in to comment.