Skip to content

Add organization integration tab + event API route - #1673

Merged
HugoGresse merged 2 commits into
mainfrom
org-key-ui
Jun 14, 2026
Merged

Add organization integration tab + event API route#1673
HugoGresse merged 2 commits into
mainfrom
org-key-ui

Conversation

@HugoGresse

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 14, 2026 14:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 ApiKeyIntegrationCard UI component for generate/rotate/reveal/copy flows.
  • Added /events/me API route + schema + tests to return only public event fields for an event API key.
  • Moved organization API keys into organizations/{orgId}/private/integration and updated auth resolution to query private subcollections via collectionGroup('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.

Comment thread src/admin/organization/core/actions/updateOrganizationApiKey.ts
Comment thread functions/src/api/dao/OrganizationDao.ts
@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown

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

@cypress

cypress Bot commented Jun 14, 2026

Copy link
Copy Markdown

open-feedback    Run #3044

Run Properties:  status check passed Passed #3044  •  git commit dba1fe312b: Add organization integration tab + event API route (#1673)
Project open-feedback
Branch Review main
Run status status check passed Passed #3044
Run duration 02m 17s
Commit git commit dba1fe312b: Add organization integration tab + event API route (#1673)
Committer Hugo Gresse
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 2
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 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>
@HugoGresse
HugoGresse merged commit dba1fe3 into main Jun 14, 2026
10 checks passed
@HugoGresse
HugoGresse deleted the org-key-ui branch June 14, 2026 14:59
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.

2 participants