CrunchyData / pg_parquet

Copy to/from Parquet in S3 from within PostgreSQL
Other
358 stars 11 forks source link

Move access checks to the COPY hook #56

Closed pgguru closed 4 weeks ago

pgguru commented 1 month ago

In order to allow low-level usage of the DestReceiver returned by create_copy_parquet_dest_receiver(), hoist the permissions checks into the actual COPY hook. This allows DestReceiver consumers to perform their own checks/verifications rather than relying on the specifics herein.

aykut-bozkurt commented 4 weeks ago

As discussed offline, can you add a test to ensure metadata inspection udfs fail when the read role not granted.

pgguru commented 4 weeks ago

Can't we move ensure_permission check to hook.rs and udfs? That way dest receiver does not hit into permission checks during copy and regular copy to/from is checked properly.

Yup, taking this approach now. Tests pass locally.