address review

This commit is contained in:
Artturin 2022-11-15 18:36:06 +02:00 committed by Cole Helbling
parent 6ebf32f30a
commit 14015d0d0d

View file

@ -118,7 +118,7 @@ impl Config {
// tls configured hyper client // tls configured hyper client
Credentials::Token(self.github.clone().unwrap().token), Credentials::Token(self.github.clone().unwrap().token),
) )
.unwrap() .expect("Unable to create a github client instance")
} }
pub fn github_app_vendingmachine(&self) -> GithubAppVendingMachine { pub fn github_app_vendingmachine(&self) -> GithubAppVendingMachine {
@ -183,9 +183,8 @@ impl GithubAppVendingMachine {
} }
fn jwt(&self) -> JWTCredentials { fn jwt(&self) -> JWTCredentials {
// JWTCredentials::new(self.conf.app_id, self.conf.private_key.clone()) let key = std::fs::read(self.conf.private_key.clone()).expect("Unable to read private_key");
// FIXME: upstream wants raw bytes of private key JWTCredentials::new(self.conf.app_id, key).expect("Unable to create JWTCredentials")
JWTCredentials::new(self.conf.app_id, vec![0x00]).unwrap()
} }
fn install_id_for_repo(&mut self, owner: &str, repo: &str) -> Option<u64> { fn install_id_for_repo(&mut self, owner: &str, repo: &str) -> Option<u64> {
@ -222,7 +221,7 @@ impl GithubAppVendingMachine {
useragent, useragent,
Credentials::InstallationToken(InstallationTokenGenerator::new(install_id, jwt)), Credentials::InstallationToken(InstallationTokenGenerator::new(install_id, jwt)),
) )
.unwrap() .expect("Unable to create a github client instance")
})) }))
} }
} }