You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** A storage-specific RLS policy object for apply_storage_security(). Each entry defines an Authz* policy with explicit privileges, scoped to specific storage tables. */
835
-
exportinterfaceBlueprintStoragePolicy{
836
-
/** Authz* policy generator type (e.g., "AuthzPublishable", "AuthzDirectOwner", "AuthzEntityMembership"). */
837
-
$type: string;
838
-
/** Privilege array (e.g., ["select", "insert", "update", "delete"]). Intersected with each storage table's supported operations. */
839
-
privileges: string[];
840
-
/** Policy data config. Auto-derived from $type when omitted (e.g., AuthzPublishable defaults to {"is_published_field": "is_public", "require_published_at": false}). */
841
-
data?: Record<string,unknown>;
842
-
/** Which storage tables to apply this policy to. Defaults to all three when omitted. Uses logical names (not prefixed). */
843
-
tables?: ('buckets'|'files'|'upload_requests')[];
844
-
/** Custom RLS policy name suffix. Auto-derived from $type when omitted (pub/own/mem). */
845
-
policy_name?: string;
846
-
}
847
834
/** A bucket seed entry for storage_config.buckets[]. Creates an initial bucket row in the {prefix}_buckets table during entity type provisioning. Only used for app-level storage (not entity-scoped). */
848
835
exportinterfaceBlueprintBucketSeed{
849
836
/** Bucket key name (e.g., "avatars", "documents"). Becomes the key column value. */
/** Storage configuration for an entity type. Controls RLS policies on storage tables, seeds initial buckets, and overrides module-level settings (expiry times, file size limits, CORS). */
849
+
/** Storage configuration for an entity type. Seeds initial buckets, overrides module-level settings (expiry times, file size limits, CORS), and provides per-table provisioning overrides via provisions. */
863
850
exportinterfaceBlueprintStorageConfig{
864
-
/** Custom RLS policies for storage tables. When provided, replaces the default policy set (AuthzPublishable + membership + AuthzDirectOwner). Each entry is a policy object with $type, privileges, and optional data/tables/policy_name. */
865
-
policies?: BlueprintStoragePolicy[];
866
851
/** Initial bucket seed entries. Each creates a row in {prefix}_buckets during provisioning. Only used for app-level storage (not entity-scoped). */
867
852
buckets?: BlueprintBucketSeed[];
868
853
/** Override for presigned upload URL expiry time in seconds. */
/** CORS allowed origins for the storage module. */
875
860
allowed_origins?: string[];
876
-
/** Per-table overrides for storage tables. Each key targets a specific storage table (files, buckets, upload_requests) and uses the same shape as table_provision: { nodes, fields, grants, use_rls, policies }. Fanned out to secure_table_provision targeting the corresponding table. */
877
-
storage_table_provisions?: {
861
+
/** Per-table overrides for storage tables. Each key targets a specific storage table (files, buckets, upload_requests) and uses the same shape as table_provision: { nodes, fields, grants, use_rls, policies }. Fanned out to secure_table_provision targeting the corresponding table. When a key includes policies[], those REPLACE the default storage policies for that table; tables without a key still get defaults. */
'Policy data config. Auto-derived from $type when omitted (e.g., AuthzPublishable defaults to {"is_published_field": "is_public", "require_published_at": false}).'
646
-
),
647
-
addJSDoc(
648
-
optionalProp(
649
-
'tables',
650
-
t.tsArrayType(
651
-
strUnion(['buckets','files','upload_requests'])
652
-
)
653
-
),
654
-
'Which storage tables to apply this policy to. Defaults to all three when omitted. Uses logical names (not prefixed).'
655
-
),
656
-
addJSDoc(
657
-
optionalProp('policy_name',t.tsStringKeyword()),
658
-
'Custom RLS policy name suffix. Auto-derived from $type when omitted (pub/own/mem).'
659
-
)
660
-
]),
661
-
'A storage-specific RLS policy object for apply_storage_security(). Each entry defines an Authz* policy with explicit privileges, scoped to specific storage tables.'
662
-
);
663
-
}
664
-
665
623
/**
666
624
* Build the BlueprintBucketSeed interface.
667
625
*
@@ -713,15 +671,6 @@ function buildBlueprintBucketSeed(): t.ExportNamedDeclaration {
'Custom RLS policies for storage tables. When provided, replaces the default policy set (AuthzPublishable + membership + AuthzDirectOwner). Each entry is a policy object with $type, privileges, and optional data/tables/policy_name.'
724
-
),
725
674
addJSDoc(
726
675
optionalProp(
727
676
'buckets',
@@ -752,7 +701,7 @@ function buildBlueprintStorageConfig(): t.ExportNamedDeclaration {
752
701
),
753
702
addJSDoc(
754
703
optionalProp(
755
-
'storage_table_provisions',
704
+
'provisions',
756
705
t.tsTypeLiteral([
757
706
optionalProp(
758
707
'files',
@@ -768,10 +717,10 @@ function buildBlueprintStorageConfig(): t.ExportNamedDeclaration {
768
717
)
769
718
])
770
719
),
771
-
'Per-table overrides for storage tables. Each key targets a specific storage table (files, buckets, upload_requests) and uses the same shape as table_provision: { nodes, fields, grants, use_rls, policies }. Fanned out to secure_table_provision targeting the corresponding table.'
720
+
'Per-table overrides for storage tables. Each key targets a specific storage table (files, buckets, upload_requests) and uses the same shape as table_provision: { nodes, fields, grants, use_rls, policies }. Fanned out to secure_table_provision targeting the corresponding table. When a key includes policies[], those REPLACE the default storage policies for that table; tables without a key still get defaults.'
772
721
)
773
722
]),
774
-
'Storage configuration for an entity type. Controls RLS policies on storage tables, seeds initial buckets, and overrides module-level settings (expiry times, file size limits, CORS).'
723
+
'Storage configuration for an entity type. Seeds initial buckets, overrides module-level settings (expiry times, file size limits, CORS), and provides per-table provisioning overrides via provisions.'
775
724
);
776
725
}
777
726
@@ -1020,7 +969,7 @@ function buildBlueprintDefinition(): t.ExportNamedDeclaration {
0 commit comments