Skip to content

feat(api-keys): implement API keys management interface and access control#1588

Merged
AnishSarkar22 merged 1 commit into
MODSetter:mainfrom
AnishSarkar22:fix/ci-ui-changes
Jul 8, 2026
Merged

feat(api-keys): implement API keys management interface and access control#1588
AnishSarkar22 merged 1 commit into
MODSetter:mainfrom
AnishSarkar22:fix/ci-ui-changes

Conversation

@AnishSarkar22

@AnishSarkar22 AnishSarkar22 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Description

Motivation and Context

FIX #

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR implements a dedicated API keys management interface within the workspace playground section. It introduces a new WorkspaceApiAccessControl component that manages workspace-level API access permissions, refactors the existing general settings by extracting the API access toggle into this reusable component, and creates a new API keys page (/playground/api-keys) that combines user API key management with workspace API access control. The changes also add navigation items to the playground sidebar and index page to make the new API keys interface accessible.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_web/components/settings/workspace-api-access-control.tsx
2 surfsense_web/components/settings/general-settings-manager.tsx
3 surfsense_web/app/dashboard/[workspace_id]/playground/api-keys/page.tsx
4 surfsense_web/components/layout/ui/playground/PlaygroundSidebar.tsx
5 surfsense_web/app/dashboard/[workspace_id]/playground/components/playground-index.tsx

Need help? Join our Discord

Summary by CodeRabbit

  • New Features

    • Added a workspace-level API Keys page and navigation entry in the playground.
    • Added an API Keys card and updated links to open the workspace-scoped API keys area.
    • Introduced a dedicated workspace API access control section in settings with loading, error, and retry states.
  • Bug Fixes

    • Removed the automatic redirect so users can manage API keys directly from the dashboard.

…ntrol

- Added a new WorkspaceApiAccessControl component for managing API key access within workspaces.
- Enhanced the PlaygroundApiKeysPage to display API key creation options and access information.
- Updated PlaygroundIndex and PlaygroundSidebar to include links to the new API keys management section.
- Improved user feedback with alerts and descriptions regarding API key usage and requirements.
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

@AnishSarkar22 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@AnishSarkar22 AnishSarkar22 merged commit 1ae927a into MODSetter:main Jul 8, 2026
2 of 8 checks passed
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4627e957-507c-4791-9f90-0f3fbf061110

📥 Commits

Reviewing files that changed from the base of the PR and between 7faa58a and 719c2da.

📒 Files selected for processing (5)
  • surfsense_web/app/dashboard/[workspace_id]/playground/api-keys/page.tsx
  • surfsense_web/app/dashboard/[workspace_id]/playground/components/playground-index.tsx
  • surfsense_web/components/layout/ui/playground/PlaygroundSidebar.tsx
  • surfsense_web/components/settings/general-settings-manager.tsx
  • surfsense_web/components/settings/workspace-api-access-control.tsx

📝 Walkthrough

Walkthrough

This PR extracts workspace API access toggle logic into a new WorkspaceApiAccessControl component, used both in GeneralSettingsManager and a new playground API keys page (replacing a prior redirect). Navigation links for "API Keys" are added to the playground sidebar and index grid.

Changes

Workspace API Access Control

Layer / File(s) Summary
WorkspaceApiAccessControl component
surfsense_web/components/settings/workspace-api-access-control.tsx
New client component queries workspace api_access_enabled state, toggles it via mutation atom, and renders loading skeleton, error/retry UI, or a labeled switch.
General settings integration
surfsense_web/components/settings/general-settings-manager.tsx
Removes inline API access toggle state and UI, replacing it with <WorkspaceApiAccessControl>.
Playground API keys page
surfsense_web/app/dashboard/[workspace_id]/playground/api-keys/page.tsx
Replaces redirect with a rendered page showing an alert, WorkspaceApiAccessControl, and ApiKeyContent separated by a Separator.
Navigation links
surfsense_web/app/dashboard/[workspace_id]/playground/components/playground-index.tsx, surfsense_web/components/layout/ui/playground/PlaygroundSidebar.tsx
Adds "API Keys" nav card/link with KeyRound icon and updates an existing alert link to the new ${base}/api-keys route.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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