Rename pw to bypass

This commit is contained in:
Kovid Goyal 2021-09-19 17:21:57 +05:30
parent 1d1d82ca50
commit 1036132838
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 4 deletions

View File

@ -53,7 +53,7 @@ def parse_transfer_args(args: List[str]) -> Tuple[TransferCLIOptions, List[str]]
)
def read_password(loc: str) -> str:
def read_bypass(loc: str) -> str:
if not loc:
return ''
if loc.isdigit() and int(loc) >= 0 and int(loc) < 256:
@ -72,7 +72,7 @@ def read_password(loc: str) -> str:
def main(args: List[str]) -> None:
cli_opts, items = parse_transfer_args(args)
if cli_opts.permissions_bypass:
cli_opts.permissions_bypass = read_password(cli_opts.permissions_bypass).strip()
cli_opts.permissions_bypass = read_bypass(cli_opts.permissions_bypass).strip()
if not items:
raise SystemExit('Usage: kitty +kitten transfer file_or_directory ...')

View File

@ -26,9 +26,9 @@ EXPIRE_TIME = 10 # minutes
MAX_ACTIVE_RECEIVES = 10
def encode_bypass(request_id: str, pw: str) -> str:
def encode_bypass(request_id: str, bypass: str) -> str:
import hashlib
q = request_id + ';' + pw
q = request_id + ';' + bypass
return 'sha256:' + hashlib.sha256(q.encode('utf-8', 'replace')).hexdigest()