about summary refs log tree commit diff
path: root/kittybox-rs/indieauth/src/pkce.rs
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2022-07-15 02:14:09 +0300
committerVika <vika@fireburn.ru>2022-07-15 02:14:09 +0300
commit54d6afbe21a94c8de53852d4cd550de75473557f (patch)
tree7c202718455feda7fc34c3002d4ea56a9cbf6bd4 /kittybox-rs/indieauth/src/pkce.rs
parent36535deba96b19cf0af3fe56763f982fc6ae3fc0 (diff)
downloadkittybox-54d6afbe21a94c8de53852d4cd550de75473557f.tar.zst
WIP: IndieAuth progress
 - Some kittybox-indieauth crate bugs were fixed
 - Things should mostly work...
 - ...if you somehow supply your own backend store
 - YES I MADE IT MODULAR AGAIN
 - NO I AM NOT SORRY
 - YOU WILL THANK ME LATER
 - DO NOT DENY THE HEAVENLY GIFT OF GENERICS IN RUST
 - Retrieving profiles doesn't work for now because I am unsure how to
   implement it best
Diffstat (limited to 'kittybox-rs/indieauth/src/pkce.rs')
-rw-r--r--kittybox-rs/indieauth/src/pkce.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/kittybox-rs/indieauth/src/pkce.rs b/kittybox-rs/indieauth/src/pkce.rs
index 1d3c58f..6dabcc3 100644
--- a/kittybox-rs/indieauth/src/pkce.rs
+++ b/kittybox-rs/indieauth/src/pkce.rs
@@ -40,7 +40,7 @@ pub struct PKCEChallenge {
 }
 
 impl PKCEChallenge {
-    fn new(code_verifier: PKCEVerifier, method: PKCEMethod) -> Self {
+    pub fn new(code_verifier: PKCEVerifier, method: PKCEMethod) -> Self {
         Self {
             code_challenge: match method {
                 PKCEMethod::S256 => {
@@ -53,7 +53,9 @@ impl PKCEChallenge {
             method
         }
     }
-    fn verify(&self, code_verifier: PKCEVerifier) -> bool {
+
+    #[must_use]
+    pub fn verify(&self, code_verifier: PKCEVerifier) -> bool {
         Self::new(code_verifier, self.method) == *self
     }
 }