Skip to content

Commit

Permalink
Improve some doc inconsistencies (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrGunflame committed Feb 8, 2023
1 parent 0966ec0 commit 147d241
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/decoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ pub(crate) enum DecodingKeyKind {
RsaModulusExponent { n: Vec<u8>, e: Vec<u8> },
}

/// All the different kind of keys we can use to decode a JWT
/// This key can be re-used so make sure you only initialize it once if you can for better performance
/// All the different kind of keys we can use to decode a JWT.
/// This key can be re-used so make sure you only initialize it once if you can for better performance.
#[derive(Clone)]
pub struct DecodingKey {
pub(crate) family: AlgorithmFamily,
Expand Down
2 changes: 1 addition & 1 deletion src/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::pem::decoder::PemEncodedKey;
use crate::serialization::b64_encode_part;

/// A key to encode a JWT with. Can be a secret, a PEM-encoded key or a DER-encoded key.
/// This key can be re-used so make sure you only initialize it once if you can for better performance
/// This key can be re-used so make sure you only initialize it once if you can for better performance.
#[derive(Clone)]
pub struct EncodingKey {
pub(crate) family: AlgorithmFamily,
Expand Down
8 changes: 4 additions & 4 deletions src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ impl Validation {
self.required_spec_claims = items.iter().map(|x| x.to_string()).collect();
}

/// Whether to validate the JWT cryptographic signature
/// Very insecure to turn that off, only do it if you know what you're doing.
/// With this flag turned off, you should not trust any of the values of the claims.
/// Whether to validate the JWT cryptographic signature.
/// Disabling validation is dangerous, only do it if you know what you're doing.
/// With validation disabled you should not trust any of the values of the claims.
pub fn insecure_disable_signature_validation(&mut self) {
self.validate_signature = false;
}
Expand All @@ -136,7 +136,7 @@ impl Default for Validation {
}
}

/// Gets the current timestamp in the format JWT expect
/// Gets the current timestamp in the format expected by JWTs.
pub fn get_current_timestamp() -> u64 {
let start = SystemTime::now();
start.duration_since(UNIX_EPOCH).expect("Time went backwards").as_secs()
Expand Down

0 comments on commit 147d241

Please sign in to comment.