Skip to content

Feat/security enhancements#1

Merged
Amanbig merged 9 commits into
mainfrom
feat/security-enhancements
Jul 21, 2026
Merged

Feat/security enhancements#1
Amanbig merged 9 commits into
mainfrom
feat/security-enhancements

Conversation

@Amanbig

@Amanbig Amanbig commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Description

This PR implements security enhancements, rate-limiting consolidation, admin pre-seeding, and a complete modular refactoring of the frontend client architecture.

Key Changes:

  1. Frontend Modularization:

    • Decoupled monolithic JSX in App.tsx into clean, modular components.
    • Extracted layout components (Sidebar.tsx, Header.tsx) and views (SecretsView.tsx, MembersView.tsx, ApiKeysView.tsx, SettingsView.tsx).
    • Isolated 11 interactive/confirm modals into src/components/modals/.
  2. Fine-Grained API Key Access Control:

    • Introduced a scope field ('full' or 'read-only') to API keys in both backend schema and UI.
    • Added validation middleware to block modifying endpoints (POST, PUT, DELETE) for keys with read-only scope.
  3. Organization Member Management & Deletion:

    • Implemented a secure DELETE /organizations/members/:userId endpoint.
    • Added a Trash removal button next to organization members with automatic cascading database cleanup.
  4. Security Enhancements:

    • Added password challenges (currentPassword checks) on the backend and frontend before users can change usernames, emails, or delete their accounts.
    • Implemented a safeguard to prevent organization owner users from deleting their accounts directly, which would orphan the organization.
    • Fixed a critical security vulnerability by restricting organization updates to owner/admin roles and deletions exclusively to the owner role.
  5. Rate Limiting & Admin Pre-Seeding:

    • Consolidated rate limiters into a shared rateLimiter.ts middleware file.
    • Enabled administrative configuration and auto-seeding via DEFAULT_ADMIN_EMAIL and DEFAULT_ADMIN_PASSWORD to bypass the initial signup flow in self-hosted Docker environments.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Docs
  • Chore / refactor

Checklist

  • npm run format:check passes (client and/or server, as touched)
  • npm run lint passes (client)
  • npm run build passes (client and/or server, as touched)
  • I tested this change locally
  • Docs (README/Wiki) updated if behavior changed

@Amanbig
Amanbig merged commit 8b1af63 into main Jul 21, 2026
2 checks passed
@Amanbig
Amanbig deleted the feat/security-enhancements branch July 21, 2026 07:45
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