You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Apply view policy on both profiling faces before any route exposes them #1796
Originated in the review of #1789 (fluree-db-stats kernel and on-demand column profiling).
Problem
Neither profiling face applies view policy. Fluree::profile_ledger reads the ledger's flakes directly through range_with_overlay, and Fluree::profile_table streams the lake table through the graph-source scan with no policy context. Both are documented as belonging behind an administrative surface until they do (fluree-db-api/src/profile.rs module doc).
Today no HTTP route, CLI command or tool reaches either face, so this is a constraint on whoever wires one, not a bypass. It has to land before any of those exist: a profile reports top values, extremes and per-group medians, which is exactly the data a view policy is meant to withhold.
What is needed
Accept a policy context on ProfileRequest (or on the call) the way query and ledger_info do, and fail closed when a policy is present and the face cannot enforce it.
Ledger face: filter the ranged flakes through the same enforcement the raw-leaflet readers use (filter_flakes_by_policy is the reusable piece; see the per-operator enforcement notes for why there is no central choke point). Group-key flakes need the same filtering, since a key is a value too.
Lake face: apply the graph source's policy the way the R2RML scan does for queries, or refuse when one is configured.
A test per face that a subject-targeted view policy hides its values from the profile, including from top_values and text.min/text.max.
Notes
key_candidate, distinct and the counts are derived from what was folded, so a filtered profile reports the visible column, not the column. That is the intended semantics and should be stated in the report or the docs.
Activity