-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Conversation
@@ -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") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
…n-docs-samples into reuse-hmac-key
Python 2.7 Failure isn't HMAC 👍 |
There was a problem hiding this 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.
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