|
|
@@ -4,7 +4,6 @@ import (
|
|
|
"github.com/go-chi/chi"
|
|
|
"github.com/porter-dev/porter/api/server/handlers/cluster"
|
|
|
"github.com/porter-dev/porter/api/server/handlers/gitinstallation"
|
|
|
- "github.com/porter-dev/porter/api/server/handlers/invite"
|
|
|
"github.com/porter-dev/porter/api/server/handlers/project"
|
|
|
"github.com/porter-dev/porter/api/server/handlers/provision"
|
|
|
"github.com/porter-dev/porter/api/server/handlers/registry"
|
|
|
@@ -610,84 +609,5 @@ func getProjectRoutes(
|
|
|
Router: r,
|
|
|
})
|
|
|
|
|
|
- // GET /api/projects/{project_id}/invites -> invite.NewInvitesListHandler
|
|
|
- listInvitesEndpoint := factory.NewAPIEndpoint(
|
|
|
- &types.APIRequestMetadata{
|
|
|
- Verb: types.APIVerbGet,
|
|
|
- Method: types.HTTPVerbGet,
|
|
|
- Path: &types.Path{
|
|
|
- Parent: basePath,
|
|
|
- RelativePath: relPath + "/invites",
|
|
|
- },
|
|
|
- Scopes: []types.PermissionScope{
|
|
|
- types.UserScope,
|
|
|
- types.ProjectScope,
|
|
|
- },
|
|
|
- },
|
|
|
- )
|
|
|
-
|
|
|
- listInvitesHandler := invite.NewInvitesListHandler(
|
|
|
- config,
|
|
|
- factory.GetResultWriter(),
|
|
|
- )
|
|
|
-
|
|
|
- routes = append(routes, &Route{
|
|
|
- Endpoint: listInvitesEndpoint,
|
|
|
- Handler: listInvitesHandler,
|
|
|
- Router: r,
|
|
|
- })
|
|
|
-
|
|
|
- // POST /api/projects/{project_id}/invites -> invite.NewInviteCreateHandler
|
|
|
- createInviteEndpoint := factory.NewAPIEndpoint(
|
|
|
- &types.APIRequestMetadata{
|
|
|
- Verb: types.APIVerbCreate,
|
|
|
- Method: types.HTTPVerbPost,
|
|
|
- Path: &types.Path{
|
|
|
- Parent: basePath,
|
|
|
- RelativePath: relPath + "/invites",
|
|
|
- },
|
|
|
- Scopes: []types.PermissionScope{
|
|
|
- types.UserScope,
|
|
|
- types.ProjectScope,
|
|
|
- },
|
|
|
- },
|
|
|
- )
|
|
|
-
|
|
|
- createInviteHandler := invite.NewInviteCreateHandler(
|
|
|
- config,
|
|
|
- factory.GetDecoderValidator(),
|
|
|
- factory.GetResultWriter(),
|
|
|
- )
|
|
|
-
|
|
|
- routes = append(routes, &Route{
|
|
|
- Endpoint: createInviteEndpoint,
|
|
|
- Handler: createInviteHandler,
|
|
|
- Router: r,
|
|
|
- })
|
|
|
-
|
|
|
- // GET /api/projects/{project_id}/invites/accept -> invite.NewInviteAcceptHandler
|
|
|
- acceptInviteEndpoint := factory.NewAPIEndpoint(
|
|
|
- &types.APIRequestMetadata{
|
|
|
- Verb: types.APIVerbGet,
|
|
|
- Method: types.HTTPVerbGet,
|
|
|
- Path: &types.Path{
|
|
|
- Parent: basePath,
|
|
|
- RelativePath: relPath + "/invites/accept",
|
|
|
- },
|
|
|
- Scopes: []types.PermissionScope{},
|
|
|
- },
|
|
|
- )
|
|
|
-
|
|
|
- acceptInviteHandler := invite.NewInviteAcceptHandler(
|
|
|
- config,
|
|
|
- factory.GetDecoderValidator(),
|
|
|
- )
|
|
|
-
|
|
|
- routes = append(routes, &Route{
|
|
|
- Endpoint: acceptInviteEndpoint,
|
|
|
- Handler: acceptInviteHandler,
|
|
|
- Router: r,
|
|
|
- })
|
|
|
-
|
|
|
return routes, newPath
|
|
|
}
|