Skip to content

feat(secrets): org-scoped secrets UI — share checkbox and permission-gated actions [OHE-2568] - #449

Merged
tofarr merged 1 commit into
mainfrom
ohe-2568/org-scoped-secrets-ui
Sep 21, 2026
Merged

tofarr merged 1 commit into
mainfrom
ohe-2568/org-scoped-secrets-ui

Conversation

@tofarr

@tofarr tofarr commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

HUMAN:

  • A human has tested these changes.

AGENT:


Why

OHE-2568: Backend Phase 1 (commit c1d7492) added organization-scoped secrets — secrets that can be shared with all members of an organization. However, the frontend UI did not expose this capability: there was no way to share a secret with the org, and org-scoped secrets appeared in the list without any indication of their scope or ownership. This PR adds the frontend UI for org-scoped secrets.

Summary

  • Share checkbox: Added a "Share with organization" checkbox to the secret create/edit form (below the description field), visible only to admins/owners (manage_org_secrets permission). When checked, the secret is created/updated via the org-secrets endpoint (/api/organizations/{org_id}/secrets) instead of the personal V1 endpoint.
  • Permission-gated action buttons: Edit and delete buttons are hidden in the secrets table for org-scoped secrets when the current user lacks manage_org_secrets permission (members can see and use org-shared secrets but cannot modify them). Personal secrets remain fully editable by their owner.
  • Shared badge: Org-scoped secrets display a "Shared" badge next to the secret name in the list.
  • manage_org_secrets permission: Added the permission key to the frontend permissions module (admin/owner only), matching the backend ROLE_PERMISSIONS mapping.
  • Tests: 8 new frontend tests (28 total, all passing) + 11 backend route tests for org_secrets.py permission enforcement.

Issue Number

OHE-2568

How to Test

Frontend tests

cd frontend && npm run test -- --run secrets-settings

All 28 tests pass (20 existing + 8 new).

Backend tests

uv run pytest tests/unit/server/routes/test_org_secrets.py tests/unit/storage/test_org_secrets_store.py

All 22 tests pass (11 route + 11 store).

Manual testing

  1. As an admin/owner, go to Settings → Secrets and click "Add a new secret".
  2. Verify the "Share with organization" checkbox appears below the description field.
  3. Create a secret with the checkbox checked — it should appear in the list with a "Shared" badge.
  4. As a member, view the secrets list — org-shared secrets should show the "Shared" badge but no edit/delete buttons.
  5. As an admin/owner, org-shared secrets should show edit/delete buttons.

Video/Screenshots

image image

Shared with non admin view:
image

Type

  • Feature
  • Bug fix
  • Refactor
  • Breaking change
  • Docs / chore

Notes

  • Backend Phase 1 (migration + routes) was already committed in c1d7492.
  • The manage_org_secrets permission is admin/owner only on both backend and frontend.
  • Org-shared secret values are write-once (never read back) — the update endpoint only changes name/description, matching the personal secrets behavior.
  • This PR was created by an AI agent (OpenHands) on behalf of the user.

Enterprise server image for this PR:

ghcr.io/openhands/enterprise-server:sha-e4f0566

…ission-gated actions

OHE-2568: Frontend support for organization-scoped secrets.

- Add 'Share with organization' checkbox to the secret create/edit form,
  visible only to admins/owners (manage_org_secrets permission). When
  checked, the secret is created/updated via the org-secrets endpoint.
- Hide edit/delete action buttons for org-scoped secrets when the current
  user lacks manage_org_secrets permission (members can see but not modify
  org-shared secrets).
- Display a 'Shared' badge next to org-scoped secrets in the list.
- Route delete/update to the org-secrets endpoint when the secret is
  org-scoped, using the selected organization ID.
- Add manage_org_secrets permission key to frontend permissions (admin/owner
  only, matching the backend ROLE_PERMISSIONS mapping).
- Add scope field to CustomSecretWithoutValue type.
- Add 8 new frontend tests covering share checkbox visibility, org secret
  creation, badge display, and hidden action buttons (28 total, all pass).
- Add 11 backend route tests for org_secrets.py permission enforcement.

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions github-actions Bot added the type: feat A new feature label Sep 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage report

This PR does not seem to contain any modification to coverable code.

@tofarr
tofarr marked this pull request as ready for review September 21, 2026 11:58
@tofarr
tofarr marked this pull request as draft September 21, 2026 11:58
@tofarr
tofarr marked this pull request as ready for review September 21, 2026 12:38

@hieptl hieptl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 🙏

@tofarr
tofarr merged commit a99a390 into main Sep 21, 2026
24 checks passed
@tofarr
tofarr deleted the ohe-2568/org-scoped-secrets-ui branch September 21, 2026 12:48
@openhands-release-bot openhands-release-bot Bot added the released: 1.63.0 Shipped in 1.63.0 label Sep 22, 2026
@openhands-release-bot

Copy link
Copy Markdown
Contributor

🚀 Released in 1.63.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released: 1.63.0 Shipped in 1.63.0 type: feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants