And end user may have more than one ssh key, the userkey create
command should be able to accept more than one key so you can do
something like:
curl https://github.com/USER.keys | ssh sshportal -p 2222 -l admin userkey create USER
The userkey create command also does not work properly from an
interactive shell due to the use of bufio. This patch adds the
ability to use either the interactive shell or direct ssh command to
input one or more keys.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Postgres is more picky about submitting a string to the id column in a
table. Postgres requires the use of only integers for the array of
values in a select statement containing: where id IN (...array...)
This patch fixes all the following class of problems:
SELECT * FROM "ssh_keys" WHERE
"ssh_keys"."deleted_at" IS NULL AND ((id IN ('host')) OR (name IN
('host'))) ORDER BY "ssh_keys"."id" ASC LIMIT 1 [0 rows affected or
returned ] error: pq: invalid input syntax for
type integer: "host"
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
If the invite leaks for the admin user it is possible for the admin
user to be compromised by another invite request. It needs to be
possible to entirely remove the invite capability for any given user.
New arguments added to user update:
--invite_token value, -i value Updates the invite token
--remove_invite, -R Remove invite token
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
The userkey rm command implies that it can remove a key by user or the
id key, but it only works against the data base id of the key. This
patch allows the userkey rm command to work with the user name, so
that all the keys for the user can be cleared out in one command.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
The most simple case with a fresh install of sshportal using the
following commands put the shell into a unrecoverable state.
config> host create test1@test1
1
config> host inspect 1
config> host create test2@test2
error: can't preload field Groups for dbmodels.SSHKey
The issue is caused because the global db handle is replaced with the
inspect command.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Make RSA keys use value from --length parameter.
Set default length when --length is unspecified based on key type.
Change default key format to ed25519 both in shell and for keys created
at initialization.