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
fix: change BlueprintPolicy.policy_type to $type to match SQL convention
The construct_blueprint SQL procedure reads policy type via:
v_policy_type := v_policy_entry->>'\';
But the TypeScript BlueprintPolicy interface used 'policy_type' which
doesn't match the blueprint JSON convention used by nodes and relations.
Updated buildBlueprintPolicy in generate-types.ts to always use the
static definition with $type (skipping the introspection-driven path
which derives from the DB column name). Regenerated types.
addJSDoc(requiredProp('policy_type',policyTypeAnnotation),'Authz* policy type name (e.g., "AuthzDirectOwner", "AuthzAllowAll").'),
340
+
addJSDoc(requiredProp('$type',policyTypeAnnotation),'Authz* policy type name (e.g., "AuthzDirectOwner", "AuthzAllowAll").'),
341
+
addJSDoc(optionalProp('privileges',t.tsArrayType(t.tsStringKeyword())),'Privileges this policy applies to (e.g., ["select"], ["insert", "update", "delete"]).'),
342
+
addJSDoc(optionalProp('permissive',t.tsBooleanKeyword()),'Whether this policy is permissive (true) or restrictive (false). Defaults to true.'),
352
343
addJSDoc(optionalProp('policy_role',t.tsStringKeyword()),'Role for this policy. Defaults to "authenticated".'),
353
-
addJSDoc(optionalProp('permissive',t.tsBooleanKeyword()),'Whether this policy is permissive (true) or restrictive (false).'),
354
344
addJSDoc(optionalProp('policy_name',t.tsStringKeyword()),'Optional custom name for this policy.'),
355
-
addJSDoc(optionalProp('privileges',t.tsArrayType(t.tsStringKeyword())),'Privileges this policy applies to.'),
356
345
addJSDoc(optionalProp('data',recordType(t.tsStringKeyword(),t.tsUnknownKeyword())),'Policy-specific data (structure varies by policy type).'),
357
346
]),
358
-
'An RLS policy entry for a blueprint table.'
347
+
'An RLS policy entry for a blueprint table. Uses $type to match the blueprint JSON convention.'
0 commit comments