Commit d7b7959
restricted_paths: add shadow path dispatch tests
Summary:
## This stack
This stack moves restricted paths toward AclManifest-backed restriction lookup and Shadow-mode comparison logging while keeping existing `RestrictedPaths` public APIs and config-backed enforcement behavior stable. The end state is that path and manifest access checks can evaluate both the legacy config/manifest-id-store source and the new AclManifest source, log source-prefixed comparison results to Scuba, and still return config-authoritative authorization results while Shadow mode is being validated.
Before this stack, restricted path logging was effectively single-source: path access read `path_acls` from config, manifest access read restricted paths from the manifest-id store, and Scuba rows only described the aggregate config-backed result. That made it hard to prove whether AclManifest-derived restrictions matched production behavior before flipping traffic to them.
After this stack, lookup and logging are split into source-specific primitives: config and AclManifest restriction lookup live behind explicit source selectors, authorization result construction is shared, and Shadow mode dispatch runs both sources side by side for supported path and HgAugmented manifest accesses. Scuba rows now include aggregate config-authoritative fields plus `config_*`, `acl_manifest_*`, `acl_manifest_mode`, errors, and `considered_restricted_by`, so we can compare behavior without changing enforcement.
```text
Before:
path access -> config path_acls -> aggregate auth/log row
manifest access -> manifest-id store + config -> aggregate auth/log row
After:
path access
-> config path_acls -> authoritative result
-> AclManifest at changeset -> shadow comparison fields
-> Scuba: aggregate + config_* + acl_manifest_* + considered_restricted_by
HgAugmented manifest access
-> config manifest-id store -> authoritative result
-> manifest acl_manifest pointer -> shadow comparison fields
-> Scuba: aggregate + config_* + acl_manifest_* + considered_restricted_by
```
This makes the codebase better by separating lookup, authorization, and logging responsibilities; making source choice explicit in tests and implementation; and giving us production observability for AclManifest parity before changing enforcement. Follow-up work can use the Shadow data to fix mismatches, expand support beyond HgAugmented manifest logging, move repos toward `Both`/`Authoritative` modes, and eventually remove legacy manifest-type handling and config-only fallbacks once AclManifest is proven safe.
## This diff (no-op)
This diff adds Shadow path dispatch tests and reusable observation helpers. This is test-only setup with no production behavior change; it defines the expected path-side comparison rows, skipped comparisons, error logging, and unrestricted-row behavior before dispatch is wired.
___
overriding_review_checks_triggers_an_audit_and_retroactive_review
Oncall Short Name: source_control
Differential Revision: D103433632
fbshipit-source-id: aae009a742e5b3236dc58faa28da4c84742425f21 parent 9f2009a commit d7b7959
2 files changed
Lines changed: 287 additions & 15 deletions
Lines changed: 121 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
2036 | 2038 | | |
2037 | 2039 | | |
2038 | 2040 | | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
0 commit comments