mirror of
https://github.com/tlsnotary/tlsn.git
synced 2026-01-09 21:38:00 -05:00
style: change the name to NotarySigningKeyProperties (#410)
This commit is contained in:
@@ -11,7 +11,7 @@ tls:
|
||||
private-key-pem-path: "./fixture/tls/notary.key"
|
||||
certificate-pem-path: "./fixture/tls/notary.crt"
|
||||
|
||||
notary-signature:
|
||||
notary-key:
|
||||
private-key-pem-path: "./fixture/notary/notary.key"
|
||||
public-key-pem-path: "./fixture/notary/notary.pub"
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ pub struct NotaryServerProperties {
|
||||
/// Setting for TLS connection between prover and notary
|
||||
pub tls: TLSProperties,
|
||||
/// File path of private key (in PEM format) used to sign the notarization
|
||||
pub notary_signature: NotarySignatureProperties,
|
||||
pub notary_key: NotarySigningKeyProperties,
|
||||
/// Setting for logging/tracing
|
||||
pub tracing: TracingProperties,
|
||||
/// Setting for authorization
|
||||
@@ -53,7 +53,7 @@ pub struct TLSProperties {
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub struct NotarySignatureProperties {
|
||||
pub struct NotarySigningKeyProperties {
|
||||
pub private_key_pem_path: String,
|
||||
pub public_key_pem_path: String,
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ mod util;
|
||||
|
||||
pub use config::{
|
||||
AuthorizationProperties, NotarizationProperties, NotaryServerProperties,
|
||||
NotarySignatureProperties, ServerProperties, TLSProperties, TracingProperties,
|
||||
NotarySigningKeyProperties, ServerProperties, TLSProperties, TracingProperties,
|
||||
};
|
||||
pub use domain::{
|
||||
cli::CliFields,
|
||||
|
||||
@@ -28,7 +28,7 @@ use tower::MakeService;
|
||||
use tracing::{debug, error, info};
|
||||
|
||||
use crate::{
|
||||
config::{NotaryServerProperties, NotarySignatureProperties},
|
||||
config::{NotaryServerProperties, NotarySigningKeyProperties},
|
||||
domain::{
|
||||
auth::{authorization_whitelist_vec_into_hashmap, AuthorizationWhitelistRecord},
|
||||
notary::NotaryGlobals,
|
||||
@@ -44,7 +44,7 @@ use crate::{
|
||||
#[tracing::instrument(skip(config))]
|
||||
pub async fn run_server(config: &NotaryServerProperties) -> Result<(), NotaryServerError> {
|
||||
// Load the private key for notarized transcript signing
|
||||
let notary_signing_key = load_notary_signing_key(&config.notary_signature).await?;
|
||||
let notary_signing_key = load_notary_signing_key(&config.notary_key).await?;
|
||||
// Build TLS acceptor if it is turned on
|
||||
let tls_acceptor = if !config.tls.enabled {
|
||||
debug!("Skipping TLS setup as it is turned off.");
|
||||
@@ -105,7 +105,7 @@ pub async fn run_server(config: &NotaryServerProperties) -> Result<(), NotarySer
|
||||
);
|
||||
|
||||
// Parameters needed for the info endpoint
|
||||
let public_key = std::fs::read_to_string(&config.notary_signature.public_key_pem_path)
|
||||
let public_key = std::fs::read_to_string(&config.notary_key.public_key_pem_path)
|
||||
.map_err(|err| eyre!("Failed to load notary public signing key for notarization: {err}"))?;
|
||||
let version = env!("CARGO_PKG_VERSION").to_string();
|
||||
let git_commit_hash = env!("GIT_COMMIT_HASH").to_string();
|
||||
@@ -207,7 +207,7 @@ pub async fn run_server(config: &NotaryServerProperties) -> Result<(), NotarySer
|
||||
}
|
||||
|
||||
/// Temporary function to load notary signing key from static file
|
||||
async fn load_notary_signing_key(config: &NotarySignatureProperties) -> Result<SigningKey> {
|
||||
async fn load_notary_signing_key(config: &NotarySigningKeyProperties) -> Result<SigningKey> {
|
||||
debug!("Loading notary server's signing key");
|
||||
|
||||
let notary_signing_key = SigningKey::read_pkcs8_pem_file(&config.private_key_pem_path)
|
||||
@@ -263,7 +263,7 @@ mod test {
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_load_notary_signing_key() {
|
||||
let config = NotarySignatureProperties {
|
||||
let config = NotarySigningKeyProperties {
|
||||
private_key_pem_path: "./fixture/notary/notary.key".to_string(),
|
||||
public_key_pem_path: "./fixture/notary/notary.pub".to_string(),
|
||||
};
|
||||
|
||||
@@ -29,7 +29,7 @@ use ws_stream_tungstenite::WsStream;
|
||||
use notary_server::{
|
||||
read_pem_file, run_server, AuthorizationProperties, NotarizationProperties,
|
||||
NotarizationSessionRequest, NotarizationSessionResponse, NotaryServerProperties,
|
||||
NotarySignatureProperties, ServerProperties, TLSProperties, TracingProperties,
|
||||
NotarySigningKeyProperties, ServerProperties, TLSProperties, TracingProperties,
|
||||
};
|
||||
|
||||
const NOTARY_CA_CERT_PATH: &str = "./fixture/tls/rootCA.crt";
|
||||
@@ -50,7 +50,7 @@ fn get_server_config(port: u16, tls_enabled: bool) -> NotaryServerProperties {
|
||||
private_key_pem_path: "./fixture/tls/notary.key".to_string(),
|
||||
certificate_pem_path: "./fixture/tls/notary.crt".to_string(),
|
||||
},
|
||||
notary_signature: NotarySignatureProperties {
|
||||
notary_key: NotarySigningKeyProperties {
|
||||
private_key_pem_path: "./fixture/notary/notary.key".to_string(),
|
||||
public_key_pem_path: "./fixture/notary/notary.pub".to_string(),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user