Org List and Get API Methods (#132)
* Create the organization Get handler. * Added org listing. * Make sure the cmp.Diff always sorts the returned organizations before comparing. * Connect organization service to the Controller handler.
This commit is contained in:
1 parent
0ebb38bbe5
commit
0a0d37668d
8 files changed
+1260
-3
No files matched your search
@@ -21,6 +21,7 @@ import (
|
||||
"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"
|
||||
"github.com/hashicorp/watchtower/internal/servers/controller/handlers/organizations"
|
||||
"github.com/hashicorp/watchtower/internal/servers/controller/handlers/projects"
|
||||
"github.com/hashicorp/watchtower/internal/servers/controller/handlers/users"
|
||||
)
|
||||
@@ -79,6 +80,13 @@ func handleGrpcGateway(c *Controller) (http.Handler, error) {
|
||||
if err := services.RegisterHostServiceHandlerServer(ctx, mux, &hosts.Service{}); err != nil {
|
||||
return nil, fmt.Errorf("failed to register host service handler: %w", err)
|
||||
}
|
||||
os, err := organizations.NewService(c.IamRepoFn)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create organization handler service: %w", err)
|
||||
}
|
||||
if err := services.RegisterOrganizationServiceHandlerServer(ctx, mux, os); err != nil {
|
||||
return nil, fmt.Errorf("failed to register organization service handler: %w", err)
|
||||
}
|
||||
ps, err := projects.NewService(c.IamRepoFn)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create project handler service: %w", err)
|
||||
|
||||
Reference in new issue
Block a user