-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.go
35 lines (31 loc) · 814 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import (
"log"
"github.com/binxio/simple-iap-proxy/client"
"github.com/binxio/simple-iap-proxy/cmd"
"github.com/binxio/simple-iap-proxy/gkeserver"
"github.com/spf13/cobra"
)
func newRootCmd() *cmd.RootCommand {
c := cmd.RootCommand{
Command: cobra.Command{
Use: "simple-iap-proxy",
Short: "A simple proxy to forward requests over the Google Identity Aware Proxy",
Long: `
This is a simple IAP proxy. It will intercept the required HTTPS request and
inject the IAP proxy authorization header.
`,
},
}
c.AddPersistentFlags()
c.AddCommand(cmd.NewGenerateCertificateCmd())
c.AddCommand(client.NewClientCmd())
c.AddCommand(gkeserver.NewGKEServerCmd())
return &c
}
func main() {
cmd := newRootCmd()
if err := cmd.Execute(); err != nil {
log.Fatalf("ERROR: %s", err)
}
}