mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-10 23:12:54 +00:00
Do not leak decoding_key in JwtAuth's Debug representation
This commit is contained in:
committed by
Kirill Bulatov
parent
7c1c7702d2
commit
d7af965982
@@ -85,7 +85,6 @@ pub fn check_permission(claims: &Claims, tenantid: Option<ZTenantId>) -> Result<
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct JwtAuth {
|
||||
decoding_key: DecodingKey<'static>,
|
||||
validation: Validation,
|
||||
@@ -113,6 +112,14 @@ impl JwtAuth {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for JwtAuth {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("JwtAuth")
|
||||
.field("validation", &self.validation)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
// this function is used only for testing purposes in CLI e g generate tokens during init
|
||||
pub fn encode_from_key_file(claims: &Claims, key_data: &[u8]) -> Result<String> {
|
||||
let key = EncodingKey::from_rsa_pem(key_data)?;
|
||||
|
||||
Reference in New Issue
Block a user