Skip to content

Sync: remove email from api key table#640

Open
heushreck wants to merge 2 commits intomainfrom
sync-from-hosted-1770644180
Open

Sync: remove email from api key table#640
heushreck wants to merge 2 commits intomainfrom
sync-from-hosted-1770644180

Conversation

@heushreck
Copy link
Contributor

Auto-synced from hosted repository

Original PR: https://github.com/superglue-ai/superglue-hosted/pull/306
Author: @heushreck
Merged by: @heushreck


Summary by cubic

Stop storing emails in API key records and tool history. Use user IDs instead and fetch emails on demand via the Supabase Admin API or a read-only view for UI and notifications.

  • Refactors

    • Removed userEmail/userName from auth info, API, GraphQL, and datastore types.
    • SupabaseKeyManager now reads created_by_user_id from sg_superglue_api_keys.
    • SupabaseAuthManager and web client createApiKey now write created_by_user_id only.
    • Email notifications look up recipient email by userId at send time.
    • Tool history no longer stores created_by_email; queries and tests updated.
    • Added user lookup utilities (core + web server actions + client hooks with caching).
    • API Keys UI now reads from sg_api_keys_with_email view to show creator emails without storing them; Version History shows emails via lookup.
  • Migration

    • Supabase: rename/add created_by_user_id on sg_superglue_api_keys and backfill from user_id; stop writing created_by_email/name (drop when ready).
    • Create a read-only view sg_api_keys_with_email that exposes created_by_user_id and created_by_email for display.
    • Set NEXT_PUBLIC_SUPABASE_URL and PRIV_SUPABASE_SERVICE_ROLE_KEY for server-side user lookups.
    • Redeploy web to enable the new view and server actions/hooks.

Written for commit 4f5f1643c8151909e078e36119c19025421a21d4. Summary will update on new commits.


⚠️ Note: Hosted-only files (ee/, supabase/, scheduler/, discovery/, etc.) have been automatically excluded from this sync.

heushreck and others added 2 commits February 9, 2026 13:36
* remove email from api key table

* adress comments

* read from supabase view

---------

Co-authored-by: Nicolas Neudeck <nicolas@superglue.ai>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ heushreck
❌ github-actions[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 20 files

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