From b63c4e664d0367157ba51ad66d03063aedadb6bb Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sun, 5 Apr 2026 12:18:39 -0400 Subject: [PATCH] test(twin-github): reuse checked-in RSA public key --- test/twin/github/src/state.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/twin/github/src/state.rs b/test/twin/github/src/state.rs index bcd5f98a6..53d2d148a 100644 --- a/test/twin/github/src/state.rs +++ b/test/twin/github/src/state.rs @@ -1,6 +1,9 @@ use serde::{Deserialize, Serialize}; use std::collections::HashMap; +const TEST_RSA_PRIVATE_PEM: &str = include_str!("testdata/rsa_private.pem"); +const TEST_RSA_PUBLIC_PEM: &str = include_str!("testdata/rsa_public.pem"); + /// Configuration for a registered GitHub App (user-facing input). #[derive(Debug, Clone)] pub struct AppOptions { @@ -249,6 +252,10 @@ pub fn derive_public_key_pem(private_key_pem: &str) -> String { use std::io::Write; use std::process::{Command, Stdio}; + if private_key_pem == TEST_RSA_PRIVATE_PEM { + return TEST_RSA_PUBLIC_PEM.to_string(); + } + let mut child = Command::new("openssl") .args(["rsa", "-pubout"]) .stdin(Stdio::piped())