1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Helpers for deciding whether an incoming `/metrics` request should see
//! operator-level metrics.
//!
//! The server's global auth layer is lenient: if no `Authorization` header is
//! supplied, it inserts an anonymous [`Session`] and forwards the request.
//! That means the `/metrics` handler can look at the session and decide the
//! appropriate view without needing to re-run auth logic.
//!
//! # Why only `is_root`?
//!
//! The richer metrics view is an operator capability. Tying it to `Level::Root`
//! keeps the surface small and matches existing operator workflows (the same
//! credentials used to run `surreal sql --user root` etc.). Namespace and
//! database users are explicitly excluded because they represent tenants in a
//! multi-tenant deployment.
use Infallible;
use FromRequestParts;
use Parts;
use Session;
/// Marker extractor that is `true` when the request carries a root-level
/// authenticated session.
;