Skip to content

feat(BA-6860): RBAC-gate app_config fragment writes at the processors#12759

Draft
jopemachine wants to merge 2 commits into
feat/BA-6556-app-config-rest-v2from
feat/BA-6836-app-config-fragment-write-authz
Draft

feat(BA-6860): RBAC-gate app_config fragment writes at the processors#12759
jopemachine wants to merge 2 commits into
feat/BA-6556-app-config-rest-v2from
feat/BA-6836-app-config-fragment-write-authz

Conversation

@jopemachine

@jopemachine jopemachine commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

Gates AppConfig fragment writes with RBAC (BA-6860, BEP-1052 / epic BA-5781), completing the write-authorization path whose data layer landed in #12801 (BA-6859). The interim fixed-scope _may_write service check is gone — authorization now runs on the standard RBAC validators at the processor layer.

How

  • Processors: the RBAC validators are attached to the write processors only — create → scope validator, update/purge → single-entity validator, bulk_* → bulk validator; validators is passed through the factory. Read processors (get / admin_search / scoped_search) carry no validator.
  • Resolution: a caller may write when their role grants the operation on APP_CONFIG_FRAGMENT in the fragment's scope — a user in their own user scope (system role, auto-provisioned at user creation; the fragment→scope association from feat(BA-6859): bind app_config fragments to their RBAC scope on write (repository layer) #12801 resolves update/purge targets), a domain admin in their domain, a superadmin anywhere. public fragments are global-scoped (no RBAC scope) → superadmin-only.
  • Routes: fragment POST /, PATCH /{id}, DELETE /{id} move from superadmin_required to auth_required; handler/adapter methods drop the admin_ prefix. Read routes unchanged.

Notes

  • Reads stay allowlist/visibility-gated (no RBAC on the read path) — see the access model below.
  • No data backfill: the feature is unreleased, so no pre-existing fragments or write paths exist.
  • bulk_* service paths are validator-gated but not yet API-exposed.

📚 Stacked PRs

Part of the AppConfigFragment / AppConfig stack under BEP-1052 (epic BA-5781). Merge in order:

  1. feat(BA-6552): add app_config_fragments DB model and Alembic migration #12306feat(BA-6552): app_config_fragments DB model and Alembic migration
  2. feat(BA-6553): add app_config_fragments repository layer #12307feat(BA-6553): repository layer
  3. refactor(BA-6619): consolidate AppConfigScopeType into common.data (single definition) #12403refactor(BA-6619): consolidate AppConfigScopeType into common.data
  4. refactor(BA-6620): ExistsQuerier ops primitive + AppConfigAllowList.exists #12405refactor(BA-6620): ExistsQuerier + AppConfigAllowList.exists
  5. feat(BA-6554): add app_config_fragment service layer #12358feat(BA-6554): AppConfigFragment service layer
  6. feat(BA-6702): move fragment rank to the allow list with scope defaults #12516feat(BA-6702): move fragment rank to the allow list with scope defaults
  7. feat(BA-6701): expose allow-list rank on the v2 API surface #12517feat(BA-6701): expose allow-list rank on the v2 API surface
  8. feat(BA-6704): cascade app config subtree deletion from the definition #12518feat(BA-6704): cascade app config subtree deletion from the definition
  9. feat(BA-6626): app_config_fragment bulk repository layer #12426feat(BA-6626): app_config_fragment bulk repository layer
  10. feat(BA-6618): app_config_fragment bulk CRUD service layer #12401feat(BA-6618): app_config_fragment bulk CRUD service layer
  11. feat(BA-6810): AppConfigFragment visible-fragments query (repository layer) #12706feat(BA-6810): AppConfigFragment visible-fragments query (repository layer)
  12. feat(BA-6859): bind app_config fragments to their RBAC scope on write (repository layer) #12801feat(BA-6859): bind fragments to their RBAC scope on write (repository layer)
  13. feat(BA-6555): AppConfig merge engine + resolve service (service layer) #12359feat(BA-6555): AppConfig merge engine + resolve service (service layer)
  14. feat(BA-6556): AppConfig REST v2 API (raw fragments and merged read/update) #12377feat(BA-6556): AppConfig REST v2 API
  15. 👉 feat(BA-6860): RBAC-gate app_config fragment writes at the processors #12759feat(BA-6860): RBAC-gate fragment writes at the processors ← you are here

Access model: fragment create/update/purge are gated by RBAC (a user writes their own user-scope fragment, a domain admin their domain's, a superadmin any — public is superadmin-only); reads are gated by the allow list (existence = readable layer, rank = merge order) plus scope visibility, with no RBAC on the read path; app_config_definitions / app_config_allow_list themselves are superadmin-only (REST + GQL). Closed / superseded: #12794 · #12756 · #12764.


📚 Documentation preview 📚: https://sorna--12759.org.readthedocs.build/en/12759/


📚 Documentation preview 📚: https://sorna-ko--12759.org.readthedocs.build/ko/12759/

@github-actions github-actions Bot added size:XL 500~ LoC comp:manager Related to Manager component comp:common Related to Common component area:docs Documentations labels Jul 10, 2026
@jopemachine jopemachine force-pushed the feat/BA-6835-app-config-allow-list-access-api branch from e2546af to 62c763d Compare July 10, 2026 08:20
@jopemachine jopemachine force-pushed the feat/BA-6836-app-config-fragment-write-authz branch from 1ac7aa8 to b65cd3a Compare July 10, 2026 08:20
@jopemachine jopemachine force-pushed the feat/BA-6835-app-config-allow-list-access-api branch from 62c763d to 0ffd004 Compare July 13, 2026 04:27
@jopemachine jopemachine force-pushed the feat/BA-6836-app-config-fragment-write-authz branch from b65cd3a to 6f1d562 Compare July 13, 2026 04:27
@jopemachine jopemachine force-pushed the feat/BA-6835-app-config-allow-list-access-api branch from 0ffd004 to 4232da6 Compare July 13, 2026 05:13
@jopemachine jopemachine force-pushed the feat/BA-6836-app-config-fragment-write-authz branch from 6f1d562 to eff9831 Compare July 13, 2026 05:13
@jopemachine jopemachine changed the title feat(BA-6836): authorize fragment writes via allow_list write_access tier feat(BA-6836): authorize fragment writes via allow_list permission (ro/rw) Jul 13, 2026
@jopemachine jopemachine force-pushed the feat/BA-6835-app-config-allow-list-access-api branch from 4232da6 to 166ad7c Compare July 13, 2026 05:29
@jopemachine jopemachine force-pushed the feat/BA-6836-app-config-fragment-write-authz branch 2 times, most recently from 2c9e320 to b8eafd8 Compare July 13, 2026 06:14
@jopemachine jopemachine changed the base branch from feat/BA-6835-app-config-allow-list-access-api to feat/BA-6556-app-config-rest-v2 July 13, 2026 06:14
@jopemachine jopemachine changed the title feat(BA-6836): authorize fragment writes via allow_list permission (ro/rw) feat(BA-6836): authorize fragment writes by a fixed per-scope rule Jul 13, 2026
@jopemachine jopemachine force-pushed the feat/BA-6556-app-config-rest-v2 branch from b528b62 to 0c1ba3e Compare July 13, 2026 09:30
@jopemachine jopemachine force-pushed the feat/BA-6836-app-config-fragment-write-authz branch from b8eafd8 to a7944ba Compare July 13, 2026 09:30
@jopemachine jopemachine changed the title feat(BA-6836): authorize fragment writes by a fixed per-scope rule feat(BA-6860): RBAC-gate app_config fragment writes at the processors Jul 13, 2026
@github-actions github-actions Bot added size:M 30~100 LoC and removed size:XL 500~ LoC labels Jul 13, 2026
Attach the RBAC validators to the app_config_fragment write processors
(create -> scope, update/purge -> single-entity, bulk_* -> bulk) and pass
validators through the factory. Reads (get/admin_search/scoped_search) carry
no validator — they stay gated by the allow list and scope visibility. The
fragment write routes move from superadmin_required to auth_required and the
handler/adapter methods drop their admin_ prefix; RBAC resolves who may write
(a user their own user-scope fragment via their system role and the fragment's
scope association from BA-6859, a domain admin their domain's, a superadmin
any scope — public stays superadmin-only, having no RBAC scope).

Replaces the interim fixed-scope _may_write service check entirely.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jopemachine jopemachine force-pushed the feat/BA-6556-app-config-rest-v2 branch from 0c1ba3e to c0b6154 Compare July 13, 2026 09:54
Co-authored-by: octodog <mu001@lablup.com>
@jopemachine jopemachine force-pushed the feat/BA-6836-app-config-fragment-write-authz branch from a402f67 to 78caa30 Compare July 13, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentations comp:common Related to Common component comp:manager Related to Manager component size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant