about summary refs log tree commit diff
path: root/kittybox-rs/src/micropub
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2022-07-10 14:49:55 +0300
committerVika <vika@fireburn.ru>2022-07-10 14:49:55 +0300
commit25183f2ed7802375f15cb0069af7bee6dd2c7afd (patch)
treeff6e67de32864839b58cfcb1be31bfbd52d89e28 /kittybox-rs/src/micropub
parent1031d495d5b78d9b19dcdc414b6d7b0daf313bb2 (diff)
downloadkittybox-25183f2ed7802375f15cb0069af7bee6dd2c7afd.tar.zst
indieauth: rename to tokenauth
This frees up the name for the future in-house IndieAuth
implementation and also clarifies the purpose of this module.

Its future is uncertain - most probably when the token endpoint gets
finished, it will transform into a way to query that token
endpoint. But then, the media endpoint also depends on it, so I might
have to copy that implementation (that queries an external token
endpoint) and make it generic enough so I could both query an external
endpoint or use internal data.
Diffstat (limited to 'kittybox-rs/src/micropub')
-rw-r--r--kittybox-rs/src/micropub/mod.rs14
-rw-r--r--kittybox-rs/src/micropub/util.rs2
2 files changed, 8 insertions, 8 deletions
diff --git a/kittybox-rs/src/micropub/mod.rs b/kittybox-rs/src/micropub/mod.rs
index 8550849..1fa442a 100644
--- a/kittybox-rs/src/micropub/mod.rs
+++ b/kittybox-rs/src/micropub/mod.rs
@@ -1,5 +1,5 @@
 use crate::database::{MicropubChannel, Storage, StorageError};
-use crate::indieauth::User;
+use crate::tokenauth::User;
 use crate::micropub::util::form_to_mf2_json;
 use axum::extract::{BodyStream, Query};
 use axum::headers::ContentType;
@@ -293,7 +293,7 @@ async fn background_processing<D: 'static + Storage>(
 
 // TODO actually save the post to the database and schedule post-processing
 pub(crate) async fn _post<D: 'static + Storage>(
-    user: crate::indieauth::User,
+    user: User,
     uid: String,
     mf2: serde_json::Value,
     db: D,
@@ -681,7 +681,7 @@ impl MicropubQuery {
 
 #[cfg(test)]
 mod tests {
-    use crate::{database::Storage, micropub::MicropubError};
+    use crate::{database::Storage, micropub::MicropubError, tokenauth::User};
     use hyper::body::HttpBody;
     use serde_json::json;
 
@@ -734,7 +734,7 @@ mod tests {
                 "content": ["Hello world!"]
             }
         });
-        let user = crate::indieauth::User::new(
+        let user = User::new(
             "https://localhost:8080/",
             "https://kittybox.fireburn.ru/",
             "profile",
@@ -763,7 +763,7 @@ mod tests {
                 "url": ["https://fireburn.ru/posts/hello"]
             }
         });
-        let user = crate::indieauth::User::new(
+        let user = User::new(
             "https://aaronparecki.com/",
             "https://kittybox.fireburn.ru/",
             "create update media",
@@ -790,7 +790,7 @@ mod tests {
                 "content": ["Hello world!"]
             }
         });
-        let user = crate::indieauth::User::new(
+        let user = User::new(
             "https://localhost:8080/",
             "https://kittybox.fireburn.ru/",
             "create",
@@ -817,7 +817,7 @@ mod tests {
             axum::extract::Query(super::MicropubQuery::source(
                 "https://aaronparecki.com/feeds/main",
             )),
-            crate::indieauth::User::new(
+            User::new(
                 "https://fireburn.ru/",
                 "https://quill.p3k.io/",
                 "create update media",
diff --git a/kittybox-rs/src/micropub/util.rs b/kittybox-rs/src/micropub/util.rs
index 97ec09a..7c6a0b1 100644
--- a/kittybox-rs/src/micropub/util.rs
+++ b/kittybox-rs/src/micropub/util.rs
@@ -1,5 +1,5 @@
 use crate::database::Storage;
-use crate::indieauth::User;
+use crate::tokenauth::User;
 use chrono::prelude::*;
 use core::iter::Iterator;
 use newbase60::num_to_sxg;