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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! `GET /api/profiles/{name}/filter` — one endpoint's resolved access policy.
//!
//! **`show`, never `explain`.** [`acme_proxy_policy::filter::explain::explain`] executes
//! the operator's `custom` scripts and issues real IPAM and DNS requests
//! against an address and names the *caller* chose; behind a session that is
//! script execution plus SSRF from one stolen cookie, on a listener that has no
//! admission control and filters nothing unless `[admin.filter]` says so. That refusal
//! stands, and there is no route for it here. This one builds a document from
//! [`acme_proxy_policy::filter::explain::policy_json`], which calls four accessors on a
//! [`FilterPolicy`](acme_proxy_policy::filter::FilterPolicy) and reaches nothing outside
//! the process — it is not even `async` under the handler's own `async`.
//!
//! Read-only, so this file contributes nothing to
//! `tests/admin_api.rs::mutating_endpoints()`: a policy is configuration, and
//! configuration is changed by editing the file and reloading, never through a
//! browser session.
//!
//! **The policy served here is the *live* one** — read from `state.profiles`,
//! which is what this process is enforcing right now — where `acme-proxy
//! filter show` rebuilds it from configuration on purpose, so that every
//! startup refusal reaches an operator at the terminal. `[filter]` reloads on
//! `SIGHUP` and the whole policy is swapped, so between an edit and its reload
//! the two front ends legitimately disagree, and a configuration that would be
//! *refused* is caught by the CLI while this one still serves the last good
//! policy. That is the correct answer on both sides, and comparing them is how
//! an operator finds out which state they are in.
use Json;
use ;
use Value;
use crateAdminState;
use crateAdminError;
use crateAuthenticated;
use policy_json;
/// `GET /api/profiles/{name}/filter` — the resolved access policy.
///
/// The `profile` member comes from the mounted profile rather than from the
/// path, the same habit `orders::download_chain` keeps for its filename: the
/// two are equal by construction, and the one that is not caller-supplied is
/// the one to interpolate.
pub async
/// A `404`, not the `409 profile_not_mounted` an order's missing profile
/// raises: there the resource exists and its endpoint does not, which is a
/// conflict, and here the endpoint *is* the resource being asked for.