Add user-auth plugin trigger

This plugin trigger should allow users to pair down the available commands for a given user. While this does not affect help output - or any output at all - this is a good first step in allowing administrative access to certain commands while still allowing users to deploy/manage given applications.

Note that because of how dokku works, all parsing of commands must be done within the pluginhook, and we cannot give visibility into the actual command or application that will be affected by a given run.
This commit is contained in:
Jose Diaz-Gonzalez
2015-11-08 15:36:04 -05:00
parent 0eab678fcc
commit fc125d41e8
3 changed files with 56 additions and 0 deletions

View File

@@ -346,3 +346,12 @@ get_available_port() {
fi
done
}
dokku_auth() {
export SSH_USER=${SSH_USER:=$USER}
export SSH_NAME=${NAME:="default"}
if ! plugn trigger user-auth $SSH_USER $SSH_NAME "$@" ; then
return 1
fi
return 0
}