[QUO-1390] allow for multiple api_keys#92
Merged
waldnzwrld merged 2 commits intomainfrom Apr 29, 2025
Merged
Conversation
QUO-1390 Client uses old JWT if users switch API keys across accounts
We came across an issue #ext-hark-quotient where a user (drexmcarthur) used an API key to send logs, and then switched to a different account (devsendhark) and set a new API key. Then they sent logs and they would not show up in the new account. This is likely due to the fact we write a JWT the first time, and so we were likely using the first JWT for the second user |
freddiev4
previously approved these changes
Apr 29, 2025
freddiev4
approved these changes
Apr 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We ran into a situation where a user is hot swapping accounts.
Should we even allow this? How do we manage billing and limits if we allow user hotswapping from a single IP?
Ignoring the question above for now, This Pull request allows for multiple API_KEYs to be used from a single machine, by naming jwt's with the last 6 of the key and bolstering the validity checks to determine if the jwt in question is the same as the one in use.
We need to know if the user is then hotswapping the keys programmatically or if they are pausing and reloading the agent etc.
If they are programmatically hotswapping, then we will also need to modify the behaviour to re-authenticate instead of just reaching out to modal since the authetication only occurs at initialisation.
There is actually a lot to take in here regarding the user experience we want to provide, the ways in which we enforce billing, and the behaviour needed to fully tackle the jwt state management of the localised agent