Skip to content

Release 0.2.0#13

Merged
benoitcayladbx merged 23 commits into
masterfrom
develop
May 1, 2026
Merged

Release 0.2.0#13
benoitcayladbx merged 23 commits into
masterfrom
develop

Conversation

@benoitcayladbx
Copy link
Copy Markdown
Collaborator

Release 0.2.0
See Release Notes

benoitcayladbx and others added 22 commits April 24, 2026 16:18
Fixing icon import (+ Async run) - develop branch
- PermissionService: split the shared users/groups attributes into
  two scoped pairs so list_app_principals (Databricks-App ACL) and
  list_users / list_groups (full SCIM directory) no longer share
  storage. Broaden clear_principals_cache to drop every
  principal-related cache (app, workspace, admin, user-groups,
  bootstrap-403 flag).
- Replace the duplicated _filter_*_by_user_access helpers in
  internal/settings.py and internal/domain.py with a single
  filter_visible_domains helper in internal/_permissions.py.
- tests/test_permissions.py: tighten TestPrincipalsCache.test_clear
  and add a regression test verifying that list_app_principals and
  list_users/list_groups don't poison each other's caches.
Add a small FastAPI dependency factory that lets routes declare
their minimum role at the route signature instead of via inline
role_level checks or middleware prefix tables.

- back/objects/registry/guards.py: new module exposing
  require(min_role, *, scope='app'|'domain'). Reads
  request.state.user_role / user_domain_role (populated by the
  middleware) and raises AuthorizationError when the caller is
  below min_role. The domain scope falls back to user_role so
  admins still pass.
- api/routers/internal/dtwin.py: replace the three inline
  role_level checks (/sync/start, /sync/reload-from-registry,
  /sync/drop-snapshot) with
  Depends(require(ROLE_BUILDER, scope='domain')) on the route
  decorator. Drop the now-unused AuthorizationError / role_level
  imports.
- api/routers/internal/settings.py: annotate /permissions,
  /permissions/principals, /permissions/search,
  /domain-permissions (GET / POST / DELETE) and /teams (GET /
  POST) with Depends(require(ROLE_ADMIN)). /permissions/me and
  /permissions/diag stay open (still in _PERM_BYPASS_PREFIXES,
  the user-self-introspection endpoints).
- tests/test_route_guards.py: 26 unit + end-to-end tests covering
  the factory, both scopes, ROLE_NONE / missing role rejection,
  the admin domain-fallback, and the structured 403 shape.

Hybrid scope per agreement: middleware coarse gates
(_PERM_ADMIN_ONLY_PREFIXES, _DOMAIN_SCOPED_PREFIXES,
viewer-write block) stay in place as a safety net; the
declarative guards are concentrated on the routes named in the
plan and the existing 1787 tests still pass.
Stamp the caller's resolved roles directly on the page so the
frontend stops fetching /settings/permissions/me on first paint.

- front/fastapi/dependencies.py: expose is_app_mode() as a Jinja
  global (mirror of back.core.databricks.is_databricks_app) so
  templates can switch off permission gates in local-dev mode.
- front/templates/base.html: add data-app-role / data-domain-role
  / data-app-mode attributes to <body> using the Jinja globals.
  Load the new permissions.js as the first deferred script so
  every later script (navbar, version-check, ...) sees
  window.OB.permissions.
- front/static/global/js/permissions.js: new ~70 LOC module that
  reads the body data-attributes once and freezes
  window.OB.permissions = { appRole, domainRole, isAppMode,
  isAdmin/isViewer/isEditor/isBuilder, hasAppRole(role),
  hasDomainRole(role) }. The role hierarchy mirrors the backend
  (none < viewer < editor < builder < admin); admins satisfy
  any domain gate via the same fallback used by the backend
  require(scope='domain') dependency.
- front/static/global/js/navbar.js: showAdminNavItems() now reads
  window.OB.permissions synchronously instead of fetching
  /settings/permissions/me. The .admin-only-nav inline
  display:none default and the JS un-hide both stay until step 4
  replaces the pair with a CSS-only [data-requires-app] gate.
- front/static/global/js/version-check.js: checkDomainRole()
  becomes synchronous and reads window.OB.permissions; the second
  /settings/permissions/me fetch is gone. The viewer banner /
  fetch-guard / disable-editing cascade is unchanged. Step 4 will
  delete the helper outright.

1787/1787 tests pass; live render of `/` confirms the data
attributes resolve to admin/admin/false in local-dev mode.
permissions.css now drives every UI gate from data-attributes on
<body> (data-app-role / data-domain-role) and the read-only-version
body class. Templates declare admin-only nodes with
``data-requires-app="admin"`` instead of the legacy
``class="admin-only-nav" style="display:none"`` plus a navbar.js
sweep, and the older-version DOM disabling that lived as 13 helpers
in version-check.js is now a single block of CSS rules in
permissions.css.

Highlights:
 - new front/static/global/css/permissions.css: app-role / domain-role
   attribute gates and consolidated body.read-only-version rules
   (replaces disableEditingForInactiveVersion + helpers, including
   metadata, documents, ontology import, mapping import/designer/
   manual, business views, data quality, OWL preview)
 - base.html / home.html / _sidebar_nav.html: emit
   data-requires-app="admin" instead of admin-only-nav + inline
   display:none; permissions.css linked last so its !important gates
   win the cascade
 - registry.js: render delete buttons with data-requires-app="admin"
   and drop the showAdminNavItems() callback
 - navbar.js: remove showAdminNavItems() (CSS now owns it)
 - version-check.js: 526 -> ~95 lines; only checkVersionStatus,
   showReadOnlyBanner, installReadOnlyContextMenuBlocker remain.
   Viewer fetch guard, checkDomainRole, _VIEWER_WRITE_* lists, and
   the per-button disable helpers are gone.
 - ontology-core.js: drop the viewer/403 retry path; keep the
   inactive-version GET fallback for OWL preview
 - body.read-only-mode renamed to body.read-only-version across
   main.css / components.css / sidebar-layout.css / mapping.css /
   ontoviz.css / ontoviz-ui.css / breadcrumb.js to align with the
   class checkVersionStatus now sets

Net: -475 lines of frontend code, role/version state read directly
from the rendered DOM with no extra round-trip.

Verified: 1787 tests pass; smoke render of / shows
data-app-role/data-domain-role/data-app-mode populated and
data-requires-app="admin" markup gated correctly for admin vs
viewer scenarios.
* Red card (Out of sync with last build)
* Graph DB Digital Twin marked as Loaded (no built yet)
* Teams icon (sub menu on the left retractable) is not aligned with the others
* Frontend / disable actions when no permissions
* Add data wrappers docs
* UI improvements
(a) Add a small psycopg connection pool to LakebaseRegistryStore?
(b) Lazy-load the .lbug graph (skip sync_from_volume on load, fetch on first DT/Build access)?
@benoitcayladbx benoitcayladbx requested a review from a team as a code owner May 1, 2026 15:40
@gitguardian
Copy link
Copy Markdown

gitguardian Bot commented May 1, 2026

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
32279171 Triggered Generic Database Assignment a3b55be tests/test_lakebase_auth.py View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@benoitcayladbx benoitcayladbx changed the title Develop Release 0.2.0 May 1, 2026
@benoitcayladbx benoitcayladbx merged commit 8b875d2 into master May 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant