예제 #1
0
파일: command.go 프로젝트: ACPK/atc
func (cmd *ATCCommand) constructWebHandler(
	logger lager.Logger,
	sqlDB *db.SQLDB,
	authValidator auth.Validator,
	pipelineDBFactory db.PipelineDBFactory,
	engine engine.Engine,
) (http.Handler, error) {
	webWrapper := wrappa.MultiWrappa{
		wrappa.NewWebAuthWrappa(cmd.PubliclyViewable, authValidator),
		wrappa.NewWebMetricsWrappa(logger),
	}

	clientFactory := web.NewClientFactory(
		fmt.Sprintf("http://127.0.0.1:%d", cmd.BindPort),
	)

	return webhandler.NewHandler(
		logger,
		webWrapper,
		sqlDB,
		pipelineDBFactory,
		sqlDB,
		cmd.TemplatesDir.Path(),
		cmd.PublicDir.Path(),
		engine,
		clientFactory,
	)
}
예제 #2
0
파일: command.go 프로젝트: xoebus/checkin
func (cmd *ATCCommand) constructWebHandler(
	logger lager.Logger,
	authValidator auth.Validator,
	userContextReader auth.UserContextReader,
	pipelineDBFactory db.PipelineDBFactory,
) (http.Handler, error) {
	webWrapper := wrappa.MultiWrappa{
		wrappa.NewWebAuthWrappa(authValidator, userContextReader),
		wrappa.NewWebMetricsWrappa(logger),
	}

	clientFactory := web.NewClientFactory(
		fmt.Sprintf("http://127.0.0.1:%d", cmd.BindPort),
	)

	return webhandler.NewHandler(
		logger,
		webWrapper,
		clientFactory,
	)
}