Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore(tokengen): fix access to DelegationPrivateKeyFile #1283

Merged
merged 1 commit into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tools/tokengen/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use clap::{Parser, Subcommand};
use std::path::PathBuf;
use std::{error::Error, path::Path};
use std::error::Error;
use std::path::{Path, PathBuf};
use uuid::Uuid;

use tokengen::{generate_token, ApplicationProtocol, RecordingOperation, SubCommandArgs};
Expand Down
20 changes: 8 additions & 12 deletions tools/tokengen/src/server/server_impl.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
use axum::{
extract::{Extension, Json},
routing::post,
Router,
};
use axum::extract::{Extension, Json};
use axum::routing::post;
use axum::Router;
use serde::{Deserialize, Serialize};
use std::{
env,
error::Error,
path::{Path, PathBuf},
sync::Arc,
};
use std::env;
use std::error::Error;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use uuid::Uuid;

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

let delegate_private_key_file = gateway_config.get("DelegationPrivateKeyFile ").and_then(|v| v.as_str());
let delegate_private_key_file = gateway_config.get("DelegationPrivateKeyFile").and_then(|v| v.as_str());

let delegate_key_path = delegate_private_key_file.map(PathBuf::from);
let delegate_key_path = delegate_key_path.map(|p| {
Expand Down