From 6061d5d5215e97d18a958f1d533236986b326735 Mon Sep 17 00:00:00 2001 From: acsbendi Date: Tue, 2 Jul 2019 18:03:00 +0200 Subject: [PATCH] Introduced environment variable to delay the start of authorization. --- moto/core/responses.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/moto/core/responses.py b/moto/core/responses.py index 4a3b3a1b..1cc1511e 100644 --- a/moto/core/responses.py +++ b/moto/core/responses.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals +import os from collections import defaultdict import datetime import json @@ -107,14 +108,14 @@ class _TemplateEnvironmentMixin(object): class ActionAuthenticatorMixin(object): - INITIALIZATION_STEP_COUNT = 5 + INITIAL_NO_AUTH_ACTION_COUNT = int(os.environ.get("INITIAL_NO_AUTH_ACTION_COUNT", 999999999)) request_count = 0 def _authenticate_action(self): iam_request = IAMRequest(method=self.method, path=self.path, data=self.querystring, headers=self.headers) iam_request.check_signature() - if ActionAuthenticatorMixin.request_count >= ActionAuthenticatorMixin.INITIALIZATION_STEP_COUNT: + if ActionAuthenticatorMixin.request_count >= ActionAuthenticatorMixin.INITIAL_NO_AUTH_ACTION_COUNT: iam_request.check_action_permitted() else: ActionAuthenticatorMixin.request_count += 1