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: encrypted key regex tests will no longer be stateful #607

Merged
merged 3 commits into from
Jun 28, 2022

Conversation

RodEsp
Copy link
Contributor

@RodEsp RodEsp commented Jun 27, 2022

What does this PR do?

Removes the /g flag from the encryptedKeys regexes so that when they are tested against the properties in an auth file they will match regardless of whether they have matched a property beforehand (as is the case when 'accessToken' is tested before 'refreshToken' in the same auth file)

Fixes forcedotcom/cli#1314
@W-11349782@

This removes the /g flag from the encryptedKeys regexes so that when they are tested against the properties in an auth file they will match regardless of whether they have matched a property beforehand (as is the case with /token/.test('accessToken') and /token/.test('refreshToken'))
@RodEsp RodEsp requested review from shetzel and a team June 27, 2022 22:19
@RodEsp RodEsp changed the title Re/encrypted tokens fix: encrypted key regex tests will no longer be stateful Jun 27, 2022
@shetzel
Copy link
Contributor

shetzel commented Jun 28, 2022

I tested without the change using the force:org:list command and some unencrypted refreshTokens within auth files. I saw it fail (InvalidEncryptedFormatError and failed to refresh the token). I tested with the change and it succeeded. I invalidated all sessions to an org and ran the command again and it succeeded.

@shetzel shetzel merged commit 03b55b8 into v3 Jun 28, 2022
@shetzel shetzel deleted the re/encrypted_tokens branch June 28, 2022 23:06
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.

3 participants