Skip to content

fix: Reuse HMAC key as we have a limit of 5 #3037

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

Merged
merged 8 commits into from
Mar 5, 2020
Merged

Conversation

crwilcox
Copy link
Contributor

@crwilcox crwilcox commented Mar 5, 2020

We are limited to a low number (5) hmac keys for a single project. To avoid exhausting this under test this will reuse that key and depend on the test order (a bit) to keep our count down. Fixes #2822

@crwilcox crwilcox requested a review from a team as a code owner March 5, 2020 18:02
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 5, 2020
@@ -35,8 +36,7 @@
SERVICE_ACCOUNT_EMAIL = os.environ["HMAC_KEY_TEST_SERVICE_ACCOUNT"]
STORAGE_CLIENT = storage.Client(project=PROJECT_ID)


@pytest.fixture
@pytest.fixture(scope="module")
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this correct the fixture once for the entire test suite? If test_delete_key is ran first then it would be deleted for all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With the way we have things configured, within the module these will run in order. Yes, if delete is run first, the key will be gone for our tests. So this change makes the order significant.

@crwilcox
Copy link
Contributor Author

crwilcox commented Mar 5, 2020

Python 2.7 Failure isn't HMAC 👍

Copy link
Contributor

@frankyn frankyn left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for addressing my comment.

@crwilcox crwilcox merged commit cbbf5de into master Mar 5, 2020
@crwilcox crwilcox deleted the reuse-hmac-key branch March 5, 2020 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

storage.cloud-client.hmac_samples_test: test_create_key failed
5 participants