about summary refs log tree commit diff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2018-09-04T09·53+0200
committerVincent Ambo <mail@tazj.in>2018-09-04T10·45+0200
commit7c992207233e39cc6fabb915f0e76d8670a38f70 (patch)
treeb9a5987e283b65a44574a6047ef41ffa54469ef2 /src/lib.rs
parentb6eedbfe16938424ac2f677d5f81d6e1c6868849 (diff)
refactor: Pass 'String' to token_kid instead of internal type
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index f8ae81591e..5d8f0ea39b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -113,7 +113,7 @@ impl JWKS {
 
 /// Representation of an undecoded JSON Web Token. See [RFC
 /// 7519](https://tools.ietf.org/html/rfc7519).
-pub struct JWT (String);
+struct JWT (String);
 
 /// Representation of a decoded and validated JSON Web Token.
 ///
@@ -181,10 +181,10 @@ impl From<serde_json::Error> for ValidationError {
 ///
 /// This is only safe if the key set containing the currently allowed
 /// key IDs is fetched from a trusted source.
-pub fn token_kid(jwt: &JWT) -> JWTResult<Option<String>> {
+pub fn token_kid(token: &str) -> JWTResult<Option<String>> {
     // Fetch the header component of the JWT by splitting it out and
     // dismissing the rest.
-    let parts: Vec<&str> = jwt.0.splitn(2, '.').collect();
+    let parts: Vec<&str> = token.splitn(2, '.').collect();
     if parts.len() != 2 {
         return Err(ValidationError::MalformedJWT);
     }