Example #1
0
func (config *Config) checkValidAuth() error {
	authConfig := config.OptionalString("auth", "")
	mode, err := auth.FromConfig(authConfig)
	if err == nil {
		auth.SetMode(mode)
	}
	return err
}
Example #2
0
func main() {
	flag.Parse()

	mode, err := auth.FromEnv()
	if err != nil {
		log.Fatal(err)
	}
	auth.SetMode(mode)

	ws := webserver.New()
	ws.HandleFunc("/", handleRoot)
	ws.HandleFunc("/camli/sig/", handleCamliSig)
	ws.Serve()
}