refactor: remove ssh-keys user-auth trigger in favor of direct check in dokku binary

This commit is contained in:
Jose Diaz-Gonzalez
2019-09-20 01:25:42 -04:00
parent 3b3fc5d5c1
commit 9c68cd53fc
2 changed files with 2 additions and 16 deletions

View File

@@ -1,14 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
check_ssh_keys_user() {
declare desc="check user passed by user-auth for ssh-keys plugin"
local SSH_USER=$1 SSH_NAME=$2
[[ "$SSH_USER" == "root" || "$SSH_NAME" == *admin* ]] || dokku_log_fail "You must be root, or a dokku admin, to execute this command"
}
if [[ "$3" =~ (ssh-keys:add|ssh-keys:remove) ]]; then
check_ssh_keys_user "$@"
fi