Rename pw to bypass
This commit is contained in:
parent
1d1d82ca50
commit
1036132838
@ -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:
|
if not loc:
|
||||||
return ''
|
return ''
|
||||||
if loc.isdigit() and int(loc) >= 0 and int(loc) < 256:
|
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:
|
def main(args: List[str]) -> None:
|
||||||
cli_opts, items = parse_transfer_args(args)
|
cli_opts, items = parse_transfer_args(args)
|
||||||
if cli_opts.permissions_bypass:
|
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:
|
if not items:
|
||||||
raise SystemExit('Usage: kitty +kitten transfer file_or_directory ...')
|
raise SystemExit('Usage: kitty +kitten transfer file_or_directory ...')
|
||||||
|
|||||||
@ -26,9 +26,9 @@ EXPIRE_TIME = 10 # minutes
|
|||||||
MAX_ACTIVE_RECEIVES = 10
|
MAX_ACTIVE_RECEIVES = 10
|
||||||
|
|
||||||
|
|
||||||
def encode_bypass(request_id: str, pw: str) -> str:
|
def encode_bypass(request_id: str, bypass: str) -> str:
|
||||||
import hashlib
|
import hashlib
|
||||||
q = request_id + ';' + pw
|
q = request_id + ';' + bypass
|
||||||
return 'sha256:' + hashlib.sha256(q.encode('utf-8', 'replace')).hexdigest()
|
return 'sha256:' + hashlib.sha256(q.encode('utf-8', 'replace')).hexdigest()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user