Adding Groups API endpoint and SDK (#122)

* feat: Add group grpc handler.

* feat: Add group sdk hooks.

* fix:  Adding forgotten generated group sdk file.

* fix:  Fix a copy/paste error in test msg.

* fix:  Correct assert error msg.

* fix: Remove unused proto imports.
This commit is contained in:
Todd Knight authored and GitHub committed 2020-06-15 15:22:41 -07:00
1 parent ffddf24f86
commit 6ea448a7f3
23 files changed
+3834 -2

No files matched your search

+8
View File
@@ -17,6 +17,7 @@ import (
"github.com/hashicorp/watchtower/globals"
"github.com/hashicorp/watchtower/internal/gen/controller/api/services"
"github.com/hashicorp/watchtower/internal/servers/controller/handlers"
"github.com/hashicorp/watchtower/internal/servers/controller/handlers/groups"
"github.com/hashicorp/watchtower/internal/servers/controller/handlers/host_catalogs"
"github.com/hashicorp/watchtower/internal/servers/controller/handlers/host_sets"
"github.com/hashicorp/watchtower/internal/servers/controller/handlers/hosts"
@@ -92,6 +93,13 @@ func handleGrpcGateway(c *Controller) (http.Handler, error) {
if err := services.RegisterUserServiceHandlerServer(ctx, mux, us); err != nil {
return nil, fmt.Errorf("failed to register user service handler: %w", err)
}
gs, err := groups.NewService(c.IamRepoFn)
if err != nil {
return nil, fmt.Errorf("failed to create group handler service: %w", err)
}
if err := services.RegisterGroupServiceHandlerServer(ctx, mux, gs); err != nil {
return nil, fmt.Errorf("failed to register group service handler: %w", err)
}
return mux, nil
}