implemented simple ssh dual control

This commit is contained in:
ston1th 2025-01-23 00:15:25 +01:00
commit 60012be942
12 changed files with 446 additions and 20 deletions

View file

@ -17,6 +17,7 @@ import (
"git.giftfish.de/ston1th/keyctl/pkg/api"
"git.giftfish.de/ston1th/keyctl/pkg/cli"
"git.giftfish.de/ston1th/keyctl/pkg/db"
"git.giftfish.de/ston1th/keyctl/pkg/ssh"
"github.com/go-logr/logr"
)
@ -41,6 +42,10 @@ func usage() {
keyctl approve - approve a key request (admin)
keyctl reject - reject a key request (admin)
keyctl del - delete a key (admin)
keyctl ssh login - request ssh access
keyctl ssh req - list current ssh requests (admin)
keyctl ssh approve - approve ssh access (admin)
keyctl ssh reject - reject ssh access (admin)
keyctl help - show this usage
`, version)
os.Exit(1)
@ -56,6 +61,11 @@ func main() {
cli.Run(arg) // does not return
case "server":
server() // does not return
case "ssh":
if len(os.Args) < 3 {
usage() // does not return
}
ssh.Run(os.Args[2]) // does not return
default:
usage() // does not return
}