Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion crates/agent/src/controlplane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,12 +577,16 @@ impl<C: DiscoverConnectors + MakeConnectors> ControlPlane for PGControlPlane<C>
}

async fn get_live_specs(&self, names: BTreeSet<String>) -> anyhow::Result<tables::LiveCatalog> {
let snapshot = self.snapshot_watch.token();
let snapshot = snapshot.result().unwrap();
let names = names.into_iter().collect::<Vec<_>>();
let mut live = live_specs::get_live_specs(
self.system_user_id,
&names,
None, // don't filter based on user capability
&self.pool,
&snapshot,
None,
)
.await?;

Expand Down Expand Up @@ -655,6 +659,9 @@ impl<C: DiscoverConnectors + MakeConnectors> ControlPlane for PGControlPlane<C>
logs_token,
data_plane: data_plane.clone(),
created_at,
snapshot,
// `filter_user_authz` is false, so no staleness anchor is consulted.
started_at: None,
};
discovers_handler.discover(pool, req).await
}
Expand All @@ -666,14 +673,22 @@ impl<C: DiscoverConnectors + MakeConnectors> ControlPlane for PGControlPlane<C>
draft: tables::DraftCatalog,
default_data_plane: Option<String>,
) -> anyhow::Result<PublicationResult> {
let snapshot = self.snapshot_watch.token();
let publication = DraftPublication {
user_id: self.system_user_id,
logs_token,
draft,
detail,
dry_run: false,
default_data_plane_name: default_data_plane,
// skip authz checks for controller-initiated publications
// Controllers construct a fresh publication per poll, so they have
// no instant that stays fixed across attempts to anchor staleness
// on; they carry their own retry/backoff instead.
started_at: None,
snapshot: snapshot
.result()
.expect("authorization snapshot is not ready"),
// Skip user-to-catalog checks; spec-to-spec `RoleGrant` checks remain mandatory.
verify_user_authz: false,
initialize: NoopInitialize,
finalize: PruneUnboundCollections,
Expand Down
Loading
Loading