Skip to content

Commit 147d241

Browse files
authored
Improve some doc inconsistencies (#258)
1 parent 0966ec0 commit 147d241

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/decoding.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ pub(crate) enum DecodingKeyKind {
3838
RsaModulusExponent { n: Vec<u8>, e: Vec<u8> },
3939
}
4040

41-
/// All the different kind of keys we can use to decode a JWT
42-
/// This key can be re-used so make sure you only initialize it once if you can for better performance
41+
/// All the different kind of keys we can use to decode a JWT.
42+
/// This key can be re-used so make sure you only initialize it once if you can for better performance.
4343
#[derive(Clone)]
4444
pub struct DecodingKey {
4545
pub(crate) family: AlgorithmFamily,

src/encoding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::pem::decoder::PemEncodedKey;
1010
use crate::serialization::b64_encode_part;
1111

1212
/// A key to encode a JWT with. Can be a secret, a PEM-encoded key or a DER-encoded key.
13-
/// This key can be re-used so make sure you only initialize it once if you can for better performance
13+
/// This key can be re-used so make sure you only initialize it once if you can for better performance.
1414
#[derive(Clone)]
1515
pub struct EncodingKey {
1616
pub(crate) family: AlgorithmFamily,

src/validation.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ impl Validation {
122122
self.required_spec_claims = items.iter().map(|x| x.to_string()).collect();
123123
}
124124

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

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

0 commit comments

Comments
 (0)