Skip to content
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

fix: normalize casing for API token types before insert #7972

Merged

Conversation

thomasheartman
Copy link
Contributor

@thomasheartman thomasheartman commented Aug 23, 2024

Fixes a bug where if you had API keys using different casing for the same type, they'd come out as different types in the API token count map. To get around it, we normalize the keys to lowercase before inserting them into the map, taking into account any previous values that might have existed for that type.

Should fix issues like this:
image

Copy link

vercel bot commented Aug 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Aug 23, 2024 9:13am
unleash-monorepo-frontend ⬜️ Ignored (Inspect) Visit Preview Aug 23, 2024 9:13am

Copy link
Contributor

github-actions bot commented Aug 23, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

@thomasheartman thomasheartman force-pushed the fix/1-2735-api-token-stats-bug-instance-stats-and-grafana branch from cd53ab9 to a7b7307 Compare August 23, 2024 09:12
@thomasheartman thomasheartman changed the title fix: normalize casing in API token count map fix: normalize casing for API token types before insert Aug 23, 2024
@thomasheartman thomasheartman merged commit 4693f7c into main Aug 23, 2024
7 checks passed
@thomasheartman thomasheartman deleted the fix/1-2735-api-token-stats-bug-instance-stats-and-grafana branch August 23, 2024 10:53
thomasheartman added a commit that referenced this pull request Aug 23, 2024
Adds a migration to normalize api token types already in the database,
to remove any weird casing issues as currently demonstrated on sandbox


![image](https://github.com/user-attachments/assets/ad14db22-114d-4de2-b952-722df9ae84a4)

This is a companion piece to #7972
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants