| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739 |
- package router
- import (
- "fmt"
- "github.com/go-chi/chi"
- "github.com/porter-dev/porter/api/server/handlers/environment"
- "github.com/porter-dev/porter/api/server/handlers/gitinstallation"
- "github.com/porter-dev/porter/api/server/shared"
- "github.com/porter-dev/porter/api/server/shared/config"
- "github.com/porter-dev/porter/api/server/shared/router"
- "github.com/porter-dev/porter/api/types"
- )
- func NewGitInstallationScopedRegisterer(children ...*router.Registerer) *router.Registerer {
- return &router.Registerer{
- GetRoutes: GetGitInstallationScopedRoutes,
- Children: children,
- }
- }
- func GetGitInstallationScopedRoutes(
- r chi.Router,
- config *config.Config,
- basePath *types.Path,
- factory shared.APIEndpointFactory,
- children ...*router.Registerer,
- ) []*router.Route {
- routes, projPath := getGitInstallationRoutes(r, config, basePath, factory)
- if len(children) > 0 {
- r.Route(projPath.RelativePath, func(r chi.Router) {
- for _, child := range children {
- childRoutes := child.GetRoutes(r, config, basePath, factory, child.Children...)
- routes = append(routes, childRoutes...)
- }
- })
- }
- return routes
- }
- func getGitInstallationRoutes(
- r chi.Router,
- config *config.Config,
- basePath *types.Path,
- factory shared.APIEndpointFactory,
- ) ([]*router.Route, *types.Path) {
- relPath := "/gitrepos/{git_installation_id}"
- newPath := &types.Path{
- Parent: basePath,
- RelativePath: relPath,
- }
- routes := make([]*router.Route, 0)
- // GET /api/projects/{project_id}/gitrepos/{git_installation_id} -> gitinstallation.NewGitInstallationGetHandler
- getEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbGet,
- Method: types.HTTPVerbGet,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: relPath,
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- },
- },
- )
- getHandler := gitinstallation.NewGitInstallationGetHandler(
- config,
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: getEndpoint,
- Handler: getHandler,
- Router: r,
- })
- // GET /api/projects/{project_id}/gitrepos/{git_installation_id}/permissions -> gitinstallation.NewGithubGetPermissionsHandler
- getPermissionsEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbGet,
- Method: types.HTTPVerbGet,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: relPath + "/permissions",
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- },
- },
- )
- getPermissionsHandler := gitinstallation.NewGithubGetPermissionsHandler(
- config,
- factory.GetDecoderValidator(),
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: getPermissionsEndpoint,
- Handler: getPermissionsHandler,
- Router: r,
- })
- if config.ServerConf.GithubIncomingWebhookSecret != "" {
- // POST /api/projects/{project_id}/gitrepos/{git_installation_id}/{owner}/{name}/clusters/{cluster_id}/environment ->
- // environment.NewCreateEnvironmentHandler
- createEnvironmentEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbCreate,
- Method: types.HTTPVerbPost,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: fmt.Sprintf(
- "%s/{%s}/{%s}/clusters/{cluster_id}/environment",
- relPath,
- types.URLParamGitRepoOwner,
- types.URLParamGitRepoName,
- ),
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- types.ClusterScope,
- types.PreviewEnvironmentScope,
- },
- },
- )
- createEnvironmentHandler := environment.NewCreateEnvironmentHandler(
- config,
- factory.GetDecoderValidator(),
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: createEnvironmentEndpoint,
- Handler: createEnvironmentHandler,
- Router: r,
- })
- // POST /api/projects/{project_id}/gitrepos/{git_installation_id}/{owner}/{name}/clusters/{cluster_id}/deployment ->
- // environment.NewCreateDeploymentHandler
- createDeploymentEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbCreate,
- Method: types.HTTPVerbPost,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: fmt.Sprintf(
- "%s/{%s}/{%s}/clusters/{cluster_id}/deployment",
- relPath,
- types.URLParamGitRepoOwner,
- types.URLParamGitRepoName,
- ),
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- types.ClusterScope,
- types.PreviewEnvironmentScope,
- },
- },
- )
- createDeploymentHandler := environment.NewCreateDeploymentHandler(
- config,
- factory.GetDecoderValidator(),
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: createDeploymentEndpoint,
- Handler: createDeploymentHandler,
- Router: r,
- })
- // GET /api/projects/{project_id}/gitrepos/{git_installation_id}/{owner}/{name}/clusters/{cluster_id}/deployment ->
- // environment.NewGetDeploymentHandler
- getDeploymentEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbGet,
- Method: types.HTTPVerbGet,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: fmt.Sprintf(
- "%s/{%s}/{%s}/clusters/{cluster_id}/deployment",
- relPath,
- types.URLParamGitRepoOwner,
- types.URLParamGitRepoName,
- ),
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- types.ClusterScope,
- types.PreviewEnvironmentScope,
- },
- },
- )
- getDeploymentHandler := environment.NewGetDeploymentHandler(
- config,
- factory.GetDecoderValidator(),
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: getDeploymentEndpoint,
- Handler: getDeploymentHandler,
- Router: r,
- })
- // GET /api/projects/{project_id}/gitrepos/{git_installation_id}/{owner}/{name}/clusters/{cluster_id}/deployments ->
- // environment.NewCreateDeploymentHandler
- listDeploymentsEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbGet,
- Method: types.HTTPVerbGet,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: fmt.Sprintf(
- "%s/{%s}/{%s}/clusters/{cluster_id}/deployments",
- relPath,
- types.URLParamGitRepoOwner,
- types.URLParamGitRepoName,
- ),
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- types.ClusterScope,
- types.PreviewEnvironmentScope,
- },
- },
- )
- listDeploymentsHandler := environment.NewListDeploymentsHandler(
- config,
- factory.GetDecoderValidator(),
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: listDeploymentsEndpoint,
- Handler: listDeploymentsHandler,
- Router: r,
- })
- // POST /api/projects/{project_id}/gitrepos/{git_installation_id}/{owner}/{name}/clusters/{cluster_id}/deployment/finalize ->
- // environment.NewFinalizeDeploymentHandler
- finalizeDeploymentEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbCreate,
- Method: types.HTTPVerbPost,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: fmt.Sprintf(
- "%s/{%s}/{%s}/clusters/{cluster_id}/deployment/finalize",
- relPath,
- types.URLParamGitRepoOwner,
- types.URLParamGitRepoName,
- ),
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- types.ClusterScope,
- types.PreviewEnvironmentScope,
- },
- },
- )
- finalizeDeploymentHandler := environment.NewFinalizeDeploymentHandler(
- config,
- factory.GetDecoderValidator(),
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: finalizeDeploymentEndpoint,
- Handler: finalizeDeploymentHandler,
- Router: r,
- })
- // POST /api/projects/{project_id}/gitrepos/{git_installation_id}/{owner}/{name}/clusters/{cluster_id}/deployment/update ->
- // environment.NewFinalizeDeploymentHandler
- updateDeploymentEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbUpdate,
- Method: types.HTTPVerbPost,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: fmt.Sprintf(
- "%s/{%s}/{%s}/clusters/{cluster_id}/deployment/update",
- relPath,
- types.URLParamGitRepoOwner,
- types.URLParamGitRepoName,
- ),
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- types.ClusterScope,
- types.PreviewEnvironmentScope,
- },
- },
- )
- updateDeploymentHandler := environment.NewUpdateDeploymentHandler(
- config,
- factory.GetDecoderValidator(),
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: updateDeploymentEndpoint,
- Handler: updateDeploymentHandler,
- Router: r,
- })
- // POST /api/projects/{project_id}/gitrepos/{git_installation_id}/{owner}/{name}/clusters/{cluster_id}/deployment/update/status ->
- // environment.NewUpdateDeploymentStatusHandler
- updateDeploymentStatusEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbUpdate,
- Method: types.HTTPVerbPost,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: fmt.Sprintf(
- "%s/{%s}/{%s}/clusters/{cluster_id}/deployment/update/status",
- relPath,
- types.URLParamGitRepoOwner,
- types.URLParamGitRepoName,
- ),
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- types.ClusterScope,
- types.PreviewEnvironmentScope,
- },
- },
- )
- updateDeploymentStatusHandler := environment.NewUpdateDeploymentStatusHandler(
- config,
- factory.GetDecoderValidator(),
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: updateDeploymentStatusEndpoint,
- Handler: updateDeploymentStatusHandler,
- Router: r,
- })
- // POST /api/projects/{project_id}/gitrepos/{git_installation_id}/{owner}/{name}/clusters/{cluster_id}/deployment/finalize_errors ->
- // environment.NewFinalizeDeploymentWithErrorsHandler
- finalizeDeploymentWithErrorsEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbUpdate,
- Method: types.HTTPVerbPost,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: fmt.Sprintf(
- "%s/{%s}/{%s}/clusters/{cluster_id}/deployment/finalize_errors",
- relPath,
- types.URLParamGitRepoOwner,
- types.URLParamGitRepoName,
- ),
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- types.ClusterScope,
- types.PreviewEnvironmentScope,
- },
- },
- )
- finalizeDeploymentWithErrorsHandler := environment.NewFinalizeDeploymentWithErrorsHandler(
- config,
- factory.GetDecoderValidator(),
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: finalizeDeploymentWithErrorsEndpoint,
- Handler: finalizeDeploymentWithErrorsHandler,
- Router: r,
- })
- // DELETE /api/projects/{project_id}/gitrepos/{git_installation_id}/{owner}/{name}/clusters/{cluster_id}/environment ->
- // environment.NewDeleteEnvironmentHandler
- deleteEnvironmentEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbDelete,
- Method: types.HTTPVerbDelete,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: fmt.Sprintf(
- "%s/{%s}/{%s}/clusters/{cluster_id}/environment",
- relPath,
- types.URLParamGitRepoOwner,
- types.URLParamGitRepoName,
- ),
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- types.ClusterScope,
- types.PreviewEnvironmentScope,
- },
- },
- )
- deleteEnvironmentHandler := environment.NewDeleteEnvironmentHandler(
- config,
- factory.GetDecoderValidator(),
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: deleteEnvironmentEndpoint,
- Handler: deleteEnvironmentHandler,
- Router: r,
- })
- }
- // GET /api/projects/{project_id}/gitrepos/{git_installation_id}/repos ->
- // gitinstallation.GithubListReposHandler
- listReposEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbList,
- Method: types.HTTPVerbGet,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: relPath + "/repos",
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- },
- },
- )
- listReposHandler := gitinstallation.NewGithubListReposHandler(
- config,
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: listReposEndpoint,
- Handler: listReposHandler,
- Router: r,
- })
- // GET /api/projects/{project_id}/gitrepos/{installation_id}/repos/{kind}/{owner}/{name}/branches ->
- // gitinstallation.GithubListBranchesHandler
- listBranchesEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbList,
- Method: types.HTTPVerbGet,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: fmt.Sprintf(
- "%s/repos/{%s}/{%s}/{%s}/branches",
- relPath,
- types.URLParamGitKind,
- types.URLParamGitRepoOwner,
- types.URLParamGitRepoName,
- ),
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- },
- },
- )
- listBranchesHandler := gitinstallation.NewGithubListBranchesHandler(
- config,
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: listBranchesEndpoint,
- Handler: listBranchesHandler,
- Router: r,
- })
- // GET /api/projects/{project_id}/gitrepos/{installation_id}/repos/{kind}/{owner}/{name}/{branch}/buildpack/detect ->
- // gitinstallation.NewGithubGetBuildpackHandler
- getBuildpackEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbGet,
- Method: types.HTTPVerbGet,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: fmt.Sprintf(
- "%s/repos/{%s}/{%s}/{%s}/{%s}/buildpack/detect",
- relPath,
- types.URLParamGitKind,
- types.URLParamGitRepoOwner,
- types.URLParamGitRepoName,
- types.URLParamGitBranch,
- ),
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- },
- },
- )
- getBuildpackHandler := gitinstallation.NewGithubGetBuildpackHandler(
- config,
- factory.GetDecoderValidator(),
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: getBuildpackEndpoint,
- Handler: getBuildpackHandler,
- Router: r,
- })
- // GET /api/projects/{project_id}/gitrepos/{installation_id}/repos/{kind}/{owner}/{name}/{branch}/contents ->
- // gitinstallation.NewGithubGetContentsHandler
- getContentsEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbGet,
- Method: types.HTTPVerbGet,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: fmt.Sprintf(
- "%s/repos/{%s}/{%s}/{%s}/{%s}/contents",
- relPath,
- types.URLParamGitKind,
- types.URLParamGitRepoOwner,
- types.URLParamGitRepoName,
- types.URLParamGitBranch,
- ),
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- },
- },
- )
- getContentsHandler := gitinstallation.NewGithubGetContentsHandler(
- config,
- factory.GetDecoderValidator(),
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: getContentsEndpoint,
- Handler: getContentsHandler,
- Router: r,
- })
- // GET /api/projects/{project_id}/gitrepos/{installation_id}/repos/{kind}/{owner}/{name}/{branch}/porteryaml ->
- // gitinstallation.NewGithubGetProcfileHandler
- getPorterYamlEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbGet,
- Method: types.HTTPVerbGet,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: fmt.Sprintf(
- "%s/repos/{%s}/{%s}/{%s}/{%s}/porteryaml",
- relPath,
- types.URLParamGitKind,
- types.URLParamGitRepoOwner,
- types.URLParamGitRepoName,
- types.URLParamGitBranch,
- ),
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- },
- },
- )
- getPorterYamlHandler := gitinstallation.NewGithubGetPorterYamlHandler(
- config,
- factory.GetDecoderValidator(),
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: getPorterYamlEndpoint,
- Handler: getPorterYamlHandler,
- Router: r,
- })
- // GET /api/projects/{project_id}/gitrepos/{installation_id}/repos/{kind}/{owner}/{name}/{branch}/procfile ->
- // gitinstallation.NewGithubGetProcfileHandler
- getProcfileEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbGet,
- Method: types.HTTPVerbGet,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: fmt.Sprintf(
- "%s/repos/{%s}/{%s}/{%s}/{%s}/procfile",
- relPath,
- types.URLParamGitKind,
- types.URLParamGitRepoOwner,
- types.URLParamGitRepoName,
- types.URLParamGitBranch,
- ),
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- },
- },
- )
- getProcfileHandler := gitinstallation.NewGithubGetProcfileHandler(
- config,
- factory.GetDecoderValidator(),
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: getProcfileEndpoint,
- Handler: getProcfileHandler,
- Router: r,
- })
- // GET /api/projects/{project_id}/gitrepos/{installation_id}/repos/{kind}/{owner}/{name}/{branch}/tarball_url ->
- // gitinstallation.NewGithubGetTarballURLHandler
- getTarballURLEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbGet,
- Method: types.HTTPVerbGet,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: fmt.Sprintf(
- "%s/repos/{%s}/{%s}/{%s}/{%s}/tarball_url",
- relPath,
- types.URLParamGitKind,
- types.URLParamGitRepoOwner,
- types.URLParamGitRepoName,
- types.URLParamGitBranch,
- ),
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- },
- },
- )
- getTarballURLHandler := gitinstallation.NewGithubGetTarballURLHandler(
- config,
- factory.GetDecoderValidator(),
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: getTarballURLEndpoint,
- Handler: getTarballURLHandler,
- Router: r,
- })
- // POST /api/projects/{project_id}/gitrepos/{git_installation_id}/{owner}/{name}/clusters/{cluster_id}/rerun_workflow ->
- // gitinstallation.NewRerunWorkflowHandler
- rerunWorkflowEndpoint := factory.NewAPIEndpoint(
- &types.APIRequestMetadata{
- Verb: types.APIVerbUpdate,
- Method: types.HTTPVerbPost,
- Path: &types.Path{
- Parent: basePath,
- RelativePath: fmt.Sprintf(
- "%s/{%s}/{%s}/clusters/{cluster_id}/rerun_workflow",
- relPath,
- types.URLParamGitRepoOwner,
- types.URLParamGitRepoName,
- ),
- },
- Scopes: []types.PermissionScope{
- types.UserScope,
- types.ProjectScope,
- types.GitInstallationScope,
- types.ClusterScope,
- },
- },
- )
- rerunWorkflowHandler := gitinstallation.NewRerunWorkflowHandler(
- config,
- factory.GetDecoderValidator(),
- factory.GetResultWriter(),
- )
- routes = append(routes, &router.Route{
- Endpoint: rerunWorkflowEndpoint,
- Handler: rerunWorkflowHandler,
- Router: r,
- })
- return routes, newPath
- }
|