From cc44e53168e8f3c0fe0a765a8b5d1a33a7d01a51 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Mon, 24 Jan 2022 07:44:06 +0800 Subject: [PATCH] Fix typos --- adal/authentication_context.py | 2 +- adal/cache_driver.py | 2 +- adal/oauth2_client.py | 2 +- adal/wstrust_response.py | 4 ++-- pylintrc | 2 +- tests/test_authentication_parameters.py | 2 +- tests/test_client_credentials.py | 8 ++++---- tests/test_username_password.py | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/adal/authentication_context.py b/adal/authentication_context.py index 5a4faa27..4c540dc9 100644 --- a/adal/authentication_context.py +++ b/adal/authentication_context.py @@ -79,7 +79,7 @@ def __init__( :param verify_ssl: (optional) requests verify. Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use. If this value is not provided, and - ADAL_PYTHON_SSL_NO_VERIFY env varaible is set, behavior is equivalent to + ADAL_PYTHON_SSL_NO_VERIFY env variable is set, behavior is equivalent to verify_ssl=False. :param proxies: (optional) requests proxies. Dictionary mapping protocol to the URL of the proxy. See http://docs.python-requests.org/en/master/user/advanced/#proxies diff --git a/adal/cache_driver.py b/adal/cache_driver.py index 457cc19e..00c9e517 100644 --- a/adal/cache_driver.py +++ b/adal/cache_driver.py @@ -35,7 +35,7 @@ from .constants import TokenResponseFields, Misc from . import log -#surppress warnings: like accces to a protected member of "_AUTHORITY", etc +#surppress warnings: like access to a protected member of "_AUTHORITY", etc # pylint: disable=W0212 def _create_token_hash(token): diff --git a/adal/oauth2_client.py b/adal/oauth2_client.py index a4aa7645..e17e9b76 100644 --- a/adal/oauth2_client.py +++ b/adal/oauth2_client.py @@ -230,7 +230,7 @@ def _validate_device_code_response(self, body): if not wire_response.get(OAuth2.DeviceCodeResponseParameters.USER_CODE): raise AdalError('wire_response is missing user_code', wire_response) - #skip field naming tweak, becasue names from wire are python style already + #skip field naming tweak, because names from wire are python style already return wire_response def _handle_get_token_response(self, body): diff --git a/adal/wstrust_response.py b/adal/wstrust_response.py index 42bc924c..aa365e40 100644 --- a/adal/wstrust_response.py +++ b/adal/wstrust_response.py @@ -75,7 +75,7 @@ def findall_content(xml_string, tag): (https://www.w3.org/TR/xml-exc-c14n/), and void the SAML token signature. SAML signature algo needs the "XML -> C14N(XML) -> Signed(C14N(Xml))" order. - The binary extention lxml is probably the canonical way to solve this + The binary extension lxml is probably the canonical way to solve this (https://stackoverflow.com/questions/22959577/python-exclusive-xml-canonicalization-xml-exc-c14n) but here we use this workaround, based on Regex, to return raw content as-is. """ @@ -140,7 +140,7 @@ def _parse_error(self): error_found = True # Subcode has minoccurs=0 and maxoccurs=1(default) according to the http://www.w3.org/2003/05/soap-envelope - # Subcode may have another subcode as well. This is only targetting at top level subcode. + # Subcode may have another subcode as well. This is only targeting at top level subcode. # Subcode value may have different messages not always uses http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd. # text inside the value is not possible to select without prefix, so substring is necessary subnode = xmlutil.xpath_find(self._dom, 's:Body/s:Fault/s:Code/s:Subcode/s:Value') diff --git a/pylintrc b/pylintrc index 87664a9d..923da8d6 100644 --- a/pylintrc +++ b/pylintrc @@ -36,7 +36,7 @@ reports=yes # Python expression which should return a note less than 10 (10 is the highest # note).You have access to the variables errors warning, statement which -# respectivly contain the number of errors / warnings messages and the total +# respectively contain the number of errors / warnings messages and the total # number of statements analyzed. This is used by the global evaluation report # (R0004). evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) diff --git a/tests/test_authentication_parameters.py b/tests/test_authentication_parameters.py index 60421ace..da113dc3 100644 --- a/tests/test_authentication_parameters.py +++ b/tests/test_authentication_parameters.py @@ -167,7 +167,7 @@ def test_create_from_header(self): 'Bearer authorization_uri=foobar,lkfj,;l,", resource="clark, &^()- q32,shark",fruitcake="f" a, f="foo"', None ], - # Mispell Bearer + # Misspell Bearer [ 'Berer authorization_uri=foobar,lkfj,;l,", resource="clark, &^()- q32,shark",fruitcake="f" , f="foo"', None diff --git a/tests/test_client_credentials.py b/tests/test_client_credentials.py index 8ae8562d..e5609d84 100644 --- a/tests/test_client_credentials.py +++ b/tests/test_client_credentials.py @@ -85,7 +85,7 @@ def test_oauth_error(self): @httpretty.activate def test_error_with_junk_return(self): - junkResponse = 'This is not properly formated return value.' + junkResponse = 'This is not properly formatted return value.' tokenRequest = util.setup_expected_client_cred_token_request_response(400, junkResponse) @@ -96,7 +96,7 @@ def test_error_with_junk_return(self): @httpretty.activate def test_success_with_junk_return(self): - junkResponse = 'This is not properly formated return value.' + junkResponse = 'This is not properly formatted return value.' tokenRequest = util.setup_expected_client_cred_token_request_response(200, junkResponse) @@ -111,7 +111,7 @@ def test_no_cached_token_found_error(self): try: context.acquire_token(cp['resource'], 'unknownUser', cp['clientId']) except Exception as err: - self.assertTrue(err, 'Expected an error and non was recieved.') + self.assertTrue(err, 'Expected an error and non was received.') self.assertIn('not found', err.args[0], 'Returned error did not contain expected message: ' + err.args[0]) @@ -143,7 +143,7 @@ def reset_self_signed_jwt_stubs(safe_proto): @httpretty.activate def test_cert_happy_path(self): ''' TODO: Test Failing as of 2015/06/03 and needs to be completed. ''' - self.fail("Not Yet Impelemented. Add Helper Functions and setup method") + self.fail("Not Yet Implemented. Add Helper Functions and setup method") saveProto = updateSelfSignedJwtStubs() responseOptions = { noRefresh : true } diff --git a/tests/test_username_password.py b/tests/test_username_password.py index 2834c573..a223157f 100644 --- a/tests/test_username_password.py +++ b/tests/test_username_password.py @@ -169,7 +169,7 @@ def test_federated_happy_path_and_correlation_id(self): #assert log_content = buffer.getvalue() - self.assertTrue(correlation_id in log_content, 'Logging was turned on but no messages were recieved.') + self.assertTrue(correlation_id in log_content, 'Logging was turned on but no messages were received.') self.assertNotIn(cp['clientId'], log_content, "Should not log ClientID") self.assertNotIn( @@ -508,7 +508,7 @@ def test_jwt_cracking(self): 'notsupposedtobehere.eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJhdWQiOiJ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GFhIiwidXBuIjoicnJhbmRhbGxAcnJhbmRhbGxhYWQxLm9ubWljcm9zb2Z0LmNvbSIsInVuaXF1ZV9uYW1lIjoicnJhbmRhbGxAcnJhbmRhbGxhYWQxLm9ubWljcm9zb2Z0LmNvbSIsInN1YiI6IjRnVHY0RXRvWVctRFRvdzBiRG5KZDFBQTRzZkNoQmJqZXJtcXQ2UV9aYTQiLCJmYW1pbHlfbmFtZSI6IlJhbmRhbGwiLCJnaXZlbl9uYW1lIjoiUmljaCJ9.foobar', None