Skip to content

feat(ssh-keygen): sync -O options with openssh 8.4p1, FIDO arg fixes #674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions completions/ssh-keygen
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ _ssh_keygen()
no-x11-forwarding permit-agent-forwarding
permit-port-forwarding permit-pty permit-user-rc
permit-X11-forwarding no-touch-required source-address=
verify-required

lines= start-line= checkpoint= memory= start= generator=

application challenge= device resident user
write-attestation-path
application= challenge= device= no-touch-required resident
user= write-attestation=
' -- "$cur"))
[[ ${COMPREPLY-} == *[:=] ]] && compopt -o nospace
__ltrim_colon_completions "$cur"
Expand All @@ -80,10 +81,17 @@ _ssh_keygen()
compopt -o filenames
COMPREPLY=($(compgen -c -- "${cur#*=}"))
;;
checkpoint=* | challenge=*)
checkpoint=* | challenge=* | write-attestation=*)
cur=${cur#*=}
_filedir
;;
application=*([^:=]))
COMPREPLY=($(compgen -W "ssh:" -- "${cur#*=}"))
compopt -o nospace
;;
user=*)
COMPREPLY=($(compgen -u -- "${cur#*=}"))
;;
esac
fi
return
Expand Down
16 changes: 16 additions & 0 deletions test/t/test_ssh_keygen.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,19 @@ def test_O_force_command(self, completion):
@pytest.mark.complete("ssh-keygen -O unknown=")
def test_O_unknown(self, completion):
assert not completion

@pytest.mark.complete("ssh-keygen -O application=")
def test_O_application(self, completion):
assert completion == "ssh:"

@pytest.mark.complete("ssh-keygen -O application=s")
def test_O_application_s(self, completion):
assert completion == "sh:"

@pytest.mark.complete("ssh-keygen -O application=ssh:")
def test_O_application_ssh_colon(self, completion):
assert not completion

@pytest.mark.complete("ssh-keygen -O application=nonexistent")
def test_O_application_nonexistent(self, completion):
assert not completion