mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-15 23:32:46 +00:00
test(twin-github): reuse checked-in RSA public key
This commit is contained in:
parent
e282143b19
commit
b63c4e664d
1 changed files with 7 additions and 0 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue