diff --git a/pgpm/constructive-compute/deploy/schemas/constructive_compute_public/schema/default_table_privs/authenticated.sql b/pgpm/constructive-compute/deploy/schemas/constructive_compute_public/schema/default_table_privs/authenticated.sql new file mode 100644 index 000000000..eca2cd724 --- /dev/null +++ b/pgpm/constructive-compute/deploy/schemas/constructive_compute_public/schema/default_table_privs/authenticated.sql @@ -0,0 +1,7 @@ +-- Deploy: schemas/constructive_compute_public/schema/default_table_privs/authenticated +-- made with <3 @ constructive.io + +-- requires: schemas/constructive_compute_public/schema + + +ALTER DEFAULT PRIVILEGES IN SCHEMA "constructive_compute_public" GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO authenticated; diff --git a/pgpm/constructive-compute/pgpm.plan b/pgpm/constructive-compute/pgpm.plan index 0e6585061..1e85b59ed 100644 --- a/pgpm/constructive-compute/pgpm.plan +++ b/pgpm/constructive-compute/pgpm.plan @@ -17,6 +17,7 @@ schemas/constructive_compute_public/schema/default_function_privs/authenticated schemas/constructive_compute_public/schema/default_seq_privs/administrator [schemas/constructive_compute_public/schema] 2017-08-11T08:11:51Z Constructive # add alter_default_privileges_grant_on_sequences schemas/constructive_compute_public/schema/default_seq_privs/authenticated [schemas/constructive_compute_public/schema] 2017-08-11T08:11:51Z Constructive # add alter_default_privileges_grant_on_sequences schemas/constructive_compute_public/schema/default_table_privs/administrator [schemas/constructive_compute_public/schema] 2017-08-11T08:11:51Z Constructive # add alter_default_privileges_grant_on_tables +schemas/constructive_compute_public/schema/default_table_privs/authenticated [schemas/constructive_compute_public/schema] 2017-08-11T08:11:51Z Constructive # add alter_default_privileges_grant_on_tables schemas/constructive_compute_public/tables/platform_function_graph_execution_outputs/table [schemas/constructive_compute_public/schema] 2017-08-11T08:11:51Z Constructive # add create_partitioned_table schemas/constructive_compute_public/tables/platform_function_graph_execution_outputs/alterations/alt0000002636 [schemas/constructive_compute_public/tables/platform_function_graph_execution_outputs/table schemas/constructive_compute_public/schema] 2017-08-11T08:11:51Z Constructive # add disable_row_level_security schemas/constructive_compute_public/tables/platform_function_graph_execution_outputs/alterations/alt0000002637 [schemas/constructive_compute_public/tables/platform_function_graph_execution_outputs/table schemas/constructive_compute_public/schema] 2017-08-11T08:11:51Z Constructive # add set_comment diff --git a/pgpm/constructive-compute/revert/schemas/constructive_compute_public/schema/default_table_privs/authenticated.sql b/pgpm/constructive-compute/revert/schemas/constructive_compute_public/schema/default_table_privs/authenticated.sql new file mode 100644 index 000000000..34239ed77 --- /dev/null +++ b/pgpm/constructive-compute/revert/schemas/constructive_compute_public/schema/default_table_privs/authenticated.sql @@ -0,0 +1,4 @@ +-- Revert: schemas/constructive_compute_public/schema/default_table_privs/authenticated + + +ALTER DEFAULT PRIVILEGES IN SCHEMA "constructive_compute_public" REVOKE SELECT, INSERT, UPDATE, DELETE ON TABLES FROM authenticated; diff --git a/pgpm/constructive-compute/sql/constructive-compute--0.0.1.sql b/pgpm/constructive-compute/sql/constructive-compute--0.0.1.sql index ea6557f2a..540187826 100644 --- a/pgpm/constructive-compute/sql/constructive-compute--0.0.1.sql +++ b/pgpm/constructive-compute/sql/constructive-compute--0.0.1.sql @@ -41,6 +41,9 @@ ALTER DEFAULT PRIVILEGES IN SCHEMA constructive_compute_public ALTER DEFAULT PRIVILEGES IN SCHEMA constructive_compute_public GRANT ALL ON TABLES TO administrator; +ALTER DEFAULT PRIVILEGES IN SCHEMA constructive_compute_public + GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO authenticated; + CREATE TABLE constructive_compute_public.platform_function_graph_execution_outputs ( created_at timestamptz NOT NULL DEFAULT now() ) PARTITION BY RANGE (created_at); diff --git a/pgpm/constructive-compute/verify/schemas/constructive_compute_public/schema/default_table_privs/authenticated.sql b/pgpm/constructive-compute/verify/schemas/constructive_compute_public/schema/default_table_privs/authenticated.sql new file mode 100644 index 000000000..469126dcd --- /dev/null +++ b/pgpm/constructive-compute/verify/schemas/constructive_compute_public/schema/default_table_privs/authenticated.sql @@ -0,0 +1 @@ +-- Verify: schemas/constructive_compute_public/schema/default_table_privs/authenticated diff --git a/pgpm/constructive-infra-seed/deploy/grants/standalone_schema_access.sql b/pgpm/constructive-infra-seed/deploy/grants/standalone_schema_access.sql index 195bc638d..4b5d911cb 100644 --- a/pgpm/constructive-infra-seed/deploy/grants/standalone_schema_access.sql +++ b/pgpm/constructive-infra-seed/deploy/grants/standalone_schema_access.sql @@ -1,7 +1,7 @@ -- Deploy: grants/standalone_schema_access -- made with <3 @ constructive.io -- --- Standalone dev-mode grants for the authenticated role. +-- Standalone dev-mode grants for the authenticated and anonymous roles. -- -- In the monolith, schema USAGE and table SELECT are granted at provisioning -- time by the RLS module. In standalone mode there is no provisioning step, @@ -13,6 +13,10 @@ BEGIN; +-- ═══════════════════════════════════════════════════════════════════════════════ +-- AUTHENTICATED role (full CRUD) +-- ═══════════════════════════════════════════════════════════════════════════════ + -- ─── Schema USAGE ──────────────────────────────────────────────────────────── GRANT USAGE ON SCHEMA constructive_compute_public TO authenticated; GRANT USAGE ON SCHEMA constructive_platform_function_graph_public TO authenticated; diff --git a/pgpm/constructive-platform-function-graph/deploy/schemas/constructive_platform_function_graph_public/schema/default_table_privs/authenticated.sql b/pgpm/constructive-platform-function-graph/deploy/schemas/constructive_platform_function_graph_public/schema/default_table_privs/authenticated.sql new file mode 100644 index 000000000..e139da811 --- /dev/null +++ b/pgpm/constructive-platform-function-graph/deploy/schemas/constructive_platform_function_graph_public/schema/default_table_privs/authenticated.sql @@ -0,0 +1,7 @@ +-- Deploy: schemas/constructive_platform_function_graph_public/schema/default_table_privs/authenticated +-- made with <3 @ constructive.io + +-- requires: schemas/constructive_platform_function_graph_public/schema + + +ALTER DEFAULT PRIVILEGES IN SCHEMA "constructive_platform_function_graph_public" GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO authenticated; diff --git a/pgpm/constructive-platform-function-graph/pgpm.plan b/pgpm/constructive-platform-function-graph/pgpm.plan index 9c21dc06d..843be5638 100644 --- a/pgpm/constructive-platform-function-graph/pgpm.plan +++ b/pgpm/constructive-platform-function-graph/pgpm.plan @@ -16,6 +16,7 @@ schemas/constructive_platform_function_graph_public/schema/default_function_priv schemas/constructive_platform_function_graph_public/schema/default_seq_privs/administrator [schemas/constructive_platform_function_graph_public/schema] 2017-08-11T08:11:51Z Constructive # add alter_default_privileges_grant_on_sequences schemas/constructive_platform_function_graph_public/schema/default_seq_privs/authenticated [schemas/constructive_platform_function_graph_public/schema] 2017-08-11T08:11:51Z Constructive # add alter_default_privileges_grant_on_sequences schemas/constructive_platform_function_graph_public/schema/default_table_privs/administrator [schemas/constructive_platform_function_graph_public/schema] 2017-08-11T08:11:51Z Constructive # add alter_default_privileges_grant_on_tables +schemas/constructive_platform_function_graph_public/schema/default_table_privs/authenticated [schemas/constructive_platform_function_graph_public/schema] 2017-08-11T08:11:51Z Constructive # add alter_default_privileges_grant_on_tables schemas/constructive_platform_function_graph_public/tables/platform_function_graph_commit/table [schemas/constructive_platform_function_graph_public/schema] 2017-08-11T08:11:51Z Constructive # add create_table schemas/constructive_platform_function_graph_public/tables/platform_function_graph_commit/alterations/alt0000002579 [schemas/constructive_platform_function_graph_public/schema schemas/constructive_platform_function_graph_public/tables/platform_function_graph_commit/table] 2017-08-11T08:11:51Z Constructive # add disable_row_level_security schemas/constructive_platform_function_graph_public/tables/platform_function_graph_commit/alterations/alt0000002580 [schemas/constructive_platform_function_graph_public/tables/platform_function_graph_commit/table schemas/constructive_platform_function_graph_public/schema] 2017-08-11T08:11:51Z Constructive # add set_comment diff --git a/pgpm/constructive-platform-function-graph/revert/schemas/constructive_platform_function_graph_public/schema/default_table_privs/authenticated.sql b/pgpm/constructive-platform-function-graph/revert/schemas/constructive_platform_function_graph_public/schema/default_table_privs/authenticated.sql new file mode 100644 index 000000000..35976907b --- /dev/null +++ b/pgpm/constructive-platform-function-graph/revert/schemas/constructive_platform_function_graph_public/schema/default_table_privs/authenticated.sql @@ -0,0 +1,4 @@ +-- Revert: schemas/constructive_platform_function_graph_public/schema/default_table_privs/authenticated + + +ALTER DEFAULT PRIVILEGES IN SCHEMA "constructive_platform_function_graph_public" REVOKE SELECT, INSERT, UPDATE, DELETE ON TABLES FROM authenticated; diff --git a/pgpm/constructive-platform-function-graph/sql/constructive-platform-function-graph--0.0.1.sql b/pgpm/constructive-platform-function-graph/sql/constructive-platform-function-graph--0.0.1.sql index 95b12afde..51bd7e885 100644 --- a/pgpm/constructive-platform-function-graph/sql/constructive-platform-function-graph--0.0.1.sql +++ b/pgpm/constructive-platform-function-graph/sql/constructive-platform-function-graph--0.0.1.sql @@ -39,6 +39,9 @@ ALTER DEFAULT PRIVILEGES IN SCHEMA constructive_platform_function_graph_public ALTER DEFAULT PRIVILEGES IN SCHEMA constructive_platform_function_graph_public GRANT ALL ON TABLES TO administrator; +ALTER DEFAULT PRIVILEGES IN SCHEMA constructive_platform_function_graph_public + GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO authenticated; + CREATE TABLE constructive_platform_function_graph_public.platform_function_graph_commit (); ALTER TABLE constructive_platform_function_graph_public.platform_function_graph_commit diff --git a/pgpm/constructive-platform-function-graph/verify/schemas/constructive_platform_function_graph_public/schema/default_table_privs/authenticated.sql b/pgpm/constructive-platform-function-graph/verify/schemas/constructive_platform_function_graph_public/schema/default_table_privs/authenticated.sql new file mode 100644 index 000000000..93153bce7 --- /dev/null +++ b/pgpm/constructive-platform-function-graph/verify/schemas/constructive_platform_function_graph_public/schema/default_table_privs/authenticated.sql @@ -0,0 +1 @@ +-- Verify: schemas/constructive_platform_function_graph_public/schema/default_table_privs/authenticated diff --git a/www/src/components/FlowsPanel.tsx b/www/src/components/FlowsPanel.tsx index 6a39b4bae..a1eac2de5 100644 --- a/www/src/components/FlowsPanel.tsx +++ b/www/src/components/FlowsPanel.tsx @@ -488,8 +488,8 @@ async function pollExecutionStatus(executionId: string): Promise<{ ? (new Date(n.completedAt || Date.now()).getTime() - new Date(n.startedAt).getTime()) : null, })); - } catch { - // node_states query may fail if schema not yet available + } catch (err) { + console.error('[pollExecutionStatus] node_states query failed:', err); } // Also query invocations for detailed payload/result data @@ -501,8 +501,8 @@ async function pollExecutionStatus(executionId: string): Promise<{ orderBy: ['CREATED_AT_ASC'], }).unwrap(); invocationsArr = invResult?.platformFunctionInvocations?.nodes ?? []; - } catch { - // Invocations query may fail if graphExecutionId filter isn't supported yet + } catch (err) { + console.error('[pollExecutionStatus] invocations query failed:', err); } const nodeStates: Record = {}; @@ -807,8 +807,8 @@ export function FlowsPanel() { pollRef.current = null; setIsExecuting(false); } - } catch { - // Keep polling on transient errors + } catch (pollErr) { + console.error('[execution-poll] transient error:', pollErr); } }, EXECUTION_POLL_MS); } catch (err: unknown) {