@@ -66,17 +66,17 @@ def __huge_warning(text: str) -> None:
66
66
@staticmethod
67
67
def __get_auth (args : argparse .Namespace , environment : Mapping [str , str ]) -> TodoistAuth :
68
68
def get_credential (opt_file : Optional [str ], opt_direct : Optional [str ],
69
- env_var : str , prompt : str , sensitive : bool ) -> str :
69
+ env_var : str , prompt : str ) -> str :
70
70
if opt_file :
71
- if sensitive and os .name == "posix" : # OpenSSH-like check
71
+ if os .name == "posix" : # OpenSSH-like check
72
72
file_stat = os .stat (opt_file )
73
73
if file_stat .st_uid == os .getuid () and file_stat .st_mode & 0o077 != 0 :
74
74
ConsoleFrontend .__huge_warning (
75
75
f"WARNING: Reading credentials from file { opt_file } "
76
76
"accessible by other users is deprecated." )
77
77
return Path (opt_file ).read_text ('utf-8' )
78
78
79
- if sensitive and opt_direct :
79
+ if opt_direct :
80
80
ConsoleFrontend .__huge_warning (
81
81
"WARNING: Passing credentials through the command line is deprecated.\n "
82
82
f" Pass it through the { env_var } environment variable,\n "
@@ -85,14 +85,14 @@ def get_credential(opt_file: Optional[str], opt_direct: Optional[str],
85
85
86
86
if env_var in environment :
87
87
return environment [env_var ]
88
- return getpass .getpass (prompt + ": " ) if sensitive else input ( prompt + ": " )
88
+ return getpass .getpass (prompt + ": " )
89
89
90
90
for deprecated_env in ("TODOIST_EMAIL" , "TODOIST_PASSWORD" ):
91
91
if deprecated_env in environment :
92
92
print (f"WARNING: The { deprecated_env } environment variable is no longer necessary" )
93
93
94
94
token = get_credential (args .token_file , args .token , "TODOIST_TOKEN" ,
95
- "Todoist token (from https://todoist.com/app/settings/integrations/developer)" , sensitive = True )
95
+ "Todoist token (from https://todoist.com/app/settings/integrations/developer)" )
96
96
return TodoistAuth (token )
97
97
98
98
def handle_download (self , args : argparse .Namespace , environment : Mapping [str , str ]) -> None :
0 commit comments