Commit Graph

53 Commits

Author SHA1 Message Date
marc cc3d65a013 docs: complete function reference, drop unicode punctuation
Documents refresh_hierarchy_cache, is_rule_valid and org_in_scope, and
corrects the get_org_scope scope list which still omitted unattributed
and all.

Replaces em dashes and other typographic unicode with ASCII throughout
the schema comments, the test suite and the documentation. Comments and
prose are ASCII only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-25 07:26:54 +02:00
marc fa7567f5f0 feat(scope): unattributed and all org targets
Adds a first-class org target vocabulary shared by every rule kind: a
specific organization, unattributed (objects whose org is NULL), or all.
A role can now be granted the unassigned pile without a global rule.

- rules.scope gains 'unattributed' and 'all'
- user_rules.org_id accepts NULL to target unattributed objects
- org_in_scope partitions the classes: 'unattributed' matches only a NULL
  target, tree scopes never match one
- has_permission(user, activity, view) capability probe for UI gating
- current_org_filter() parses morbac.org_ids once into org UUIDs plus the
  unattributed-bucket flag (a JSON null element requests it)
- rls_check split by arity so NULL never carries two meanings:
  rls_check(activity, view) for tables with no org column,
  rls_check(activity, view, row_org_id[, row_user_id]) where a NULL
  row_org_id means the record is unattributed
- detect_rule_conflicts is scope-aware, so rules targeting different
  object sets no longer collide

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 22:35:03 +02:00
marc 6dd1026c5a build: signed PGXN release tooling + Drone pipeline
Build the distribution from src/ (control, versioned SQL, META, MIT LICENSE,
PGXS Makefile, install README), checksum it, and sign an Ed25519 JWT manifest
(audience pgmorbac-release) with the verification public key attached to the
release. `npm run release` does it locally; the Drone pipeline does it on a
v* tag once the repo is Trusted with the pgmorbac_release_key + gitea_token
secrets.
2026-07-22 09:22:26 +02:00
marc 3ee1e426a8 chore: rehome to crudy/pgmorbac, align version to 0.1.0
Public home is now git.villains.fr/crudy/pgmorbac with docs at
pgmorbac.villains.fr. Point META.json, README and CHANGELOG links there,
drop the tracked .DS_Store, and renumber the first public release to 0.1.0
to match the published @crudy/pgmorbac package, the embedded framework SQL
and the download page. License stays MIT.
2026-07-22 09:16:59 +02:00
marc 14592b91ae test(hierarchies): cover cache invalidation on hierarchy removal 2026-07-22 09:16:59 +02:00
marc 499df68bf5 fix(rls): not handling global permissions 2026-04-07 01:42:47 +02:00
marc 97a13bfeb3 fix(views): add missing and remove unnecessary 2026-04-07 01:07:20 +02:00
marc 4eefc0897f fix(service_principal): add first rules setup 2026-04-06 16:37:53 +02:00
marc e653b38b88 fix(authorization): system principal regretion 2026-04-06 16:16:29 +02:00
marc 0e3b90af22 feat(system): introduce global rules and system principals for easier system account handling 2026-04-04 09:23:46 +02:00
marc f64cd73159 feat(rules): add rules for users 2026-04-01 23:18:01 +02:00
marc 5ef8bae1b4 feat(all): add scope handling in rules 2026-04-01 23:07:20 +02:00
marc 8273d56d4e misc(docs): cleanup some rules/policy words 2026-03-29 22:21:20 +02:00
marc 80be5f913c feat(rls): add multi-orgs filtering logic 2026-03-29 22:08:49 +02:00
marc b05ca7a323 feat(rls): add multi-org checking when no org filter is provided 2026-03-29 21:58:30 +02:00
marc bfcbf15379 feat(activity): add binding to views 2026-03-28 13:03:12 +01:00
marc b3d9c8dbce fix(docs): update to latest code and functionnalities 2026-03-27 22:06:50 +01:00
marc 145f50749b misc(all): cleanup comments, update documentation, tidy up code 2026-03-27 21:56:00 +01:00
marc 41747a79a0 feat(rules): add priority field 2026-03-23 01:01:38 +01:00
marc cba741fd9d feat(rules): add priority field 2026-03-23 01:00:04 +01:00
marc fca7e2053f feat(rules): add preemptive warning when creating conflicting rules 2026-03-23 00:50:00 +01:00
marc 09082ea0d3 feat(info): cleanup obligations and recommendations features 2026-03-23 00:12:37 +01:00
marc a448a73e37 misc(project): add missing documentation and cleanup 2026-03-22 23:57:49 +01:00
marc 10c1ea4a7e feat(hirearchy): add helpers 2026-03-22 23:41:05 +01:00
marc c22d18063b feat(tests): add more tests and make them pass 2026-03-22 23:25:48 +01:00
marc 90b96079a0 feat(docs): add information on how to describe rules for hierarchies 2026-03-22 17:40:23 +01:00
marc 9e1e448159 feat(src): ensure extension works and tests pass 2026-03-22 15:41:00 +01:00
marc 32a6a8dd17 refacto: pg_morbac -> pgmorbac 2026-02-22 22:29:52 +01:00
marc 2202676f54 remove: pgcrypto reference 2026-02-22 21:42:50 +01:00
marc 38c08ff448 feat(tools,test): add better output 2026-02-22 21:35:51 +01:00
marc c369e32c93 feat(tools,build): dynamically list files to build 2026-02-22 21:14:16 +01:00
marc bba1dd5677 fix(tools,test): wrong user 2026-02-22 21:11:07 +01:00
marc 1f33854b27 remove(tools,docker): stderr ignore making it hard to debug 2026-02-22 21:06:47 +01:00
marc ce44dde2c6 misc(tools): set exec flags 2026-02-22 21:02:02 +01:00
marc ca84385794 refacto(makefile): reorder rules 2026-02-22 20:58:53 +01:00
marc ac6acbf42e refacto(tools): action_docker -> docker_action 2026-02-22 20:57:18 +01:00
marc d343524e05 feat(tools): add docker scripts 2026-02-22 20:50:26 +01:00
marc 5957ac4789 feat(tools): cleanup scripts and Makefile 2026-02-22 20:33:04 +01:00
marc 85f53eff31 docs(development): update to latest dev process 2026-02-20 11:44:34 +01:00
marc 8df25b4a90 docs(documentation): remove bad ressources links 2026-02-20 11:24:37 +01:00
marc a7420862bf docs(documentation): add more examples 2026-02-20 11:14:26 +01:00
marc c34be980c8 docs: remove leftover code bloc 2026-02-20 11:05:26 +01:00
marc b68bded4bb docs: cleanup documentation files 2026-02-20 11:01:32 +01:00
marc 2d5f4ca669 refacto: morbac_pg -> pg_morbac 2026-02-20 10:36:19 +01:00
marc 5b4095677e build: cleanup build process 2026-02-20 01:40:15 +01:00
marc d80b9f387b refacto: add build and cleanup file structure 2026-02-20 01:32:08 +01:00
marc 6adc62f9ec tests: cleanup structure 2026-02-20 01:04:02 +01:00
marc 11e42f080e refacto: add a build to avoid lingering version numbers 2026-02-20 00:54:15 +01:00
marc 3bdfd27879 misc: remove unnecessary title prefix numbers 2026-02-20 00:45:34 +01:00
marc 2cce5ab4c1 feat: improve performance with cache and proper indexing 2026-02-20 00:39:27 +01:00