There was an error while loading. Please reload this page.
1 parent 24b97ec commit 965e884Copy full SHA for 965e884
8 files changed
crates/agent/src/directives/grant.rs
crates/agent/src/directives/mod.rs
@@ -11,7 +11,6 @@ use validator::Validate;
11
pub mod accept_demo_tenant;
12
pub mod beta_onboard;
13
pub mod click_to_accept;
14
-pub mod grant;
15
pub mod storage_mappings;
16
17
/// JobStatus is the possible outcomes of a handled directive operation.
@@ -43,7 +42,6 @@ pub enum Directive {
43
42
BetaOnboard(beta_onboard::Directive),
44
ClickToAccept(click_to_accept::Directive),
45
AcceptDemoTenant(accept_demo_tenant::Directive),
46
- Grant(grant::Directive),
47
StorageMappings(storage_mappings::Directive),
48
}
49
@@ -134,7 +132,6 @@ impl DirectiveHandler {
134
132
135
133
Ok(Directive::ClickToAccept(d)) => click_to_accept::apply(d, row, txn).await?,
136
Ok(Directive::AcceptDemoTenant(d)) => accept_demo_tenant::apply(d, row, txn).await?,
137
- Ok(Directive::Grant(d)) => grant::apply(d, row, txn).await?,
138
Ok(Directive::StorageMappings(d)) => {
139
storage_mappings::apply(d, row, &self.logs_tx, txn).await?
140
crates/agent/src/integration_tests/harness.rs
@@ -596,7 +596,7 @@ impl TestHarness {
596
597
pub async fn add_user_grant(&mut self, user_id: Uuid, role: &str, capability: Capability) {
598
let mut txn = self.pool.begin().await.unwrap();
599
- control_plane_api::directives::grant::upsert_user_grant(
+ control_plane_api::grants::upsert_user_grant(
600
user_id,
601
role,
602
capability,
crates/control-plane-api/src/directives/mod.rs
@@ -1,6 +1,5 @@
1
2
3
4
5
6
use crate::TextJson;
…ontrol-plane-api/src/directives/grant.rs crates/control-plane-api/src/grants.rscrates/control-plane-api/src/directives/grant.rs renamed to crates/control-plane-api/src/grants.rs
crates/control-plane-api/src/lib.rs
@@ -12,6 +12,7 @@ pub mod discovers;
pub mod draft;
mod envelope;
pub mod evolutions;
+pub mod grants;
mod interval;
pub mod jobs;
18
pub mod live_specs;
crates/control-plane-api/src/server/public/graphql/invite_links.rs
@@ -313,7 +313,7 @@ impl InviteLinksMutation {
313
314
315
// Upsert the user grant (only upgrades capability, never downgrades).
316
- crate::directives::grant::upsert_user_grant(
+ crate::grants::upsert_user_grant(
317
claims.sub,
318
&invite.catalog_prefix,
319
invite.capability,
supabase/migrations/20260416120000_retire_grant_directives.sql
@@ -0,0 +1,23 @@
+begin;
+
+-- Phase 3: Retire grant directives.
+-- The invite links system (Phase 1a-b) has fully replaced grant directives.
+-- Drop the transitional dual-write triggers and clean up old directive rows.
7
+-- Drop triggers first, then their backing functions.
8
+drop trigger if exists mirror_grant_directive on public.directives;
9
+drop trigger if exists sync_directive_removal on public.directives;
10
+drop function if exists internal.mirror_grant_directive_to_invite_links();
+drop function if exists internal.sync_directive_removal_to_invite_links();
+-- Delete applied_directives for grant directives (FK will not cascade from directives).
+delete from applied_directives
+where directive_id in (
+ select id from directives where spec->>'type' = 'grant'
+);
19
20
+-- Delete the grant directives themselves.
21
+delete from directives where spec->>'type' = 'grant';
22
23
+commit;
0 commit comments