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

[VEG-2359] - drop support for password based basic auth #238

Merged
merged 9 commits into from
Jul 16, 2024

Conversation

romeodemeteriojr
Copy link
Contributor

@romeodemeteriojr romeodemeteriojr commented Jul 3, 2024

Description

Basic authentication with password is no longer supported as per doc, channel.

This PR drops support for login with password, now replaced with api token.

There is also a fix added that addresses inconsistent behaviour of zcli when envs are used for auth. See commit 46e478a

Screenshot

Screen.Recording.2024-07-04.at.9.56.06.AM.mov

References

JIRA: https://zendesk.atlassian.net/browse/VEG-2359

Commits

b94702f chore: ignore intellij files

415b5e1 feat: change login to use api token

e4eb869 fix: fix unit and functional tests

e0c2aaa feat: replace term password with secret To keep things generic. However, we can't change the keytar interface as these fucntion names are library requirements.

2d3fcbb lint: fix lint errors

97f6ce9 feat: update help message to refer only the api token

7d1f234 fix: inconsistent behaviour when ZENDESK_DOMAIN env is set When ZENDESK_DOMAIN and ZENDESK_SUBDOMAIN are not set, domain is taken from an active profile. This works just fine. However when domain is taken from the env, the request sends a corrupted payload and server responds with 400. This is a workaround to make the function behave consistently whether env or profile is being used.

ab1788b test: fix test to actually test env & profile

5672642 test: separate request creation from execution for easier testing

Detail

Checklist

  • 💂‍♂️ includes new unit and functional tests

} else if (ZENDESK_EMAIL && ZENDESK_PASSWORD) {
return this.createBasicAuthToken(ZENDESK_EMAIL, ZENDESK_PASSWORD)
return this.createBasicAuthToken(ZENDESK_EMAIL, ZENDESK_PASSWORD, SecretType.PASSWORD)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This check is kept for those users that still only have ZENDESK_PASSWORD in their systems (e.g. cicd, local, etc) to properly fire an error that it is not supported.

@romeodemeteriojr romeodemeteriojr force-pushed the rdemeterio/VEG-2359 branch 2 times, most recently from bcfde4f to fda2298 Compare July 3, 2024 08:30
@romeodemeteriojr romeodemeteriojr marked this pull request as ready for review July 3, 2024 08:36
@romeodemeteriojr romeodemeteriojr requested review from a team as code owners July 3, 2024 08:36
Copy link

@EmilyBie EmilyBie left a comment

Choose a reason for hiding this comment

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

Just a few nitpicks from my understanding.

packages/zcli-core/src/lib/secureStore.ts Show resolved Hide resolved
packages/zcli-core/src/lib/auth.test.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@JeanMarcGoepfert JeanMarcGoepfert left a comment

Choose a reason for hiding this comment

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

👏

@romeodemeteriojr romeodemeteriojr force-pushed the rdemeterio/VEG-2359 branch 2 times, most recently from e52b660 to dcb4647 Compare July 9, 2024 00:58
Copy link
Contributor

@luis-almeida luis-almeida left a comment

Choose a reason for hiding this comment

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

Does it make sense to keep the -i flag on the zcli login command?
It seems like it will be the only possible option as browser login will be impossible from now on (?)

👍🏼 from Vikings nonetheless!

@romeodemeteriojr
Copy link
Contributor Author

romeodemeteriojr commented Jul 10, 2024

Does it make sense to keep the -i flag on the zcli login command? It seems like it will be the only possible option as browser login will be impossible from now on (?)

👍🏼 from Vikings nonetheless!

👋 @luis-almeida, yes we are keeping the -i flag for zcli login

@romeodemeteriojr romeodemeteriojr force-pushed the rdemeterio/VEG-2359 branch 10 times, most recently from 1eac8af to 6b67aa8 Compare July 10, 2024 05:43
To keep things generic. However, we can't change the keytar interface as these fucntion names are library requirements.
When ZENDESK_DOMAIN and ZENDESK_SUBDOMAIN are not set, domain is taken from an active profile. This works just fine. However when domain is taken from the env, the request sends a corrupted payload and server responds with 400. This is a workaround to make the function behave consistently whether env or profile is being used.
@romeodemeteriojr romeodemeteriojr merged commit 6f9d18a into master Jul 16, 2024
4 checks passed
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.

6 participants