func Production()

in ccadb2OneCRL/main.go [140:157]


func Production() (*kinto.Client, error) {
	production := oneCRLProductionDefault
	if os.Getenv(OneCRLProduction) != "" {
		production = os.Getenv(OneCRLProduction)
	}
	c, err := kinto.NewClientFromStr(production)
	if err != nil {
		return nil, errors.Wrap(err, "failed to construct OneCRL production client from URL")
	}
	principal, err := KintoPrincipal(
		os.Getenv(OneCRLProductionUser),
		os.Getenv(OneCRLProductionPassword),
		os.Getenv(OneCRLProductionToken))
	if err != nil {
		return nil, errors.Wrap(err, "failed to set OneCRL production credentials")
	}
	return c.WithAuthenticator(principal), nil
}