Repository navigation
fix(opa-bridge): $snapshots needs read_data; comments on views ask commit - #2238
Conversation
The summary column of $snapshots can contain partition values and custom snapshot properties that writers add. A principal who may only see a table therefore no longer reads $snapshots through Trino; read_data on the base table is needed, as for $files and $partitions.
Trino's SetViewComment asked the view action write_data, which views do not have, so COMMENT ON VIEW was always refused. Trino stores the comment as a view property, so the bridge now asks a commit of any kind on the view.
Trino sends SetColumnComment for a column of a view too, with the view's name and nothing that says it is a view. The bridge sent it only to the table rule, which asked a table commit on the view's name, so COMMENT ON COLUMN on a view was always refused. The view rule now asks a view commit of any kind for it, as for SetViewComment; tables are decided by the table rule as before. Also clarify which values $snapshots shows in docs/opa.md.
|
|
|
No actionable comments were generated in the recent review. WalkthroughThe Trino OPA policies now require ChangesSnapshot-table permissions
View-comment authorization
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Possibly related PRs
Merge Risk:
|
✅ PR Title Formatted CorrectlyThe title of this PR match the correct format. Thank you! |
Two fixes in the Trino OPA bridge.
$snapshotsmetadata table of a table now needsread_dataon the table, as$files,$manifestsand$partitionsalready do. Itssummarycolumn can contain partition values and other values that writers add. Before,get_metadatawas enough.$snapshotsstays atread_datafor good, also when a later release letsdescribesee snapshot summaries with only counts and sizes. The bridge cannot filter single summary keys, and Trino loads table metadata with its own identity, so a redaction in Lakekeeper never reaches Trino users.COMMENT ON VIEWandCOMMENT ON COLUMNon a view now askcommiton the view. Before,COMMENT ON VIEWasked an action that views do not have, andCOMMENT ON COLUMNasked a table commit on the view's name, so both were always refused.Tests pin both:
$snapshotsis allowed for a principal withread_dataand refused for one who may only see the table; both view comment statements are allowed for a principal who may commit to the view and refused for one who may do everything else on it.Release notes
$snapshotsmetadata table through Trino needsread_dataon the table. Users who may only see a table cannot read it any more, because snapshot summaries can contain partition values and other values from the data. Update the bridge policies to apply this.COMMENT ON VIEWandCOMMENT ON COLUMNon a view through Trino work for users who may change the view (commit). Before, the bridge refused them for everyone.Summary by CodeRabbit
read_dataaccess rather thanget_metadata.commitaccess to the view.