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.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/api/access.rs b/src/api/access.rs
index ddcaad0..9157e1d 100644
--- a/src/api/access.rs
+++ b/src/api/access.rs
@@ -274,7 +274,7 @@ fn needed(method: &Method, path: &str, node: &str) -> Need {
let under = |prefix: &str| path == prefix || path.starts_with(&format!("{prefix}/"));
// What this node holds alone: `_continuum/local/<node>/<name>`, never stored.
let local = |right, name: &str| protocol(right, &[meta::LOCAL, node, name]);
- if under("/store") || under("/stream") {
+ if under("/store") || under("/stream") || under("/events") {
Need::Store
} else if (under("/auth/keys") && !looking) || path == "/auth/logout" {
Need::Credentials
@@ -482,6 +482,12 @@ mod tests {
assert_eq!(needed(&Method::GET, "/auth/whoami", "n1"), Need::Auth);
assert_eq!(needed(&Method::PUT, "/store/a/b", "n1"), Need::Store);
assert_eq!(needed(&Method::GET, "/stream/a", "n1"), Need::Store);
+ assert_eq!(needed(&Method::POST, "/events", "n1"), Need::Store);
+ assert_eq!(needed(&Method::GET, "/events/counts", "n1"), Need::Store);
+ assert_eq!(
+ needed(&Method::POST, "/admin/events/drop", "n1"),
+ write(&[])
+ );
assert_eq!(needed(&Method::GET, "/storehouse", "n1"), read(&[]));
assert_eq!(needed(&Method::GET, "/peers", "n1"), Need::Observe);
assert_eq!(needed(&Method::GET, "/admin/stats", "n1"), Need::Observe);