aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/access.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/access.rs')
-rw-r--r--src/api/access.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/api/access.rs b/src/api/access.rs
index 339d9de..9e8a018 100644
--- a/src/api/access.rs
+++ b/src/api/access.rs
@@ -452,7 +452,8 @@ fn federated(state: &AppState, request: &Request<Body>, user: &str) -> Option<Re
}
/// Whether a request is federation work: reading the events API (`GET` and `HEAD` of
-/// `/events` and below), checking a fork (`POST /events/fork`), and keeping a session
+/// `/events` and below), checking a fork (`POST /events/fork`), asking whether a `true` is
+/// taken (`POST /events/back`), and keeping a session
/// (`GET /auth/whoami`, `POST /auth/refresh`, `POST /auth/logout`); with `puts`, putting
/// an event (`POST /events`) too. Nothing of the document (`/store`, `/stream`), the
/// node (`/peers`, `/admin/…`), nor what a node's operator does to its store
@@ -463,7 +464,7 @@ fn federation_work(method: &Method, path: &str, puts: bool) -> bool {
let posts = *method == Method::POST;
match path {
"/auth/whoami" => reads,
- "/auth/refresh" | "/auth/logout" | "/events/fork" => posts,
+ "/auth/refresh" | "/auth/logout" | "/events/fork" | "/events/back" => posts,
"/events" => reads || (puts && posts),
_ => reads && path.starts_with("/events/"),
}
@@ -493,6 +494,7 @@ mod tests {
assert!(work(Method::GET, "/events/counts", false));
assert!(work(Method::HEAD, "/events/0c7e", false));
assert!(work(Method::POST, "/events/fork", false));
+ assert!(work(Method::POST, "/events/back", false));
assert!(work(Method::POST, "/auth/refresh", false));
assert!(work(Method::GET, "/auth/whoami", false));
assert!(!work(Method::POST, "/events", false));