Skip to content

feat(core): delete token secrets on token storage disabled #7589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

simeng-li
Copy link
Contributor

Summary

Should delete all token secrets when token storage is disabled.

Testing

test locally integration test case updated

Checklist

  • .changeset
  • unit tests
  • integration tests
  • necessary TSDoc comments

should delete all token secrets when token storage is disabled
@simeng-li simeng-li requested review from a team and Copilot July 24, 2025 08:16
Copy link

github-actions bot commented Jul 24, 2025

COMPARE TO master

Total Size Diff 📈 +3.81 KB

Diff by File
Name Diff
packages/core/src/queries/secret.ts 📈 +793 Bytes
packages/core/src/routes/connector/index.ts 📈 +477 Bytes
packages/core/src/routes/sso-connector/index.ts 📈 +1022 Bytes
packages/integration-tests/src/api/sso-connector.ts 📈 +232 Bytes
packages/integration-tests/src/tests/api/experience-api/sign-in-interaction/enterprise-sso.test.ts 📈 +637 Bytes
packages/integration-tests/src/tests/api/experience-api/sign-in-interaction/social.test.ts 📈 +738 Bytes

Copy link
Contributor

@Copilot Copilot AI left a comment

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 implements functionality to delete token secrets when token storage is disabled for social connectors and enterprise SSO connectors. When the enableTokenStorage setting is changed to false, all stored token secrets associated with the connector are automatically removed.

  • Adds automatic deletion of token secrets when token storage is disabled
  • Implements token storage support validation for OIDC connectors only
  • Adds database queries to delete token secrets by connector ID

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/core/src/queries/secret.ts Adds database methods to delete token secrets by social and enterprise SSO connector IDs
packages/core/src/routes/connector/index.ts Implements token secret deletion for social connectors when token storage is disabled
packages/core/src/routes/sso-connector/index.ts Implements token secret deletion for SSO connectors and adds OIDC validation
packages/integration-tests/src/api/sso-connector.ts Adds update method to SSO connector API for testing
packages/integration-tests/src/tests/api/experience-api/sign-in-interaction/social.test.ts Adds integration test for social connector token deletion
packages/integration-tests/src/tests/api/experience-api/sign-in-interaction/enterprise-sso.test.ts Adds integration test for enterprise SSO connector token deletion

@simeng-li simeng-li changed the title feat(core): delete token secrets on token storage disabed feat(core): delete token secrets on token storage disabled Jul 24, 2025
@github-actions github-actions bot added size/s and removed size/s labels Jul 24, 2025
Copy link
Contributor

@darcyYe darcyYe left a comment

Choose a reason for hiding this comment

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

Overall LGTM

refactor type assertion code
@github-actions github-actions bot added size/m and removed size/s labels Jul 25, 2025
@simeng-li simeng-li enabled auto-merge (squash) July 25, 2025 03:09
@simeng-li simeng-li merged commit 85c0c87 into master Jul 25, 2025
60 of 63 checks passed
@simeng-li simeng-li deleted the simeng-log-11878-delete-users-existing-tokens-after-disabling-token-storage branch July 25, 2025 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants