Skip to content

Commit

Permalink
Use a caracter that is not actually present in PEM
Browse files Browse the repository at this point in the history
  • Loading branch information
elegaanz committed Jul 23, 2024
1 parent 4b2ffb9 commit efd08b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub async fn hook_server() {
.into_bytes(),
private_key: std::env::var("GITHUB_PRIVATE_KEY")
.expect("GITHUB_PRIVATE_KEY is not set.")
.replace(' ', "\n"),
.replace('&', "\n"),
app_id: std::env::var("GITHUB_APP_IDENTIFIER").expect("GITHUB_APP_IDENTIFIER is not set."),
git_dir: std::env::var("PACKAGES_DIR").expect("PACKAGES_DIR is not set."),
};
Expand Down
3 changes: 1 addition & 2 deletions src/github/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use jwt_simple::{
};
use reqwest::{RequestBuilder, StatusCode};
use serde::Deserialize;
use tracing::{debug, info, warn};
use tracing::{debug, warn};

use self::{
check::{CheckRun, CheckRunId, CheckRunOutput},
Expand Down Expand Up @@ -156,7 +156,6 @@ impl FromRequestParts<AppState> for GitHub {
) -> Result<Self, Self::Rejection> {
let Ok(private_key) = RS256KeyPair::from_pem(&state.private_key) else {
warn!("The private key in the .env file cannot be parsed as PEM.");
info!("The private key was:\n{}", &state.private_key);
return Err(StatusCode::INTERNAL_SERVER_ERROR);
};

Expand Down

0 comments on commit efd08b7

Please sign in to comment.