Skip to content

Commit 5c7647f

Browse files
authored
[COST-4807] fix CWE-547 false positive (#5003)
1 parent 2d57ccf commit 5c7647f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

koku/providers/provider_errors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class ProviderErrors:
103103
"The provided client secret keys for this source are expired. "
104104
"In Azure, refresh your client secret and try again."
105105
)
106-
AZURE_INCORRECT_CLIENT_SECRET_MESSAGE = (
106+
AZURE_CLIENT_SECRET_INCORRECT_MESSAGE = (
107107
"A problem has been detected with the Azure client secret for this source. "
108108
"Refer to the Microsoft Azure troubleshooting guide in the cost management documentation for details."
109109
)

koku/sources/sources_error_message.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def azure_client_errors(self, message):
2323
"""Azure client error messages."""
2424
scrubbed_message = ProviderErrors.AZURE_GENERAL_CLIENT_ERROR_MESSAGE
2525
if any(test in message for test in ["http error: 401", "Authentication failed", "(401) Unauthorized"]):
26-
scrubbed_message = ProviderErrors.AZURE_INCORRECT_CLIENT_SECRET_MESSAGE
26+
scrubbed_message = ProviderErrors.AZURE_CLIENT_SECRET_INCORRECT_MESSAGE
2727
if "AADSTS700016" in message:
2828
scrubbed_message = ProviderErrors.AZURE_INCORRECT_CLIENT_ID_MESSAGE
2929
if "AADSTS90002" in message:

koku/sources/test/test_sources_error_message.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,20 @@ def test_azure_errors(self):
5252
{
5353
"key": ProviderErrors.AZURE_CLIENT_ERROR,
5454
"internal_message": ", AdalError: Get Token request returned http error: 401 and server response:",
55-
"expected_message": ProviderErrors.AZURE_INCORRECT_CLIENT_SECRET_MESSAGE,
55+
"expected_message": ProviderErrors.AZURE_CLIENT_SECRET_INCORRECT_MESSAGE,
5656
},
5757
{
5858
"key": ProviderErrors.AZURE_CLIENT_ERROR,
5959
"internal_message": "Authentication failed",
60-
"expected_message": ProviderErrors.AZURE_INCORRECT_CLIENT_SECRET_MESSAGE,
60+
"expected_message": ProviderErrors.AZURE_CLIENT_SECRET_INCORRECT_MESSAGE,
6161
},
6262
{
6363
"key": ProviderErrors.AZURE_CLIENT_ERROR,
6464
"internal_message": (
6565
"(401) Unauthorized. Request ID: cca1a5a4-4107-4e7a-b3b4-b88f31e6a674\n"
6666
"Code: 401\nMessage: Unauthorized. Request ID: cca1a5a4-4107-4e7a-b3b4-b88f31e6a674"
6767
),
68-
"expected_message": ProviderErrors.AZURE_INCORRECT_CLIENT_SECRET_MESSAGE,
68+
"expected_message": ProviderErrors.AZURE_CLIENT_SECRET_INCORRECT_MESSAGE,
6969
},
7070
{
7171
"key": ProviderErrors.AZURE_CLIENT_ERROR,

0 commit comments

Comments
 (0)