Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "minimal-ldap-proxy", Short: "Proxy ldap authentication requests to a database backend", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your application. For example: Cobra is a CLI library for Go that empowers applications. This application is a tool to generate the needed files to quickly create a Cobra application.`, PreRunE: func(cmd *cobra.Command, args []string) error { jww.SetStdoutThreshold(jww.LevelInfo) err := loadConfig() if err != nil { return err } if !util.ContainsString(sql.Drivers(), cmdConfig.Driver) { return fmt.Errorf("%s is not one of the supported drivers: %s", cmdConfig.Driver, strings.Join(sql.Drivers(), ", ")) } return nil }, Run: func(cmd *cobra.Command, args []string) { backend, err := pkg.NewBackend(cmdConfig.Driver, cmdConfig.Conn, cmdConfig.AuthQuery, cmdConfig.SearchQuery) if err != nil { jww.ERROR.Fatalf("Error configuring backend: %v", err) } cert, err := tls.LoadX509KeyPair(cmdConfig.Cert, cmdConfig.Key) if err != nil { jww.ERROR.Fatalf("Error loading tls certificate: %v", err) } frontend := pkg.NewFrontend(cmdConfig.ServerAddress, cert, cmdConfig.BaseDn, cmdConfig.Rdn, cmdConfig.Attributes, backend) frontend.Serve() ch := make(chan os.Signal) signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM) <-ch close(ch) frontend.Stop() }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.