feat(handlers): Implement Policy Service

This also includes adding new grant and type primitives, as well as
package domain names.
This commit is contained in:
Hugo authored and Louis Ruch committed 2024-01-16 13:53:43 -08:00
1 parent 1c3b1b42f7
commit edbb33de5b
15 files changed
+194 -5

No files matched your search

+15
View File
@@ -33,6 +33,7 @@ import (
"github.com/hashicorp/boundary/internal/daemon/controller/handlers/host_sets"
"github.com/hashicorp/boundary/internal/daemon/controller/handlers/hosts"
"github.com/hashicorp/boundary/internal/daemon/controller/handlers/managed_groups"
"github.com/hashicorp/boundary/internal/daemon/controller/handlers/policies"
"github.com/hashicorp/boundary/internal/daemon/controller/handlers/roles"
"github.com/hashicorp/boundary/internal/daemon/controller/handlers/scopes"
"github.com/hashicorp/boundary/internal/daemon/controller/handlers/session_recordings"
@@ -222,6 +223,17 @@ func (c *Controller) registerGrpcServices(s *grpc.Server) error {
}
services.RegisterStorageBucketServiceServer(s, sbs)
}
if _, ok := currentServices[services.PolicyService_ServiceDesc.ServiceName]; !ok {
ps, err := policies.NewServiceFn(
c.baseContext,
c.IamRepoFn,
c.ControllerExtension,
)
if err != nil {
return fmt.Errorf("failed to create policy handler service: %w", err)
}
services.RegisterPolicyServiceServer(s, ps)
}
if _, ok := currentServices[services.SessionRecordingService_ServiceDesc.ServiceName]; !ok {
srs, err := session_recordings.NewServiceFn(
c.baseContext,
@@ -403,6 +415,9 @@ func registerGrpcGatewayEndpoints(ctx context.Context, gwMux *runtime.ServeMux,
if err := services.RegisterSessionRecordingServiceHandlerFromEndpoint(ctx, gwMux, gatewayTarget, dialOptions); err != nil {
return fmt.Errorf("failed to register session recording handler: %w", err)
}
if err := services.RegisterPolicyServiceHandlerFromEndpoint(ctx, gwMux, gatewayTarget, dialOptions); err != nil {
return fmt.Errorf("failed to register policy handler: %w", err)
}
return nil
}