2023-09-14 17:40:54 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
|
|
|
package auth
|
|
|
|
|
|
|
|
import (
|
2023-09-25 16:50:07 +00:00
|
|
|
"github.com/hashicorp/consul/internal/auth/internal/controllers"
|
|
|
|
"github.com/hashicorp/consul/internal/auth/internal/controllers/trafficpermissions"
|
|
|
|
"github.com/hashicorp/consul/internal/auth/internal/mappers/trafficpermissionsmapper"
|
2023-09-14 17:40:54 +00:00
|
|
|
"github.com/hashicorp/consul/internal/auth/internal/types"
|
2023-09-25 16:50:07 +00:00
|
|
|
"github.com/hashicorp/consul/internal/controller"
|
2023-09-14 17:40:54 +00:00
|
|
|
"github.com/hashicorp/consul/internal/resource"
|
|
|
|
)
|
|
|
|
|
2023-09-25 16:50:07 +00:00
|
|
|
var (
|
|
|
|
// Controller statuses
|
|
|
|
|
|
|
|
StatusKey = trafficpermissions.StatusKey
|
|
|
|
TrafficPermissionsConditionComputed = trafficpermissions.ConditionComputed
|
|
|
|
TrafficPermissionsConditionFailedToCompute = trafficpermissions.ConditionFailedToCompute
|
|
|
|
)
|
|
|
|
|
2023-09-14 17:40:54 +00:00
|
|
|
// RegisterTypes adds all resource types within the "catalog" API group
|
|
|
|
// to the given type registry
|
|
|
|
func RegisterTypes(r resource.Registry) {
|
|
|
|
types.Register(r)
|
|
|
|
}
|
2023-09-25 16:50:07 +00:00
|
|
|
|
|
|
|
type ControllerDependencies = controllers.Dependencies
|
|
|
|
|
|
|
|
func DefaultControllerDependencies() ControllerDependencies {
|
|
|
|
return ControllerDependencies{
|
|
|
|
TrafficPermissionsMapper: trafficpermissionsmapper.New(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// RegisterControllers registers controllers for the auth types with
|
|
|
|
// the given controller manager.
|
|
|
|
func RegisterControllers(mgr *controller.Manager, deps ControllerDependencies) {
|
|
|
|
controllers.Register(mgr, deps)
|
|
|
|
}
|