Rinomina: crate akode-*, cartelle akode-rs/ e akode-cli/, binario akode, ~/.akode, AKODE_* (A)
Riapplica la fase 5 di aKode (86e7c72e) sulla base ripulita:
- crate codex-* -> akode-*, codex-rs -> akode-rs, codex-cli -> akode-cli, binario e ausiliari akode;
- ~/.codex -> ~/.akode, CODEX_HOME -> AKODE_HOME, variabili CODEX_* -> AKODE_*, .codex/ -> .akode/ di progetto;
nessun fallback a ~/.codex o a CODEX_*;
- testi per l'utente "Codex" -> "aKode"; testi verso il modello e istruzioni di sistema invariati;
- snapshot insta rinominati (non ancora rigenerati).
I conflitti con la base ripulita sono stati risolti riapplicando la rinomina ai file senza le
funzioni di imeAI (script di mappa dei token per file).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
6
akode-rs/utils/rustls-provider/BUILD.bazel
Normal file
6
akode-rs/utils/rustls-provider/BUILD.bazel
Normal file
@@ -0,0 +1,6 @@
|
||||
load("//:defs.bzl", "codex_rust_crate")
|
||||
|
||||
codex_rust_crate(
|
||||
name = "rustls-provider",
|
||||
crate_name = "akode_utils_rustls_provider",
|
||||
)
|
||||
15
akode-rs/utils/rustls-provider/Cargo.toml
Normal file
15
akode-rs/utils/rustls-provider/Cargo.toml
Normal file
@@ -0,0 +1,15 @@
|
||||
[package]
|
||||
name = "akode-utils-rustls-provider"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
rustls = { workspace = true }
|
||||
|
||||
[lib]
|
||||
test = false
|
||||
doctest = false
|
||||
39
akode-rs/utils/rustls-provider/src/lib.rs
Normal file
39
akode-rs/utils/rustls-provider/src/lib.rs
Normal file
@@ -0,0 +1,39 @@
|
||||
use std::sync::Once;
|
||||
|
||||
const REQUIRED_SIGNATURE_SCHEME: rustls::SignatureScheme =
|
||||
rustls::SignatureScheme::ECDSA_NISTP521_SHA512;
|
||||
|
||||
/// Ensures a process-wide rustls crypto provider is installed.
|
||||
///
|
||||
/// rustls cannot auto-select a provider when both `ring` and `aws-lc-rs`
|
||||
/// features are enabled in the dependency graph.
|
||||
pub fn ensure_rustls_crypto_provider() {
|
||||
static RUSTLS_PROVIDER_INIT: Once = Once::new();
|
||||
RUSTLS_PROVIDER_INIT.call_once(|| {
|
||||
// aws-lc-rs supports a broader WebPKI signature set than ring, including
|
||||
// ECDSA P-521/SHA-512 certs used by some enterprise TLS proxies.
|
||||
if rustls::crypto::aws_lc_rs::default_provider()
|
||||
.install_default()
|
||||
.is_err()
|
||||
{
|
||||
// Preserve the previous best-effort behavior for embedded hosts that
|
||||
// install a process-global provider before Codex can install one.
|
||||
return;
|
||||
}
|
||||
|
||||
let Some(provider) = rustls::crypto::CryptoProvider::get_default() else {
|
||||
panic!("aws-lc-rs rustls crypto provider should be installed");
|
||||
};
|
||||
assert!(
|
||||
provider_supports_required_signature_scheme(provider),
|
||||
"installed rustls crypto provider must support {REQUIRED_SIGNATURE_SCHEME:?}"
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
fn provider_supports_required_signature_scheme(provider: &rustls::crypto::CryptoProvider) -> bool {
|
||||
provider
|
||||
.signature_verification_algorithms
|
||||
.supported_schemes()
|
||||
.contains(&REQUIRED_SIGNATURE_SCHEME)
|
||||
}
|
||||
26
akode-rs/utils/rustls-provider/tests/preinstalled.rs
Normal file
26
akode-rs/utils/rustls-provider/tests/preinstalled.rs
Normal file
@@ -0,0 +1,26 @@
|
||||
use akode_utils_rustls_provider::ensure_rustls_crypto_provider;
|
||||
|
||||
const EMPTY_ALGORITHMS: rustls::crypto::WebPkiSupportedAlgorithms =
|
||||
rustls::crypto::WebPkiSupportedAlgorithms {
|
||||
all: &[],
|
||||
mapping: &[],
|
||||
};
|
||||
|
||||
#[test]
|
||||
fn ensure_provider_preserves_preinstalled_provider() {
|
||||
let mut provider = rustls::crypto::aws_lc_rs::default_provider();
|
||||
provider.signature_verification_algorithms = EMPTY_ALGORITHMS;
|
||||
assert!(provider.install_default().is_ok());
|
||||
|
||||
ensure_rustls_crypto_provider();
|
||||
|
||||
let Some(provider) = rustls::crypto::CryptoProvider::get_default() else {
|
||||
panic!("preinstalled rustls provider should still be installed");
|
||||
};
|
||||
assert!(
|
||||
!provider
|
||||
.signature_verification_algorithms
|
||||
.supported_schemes()
|
||||
.contains(&rustls::SignatureScheme::ECDSA_NISTP521_SHA512)
|
||||
);
|
||||
}
|
||||
16
akode-rs/utils/rustls-provider/tests/provider.rs
Normal file
16
akode-rs/utils/rustls-provider/tests/provider.rs
Normal file
@@ -0,0 +1,16 @@
|
||||
use akode_utils_rustls_provider::ensure_rustls_crypto_provider;
|
||||
|
||||
#[test]
|
||||
fn ensure_provider_installs_ecdsa_p521_sha512_support() {
|
||||
ensure_rustls_crypto_provider();
|
||||
|
||||
let Some(provider) = rustls::crypto::CryptoProvider::get_default() else {
|
||||
panic!("rustls provider should be installed");
|
||||
};
|
||||
assert!(
|
||||
provider
|
||||
.signature_verification_algorithms
|
||||
.supported_schemes()
|
||||
.contains(&rustls::SignatureScheme::ECDSA_NISTP521_SHA512)
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user