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

54256 re fix empty api token 2019.2.1 #54388

Merged
merged 2 commits into from Sep 3, 2019

Conversation

@dwoz
Copy link
Contributor

commented Sep 3, 2019

Rebased #54325 and fixed linter errors.

What does this PR do?
#54324 to 2019.2.1 - Deletes eauth token files if they're empty (or otherwise fail to be read)

What issues does this PR fix or reference?
#54256
#37945

Previous Behavior
If the token file was empty or we otherwise failed to deserialize the token it would cause an exception. This was a regression.

New Behavior
If the token file is empty or we otherwise fail to deserialize the token we delete the invalid token file.

Tests written?
Yes - not just ones to cover this regression, but also added a couple more to cover this whole function.

Commits signed with GPG?
Yes

@dwoz dwoz requested a review from saltstack/team-core as a code owner Sep 3, 2019
@pull-assigner pull-assigner bot requested a review from Akm0d Sep 3, 2019
@dwoz dwoz force-pushed the dwoz:54256-re-fix-empty-api-token-2019.2.1 branch from 6be2892 to b2c7c4e Sep 3, 2019
waynew and others added 2 commits Aug 27, 2019
Under the following conditions and API token should be considered
invalid:

- The file is empty.
- We cannot deserialize the token from the file.
- The token exists but has no expiration date.
- The token exists but has expired.

All of these conditions necessitate deleting the token file. Otherwise
we should simply return an empty token.
@dwoz dwoz force-pushed the dwoz:54256-re-fix-empty-api-token-2019.2.1 branch from b2c7c4e to 80651d3 Sep 3, 2019
@Ch3LL
Ch3LL approved these changes Sep 3, 2019
@dwoz dwoz added the WarRoom label Sep 3, 2019
@dwoz dwoz merged commit 730a007 into saltstack:2019.2.1 Sep 3, 2019
10 of 24 checks passed
10 of 24 checks passed
ci/py2/amazon2 This commit is being built
Details
ci/py2/centos6 This commit is being built
Details
ci/py2/centos7 This commit is being built
Details
ci/py2/centos7/tcp This commit is being built
Details
ci/py2/fedora29 This commit is being built
Details
ci/py2/windows2016 This commit is being built
Details
ci/py3/amazon2 This commit is being built
Details
ci/py3/centos7 This commit is being built
Details
ci/py3/centos7/tcp This commit is being built
Details
ci/py3/debian9 This commit is being built
Details
ci/py3/fedora29 This commit is being built
Details
ci/py3/ubuntu1604 This commit is being built
Details
ci/py3/ubuntu1604/tcp This commit is being built
Details
ci/py3/windows2016 This commit is being built
Details
WIP Ready for review
Details
ci/docs This commit looks good
Details
ci/lint This commit looks good
Details
ci/py2/debian8 This commit looks good
Details
ci/py2/debian9 This commit looks good
Details
ci/py2/ubuntu1604 This commit looks good
Details
ci/py2/ubuntu1604/tcp This commit looks good
Details
ci/py2/ubuntu1804 This commit looks good
Details
ci/py3/debian8 This commit looks good
Details
ci/py3/ubuntu1804 This commit looks good
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.