Skip to content

Commit 61012b4

Browse files
authoredMar 25, 2025
chore(tokengen): fix access to DelegationPrivateKeyFile (#1283)
1 parent 1925990 commit 61012b4

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed
 

‎tools/tokengen/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use clap::{Parser, Subcommand};
2-
use std::path::PathBuf;
3-
use std::{error::Error, path::Path};
2+
use std::error::Error;
3+
use std::path::{Path, PathBuf};
44
use uuid::Uuid;
55

66
use tokengen::{generate_token, ApplicationProtocol, RecordingOperation, SubCommandArgs};

‎tools/tokengen/src/server/server_impl.rs

+8-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
use axum::{
2-
extract::{Extension, Json},
3-
routing::post,
4-
Router,
5-
};
1+
use axum::extract::{Extension, Json};
2+
use axum::routing::post;
3+
use axum::Router;
64
use serde::{Deserialize, Serialize};
7-
use std::{
8-
env,
9-
error::Error,
10-
path::{Path, PathBuf},
11-
sync::Arc,
12-
};
5+
use std::env;
6+
use std::error::Error;
7+
use std::path::{Path, PathBuf};
8+
use std::sync::Arc;
139
use uuid::Uuid;
1410

1511
use crate::{generate_token, ApplicationProtocol, RecordingOperation, SubCommandArgs};
@@ -37,7 +33,7 @@ pub(crate) async fn get_delegate_key_path() -> Result<Option<PathBuf>, Box<dyn E
3733
let gateway_json_contents = tokio::fs::read_to_string(&gateway_json_path).await?;
3834
let gateway_config: serde_json::Value = serde_json::from_str(&gateway_json_contents)?;
3935

40-
let delegate_private_key_file = gateway_config.get("DelegationPrivateKeyFile ").and_then(|v| v.as_str());
36+
let delegate_private_key_file = gateway_config.get("DelegationPrivateKeyFile").and_then(|v| v.as_str());
4137

4238
let delegate_key_path = delegate_private_key_file.map(PathBuf::from);
4339
let delegate_key_path = delegate_key_path.map(|p| {

0 commit comments

Comments
 (0)