@@ -80,11 +80,7 @@ def save_api_token(self, api_token: ApiToken):
8080 def _build_login_url (self , code_challenge : str , session_id : str ):
8181 app_url = self .configuration_manager .get_cycode_app_url ()
8282 login_url = f'{ app_url } /account/sign-in'
83- query_params = {
84- 'source' : 'cycode_cli' ,
85- 'code_challenge' : code_challenge ,
86- 'session_id' : session_id
87- }
83+ query_params = {'source' : 'cycode_cli' , 'code_challenge' : code_challenge , 'session_id' : session_id }
8884 # TODO(MarshalX). Use auth_client instead and don't depend on "requests" lib here
8985 request = Request (url = login_url , params = query_params )
9086 return request .prepare ().url
@@ -95,9 +91,12 @@ def _generate_pkce_code_pair(self) -> (str, str):
9591 return code_challenge , code_verifier
9692
9793 def _is_api_token_process_completed (self , api_token_polling_response : ApiTokenGenerationPollingResponse ) -> bool :
98- return api_token_polling_response is not None \
99- and api_token_polling_response .status == self .COMPLETED_POLLING_STATUS
94+ return (
95+ api_token_polling_response is not None
96+ and api_token_polling_response .status == self .COMPLETED_POLLING_STATUS
97+ )
10098
10199 def _is_api_token_process_failed (self , api_token_polling_response : ApiTokenGenerationPollingResponse ) -> bool :
102- return api_token_polling_response is not None \
103- and api_token_polling_response .status == self .FAILED_POLLING_STATUS
100+ return (
101+ api_token_polling_response is not None and api_token_polling_response .status == self .FAILED_POLLING_STATUS
102+ )
0 commit comments