Rename pw to bypass
This commit is contained in:
@@ -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 ...')
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user