Skip to content

issue #3105: Hop Web authentication, roles, and UI authorization - #7819

Draft
mattcasters wants to merge 9 commits into
apache:mainfrom
mattcasters:issue-3105
Draft

issue #3105: Hop Web authentication, roles, and UI authorization#7819
mattcasters wants to merge 9 commits into
apache:mainfrom
mattcasters:issue-3105

Conversation

@mattcasters

@mattcasters mattcasters commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Draft implementation for issue #3105: authentication and role-based authorization for Hop Web, with UI gating, configuration UI, project access control, and documentation.

Authentication modes

Mode Description
NONE Open access (default; unrestricted session, desktop-like)
EXTERNAL Trust servlet container / reverse proxy principal; map container or LDAP groups to Hop roles
BASIC Hop-managed form login (/login) against users.json (PBKDF2); optional HTTP Basic for API clients
OAUTH2 OpenID Connect authorization code + PKCE (Nimbus); claim groups map to Hop roles

Config lives under HOP_CONFIG_FOLDER/security/ (security-config.json, users.json). Env vars bootstrap mode, admin seed, demo users, and OAuth secrets (HOP_WEB_SECURITY_MODE, HOP_WEB_SEED_DEMO_USERS, HOP_WEB_OAUTH_*, …).

Local helpers: docker/run-hop-web-local-with-basic.sh, -with-oauth.sh, -with-users.sh, and docker/local-auth-config/.

Roles and permissions

Built-in roles Admin, User, Operator, Read-only with fine-grained Permission values (file.edit, file.save, run.execute, metadata.write, security.manage, …).

  • Session context: HopSecurity / HopSecurityContext (+ source/LDAP group names for project rules)
  • Menus, toolbars, context actions, and keyboard shortcuts gated via capability + permission mappers
  • Mutations re-check permission and show Access denied when blocked

UI authorization (read-only and canvas)

  • IDialogEditable on transform/action/metadata bases → BaseDialog.defaultShellHandling opens dialogs read-only without file.edit / metadata.write
  • Legacy dialogs covered via dialog-subject stack on open call sites
  • Metadata perspective editors go read-only; dirty flag suppressed without write permission
  • Graph: no drag/move/resize/delete/hop create without file.edit (pipeline + workflow)
  • RAP-safe handling (no hard StyledText class load on Hop Web)

Security configuration UI

Configuration → Security (requires security.manage):

  • General — mode, welcome message
  • OAuth — issuer, client, redirect, scopes, claims, PKCE
  • External — container/IdP/LDAP → Hop role mappings
  • Basic — users table
  • Projects (Projects plugin) — user / role / group → project access

Plugin extension: @GuiTab(parentId = ConfigSecurityTab.SECURITY_CONFIG_TABS) + ISecurityConfigSection.

Session UX

  • Styled login page (logo, welcome text)
  • Toolbar: signed-in username + Log off (Hop Web)
  • Log off clears session (BASIC/OAuth/container as applicable)

Project access control

projects-access.json: enable rules by username, Hop role, or LDAP/IdP group. Enforced on project switch, select-project dialog, and startup project load. Admins always allowed; desktop/unrestricted not filtered.

Documentation

hop-web.adoc updated with modes, roles, configuration tabs, scripts, and screenshots (hop-web-login.png, hop-web-security-configuration-ui.png, hop-web-toolbar-user-and-log-off.png).

Test plan

  • NONE — unrestricted UI (desktop and web)
  • ./docker/run-hop-web-local-with-basic.sh — login as seeded users; roles gate save/edit/run
  • Read-only user: dialogs and metadata editors read-only; cannot move/delete transforms/notes; Del blocked
  • Operator: execute allowed; save/edit blocked
  • Log off returns to login; re-login works
  • Configuration → Security tabs load/save; BASIC users persist; External mappings apply
  • Projects tab: enable access control; restrict viewer to one project; switcher/startup respect rules
  • OAuth path (if IdP available): ./docker/run-hop-web-local-with-oauth.sh
  • Unit tests: security + projects access (HopSecurityContextTest, HopDialogEditGuardTest, ProjectsAccessControlTest, …)

Notes for reviewers

  • Large surface area by design (AuthN + AuthZ + UI choke points + docs). Happy to split follow-ups if preferred.
  • Server-side enforcement of remaining mutation APIs may still need hardening beyond UI gates.
  • Draft PR for early feedback before polish/CI green.

Add multi-mode auth (NONE/EXTERNAL/BASIC/OAuth2), RBAC for Admin/User/Operator/Read-only,
read-only dialogs and graph guards, security configuration UI with plugin tabs, project
access control, log-off, and documentation screenshots.
…in mapping

Default audit data to /tmp/hop-web-audit with per-user isolation and a
java.io.tmpdir fallback. Document Google email→admin roleMappings and stop
local OAuth env from overwriting claim settings in security-config.json.
Allow users to act as Operator or Read-only for the current session without
re-login, with restore to full base privileges. Toolbar combo, RAP session
overlay, desktop simulation, and docs.
Use relative URLs for history.replaceState so TLS-terminated proxies
do not trigger mixed http/https History API errors. Absolute shareable
links honor X-Forwarded-Proto/Host.
getPrivilegeModeList was returning String[] but BaseGuiWidgets.getComboItems
casts comboValuesMethod results to List, causing ClassCastException on Hop Web login.
getStateMap/getCurrentUnitTest used HopGui from transform threads during
getTransformFields (lineage), which throws IllegalStateException on RAP.
Return null when no UI session instead of failing GetFieldsExtension.
@mattcasters mattcasters added this to the 2.20 milestone Aug 8, 2026
Add Permission.PLUGIN_MANAGE (Admin only) and gate marketplace mutations:
Install/Uninstall, repository config, hop-env Apply, and auto-apply on
environment enable. Catalog browse and Validate remain open to all roles.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant