Skip to content

Commit d4a7eb2

Browse files
committed
Merge branch 'update-cbst2-02' into signer-json-api
2 parents d993a8a + 688d82d commit d4a7eb2

2 files changed

Lines changed: 7 additions & 47 deletions

File tree

‎crates/signer/src/service.rs‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -485,19 +485,19 @@ async fn handle_reload(
485485
let mut jwt_configs = state.jwts.write();
486486
let mut new_configs = HashMap::new();
487487
for (module_id, jwt_secret) in jwt_secrets {
488-
let signing_id = jwt_configs.get(&module_id).map(|cfg| cfg.signing_id);
489-
if signing_id.is_none() {
488+
if let Some(signing_id) = jwt_configs.get(&module_id).map(|cfg| cfg.signing_id) {
489+
new_configs.insert(module_id.clone(), ModuleSigningConfig {
490+
module_name: module_id,
491+
jwt_secret,
492+
signing_id,
493+
});
494+
} else {
490495
let error_message = format!(
491496
"Module {module_id} signing ID not found in commit-boost config, cannot reload"
492497
);
493498
error!(event = "reload", ?req_id, module_id = %module_id, error = %error_message);
494499
return Err(SignerModuleError::RequestError(error_message));
495500
}
496-
new_configs.insert(module_id.clone(), ModuleSigningConfig {
497-
module_name: module_id,
498-
jwt_secret,
499-
signing_id: signing_id.unwrap(),
500-
});
501501
}
502502
*jwt_configs = new_configs;
503503
}

‎tests/tests/signer_jwt_auth.rs‎

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -178,43 +178,3 @@ async fn test_signer_only_admin_can_revoke() -> Result<()> {
178178

179179
Ok(())
180180
}
181-
182-
// Starts the signer moduler server on a separate task and returns its
183-
// configuration
184-
/*
185-
async fn start_server(port: u16) -> Result<StartSignerConfig> {
186-
setup_test_env();
187-
let chain = Chain::Hoodi;
188-
189-
// Mock JWT secrets
190-
let module_id = ModuleId(JWT_MODULE.to_string());
191-
let mut jwts = HashMap::new();
192-
jwts.insert(module_id.clone(), JWT_SECRET.to_string());
193-
194-
// Create a signer config
195-
let loader = SignerLoader::ValidatorsDir {
196-
keys_path: "data/keystores/keys".into(),
197-
secrets_path: "data/keystores/secrets".into(),
198-
format: ValidatorKeysFormat::Lighthouse,
199-
};
200-
let mut config = get_signer_config(loader);
201-
config.port = port;
202-
config.jwt_auth_fail_limit = 3; // Set a low fail limit for testing
203-
config.jwt_auth_fail_timeout_seconds = 3; // Set a short timeout for testing
204-
let start_config = get_start_signer_config(config, chain, jwts, ADMIN_SECRET.to_string());
205-
206-
// Run the Signer
207-
let server_handle = tokio::spawn(SigningService::run(start_config.clone()));
208-
209-
// Make sure the server is running
210-
tokio::time::sleep(Duration::from_millis(100)).await;
211-
if server_handle.is_finished() {
212-
return Err(eyre::eyre!(
213-
"Signer service failed to start: {}",
214-
server_handle.await.unwrap_err()
215-
));
216-
}
217-
Ok(start_config)
218-
}
219-
220-
*/

0 commit comments

Comments
 (0)