Add organization integration tab + event API route - #1673
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends OpenFeedback’s API-key based integrations by adding an organization-level “Integration” tab in the admin UI and introducing an authenticated /events/me API endpoint (mirroring the existing /organizations/me behavior), while refactoring shared API-key UI and generation utilities.
Changes:
- Added an organization Integration tab and shared
ApiKeyIntegrationCardUI component for generate/rotate/reveal/copy flows. - Added
/events/meAPI route + schema + tests to return only public event fields for an event API key. - Moved organization API keys into
organizations/{orgId}/private/integrationand updated auth resolution to query private subcollections viacollectionGroup('private').
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/generateApiKey.ts | Generalizes API key generation and adds an organization key prefix/helper. |
| src/admin/translations/languages/fr.admin.json | Adds French strings for organization integration text. |
| src/admin/translations/languages/en.admin.json | Adds English strings for organization integration text. |
| src/admin/RoutingMap.js | Adds organization “integration” route entry. |
| src/admin/project/settings/integration/Integration.tsx | Refactors event integration screen to use shared card component. |
| src/admin/project/core/actions/updateProjectApiKey.ts | Updates import path for project API key generator. |
| src/admin/project/core/actions/newProject.js | Updates import path for project API key generator. |
| src/admin/organization/OrganizationApp.jsx | Registers the organization integration route. |
| src/admin/organization/layout/OrganizationTabs.jsx | Adds the “Integration” tab for organizations. |
| src/admin/organization/integration/OrganizationIntegration.tsx | Implements organization integration screen using shared card component. |
| src/admin/organization/core/actions/updateOrganizationApiKey.ts | Adds Firestore read/write actions for org API key in private subcollection. |
| src/admin/baseComponents/ApiKeyIntegrationCard.tsx | New shared UI card for API key reveal/copy/generate/rotate. |
| functions/src/types/Organization.ts | Documents deprecated org-doc apiKey and adds private integration type. |
| functions/src/api/schemas.ts | Adds EventSchema for the new event route response. |
| functions/src/api/routes/organizations/getByApiKey.ts | Clarifies behavior for org vs event keys in route description. |
| functions/src/api/routes/organizations/getByApiKey.spec.ts | Updates tests to reflect org key resolution via private integration docs. |
| functions/src/api/routes/events/index.ts | Registers the new events routes module. |
| functions/src/api/routes/events/getByApiKey.ts | Adds /events/me route using API-key authentication and public-field response. |
| functions/src/api/routes/events/getByApiKey.spec.ts | Adds test coverage for /events/me behavior and field filtering. |
| functions/src/api/plugins/openAPIPlugin.ts | Adds API key security scheme to OpenAPI configuration. |
| functions/src/api/plugins/apiKeyPlugin.spec.ts | Updates auth plugin test stubs to match new private-doc resolution chain. |
| functions/src/api/dao/OrganizationDao.ts | Resolves org by API key via collectionGroup('private') and stamps last-used time. |
| functions/src/api/api.ts | Registers /events routes in the Fastify API. |
| config/firestore.rules | Adds org private subcollection rules mirroring project private rules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Visit the preview URL for this PR (updated for commit 42cefd8): https://open-feedback-42--pr1673-org-key-ui-xqqjh25v.web.app (expires Sun, 21 Jun 2026 14:37:56 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 08b588459ed3335bea4061fbe93b8b77635ad43a |
open-feedback
|
||||||||||||||||||||||||||||
| Project |
open-feedback
|
| Branch Review |
main
|
| Run status |
|
| Run duration | 02m 17s |
| Commit |
|
| Committer | Hugo Gresse |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
2
|
|
|
0
|
|
|
0
|
|
|
14
|
| View all changes introduced in this branch ↗︎ | |
- OrganizationDao.getOrganizationFromApiKey strips the deprecated org-doc apiKey before returning, so a legacy value can never be hydrated and leaked through /organizations/me (+ regression test). - updateOrganizationApiKey guards a null selected organization id instead of calling .doc(null) and crashing the UI action. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
No description provided.