[management] Configure per-target HTTP access actions (#8116)

Let HTTP targets inherit service authentication, bypass it, or block access. Validate and persist the action, expose it through the API, and deliver it to the proxy. Private services reject bypass.

Validation: service/manager, store, and management-to-proxy integration race tests passed; scoped lint passed.
This commit is contained in:
Maycon Santos
2026-10-12 12:56:17 +02:00
committed by GitHub
parent 1161616c02
commit cd22a9d4f1
10 changed files with 1111 additions and 56 deletions
+6
View File
@@ -3104,6 +3104,12 @@ components:
type: string
description: URL path prefix for this target (HTTP only)
example: "/"
access_action:
type: string
description: Access action applied after this target's HTTP path prefix is selected. "inherit" uses the service authentication configuration, "bypass" skips service authentication, and "block" denies access. HTTP services only.
enum: [inherit, bypass, block]
default: inherit
example: "inherit"
protocol:
type: string
description: Protocol to use when connecting to the backend
+27
View File
@@ -1037,6 +1037,27 @@ func (e ServiceRequestMode) Valid() bool {
}
}
// Defines values for ServiceTargetAccessAction.
const (
ServiceTargetAccessActionBlock ServiceTargetAccessAction = "block"
ServiceTargetAccessActionBypass ServiceTargetAccessAction = "bypass"
ServiceTargetAccessActionInherit ServiceTargetAccessAction = "inherit"
)
// Valid indicates whether the value is a known member of the ServiceTargetAccessAction enum.
func (e ServiceTargetAccessAction) Valid() bool {
switch e {
case ServiceTargetAccessActionBlock:
return true
case ServiceTargetAccessActionBypass:
return true
case ServiceTargetAccessActionInherit:
return true
default:
return false
}
}
// Defines values for ServiceTargetProtocol.
const (
ServiceTargetProtocolHttp ServiceTargetProtocol = "http"
@@ -5113,6 +5134,9 @@ type ServiceRequestMode string
// ServiceTarget defines model for ServiceTarget.
type ServiceTarget struct {
// AccessAction Access action applied after this target's HTTP path prefix is selected. "inherit" uses the service authentication configuration, "bypass" skips service authentication, and "block" denies access. HTTP services only.
AccessAction *ServiceTargetAccessAction `json:"access_action,omitempty"`
// Enabled Whether this target is enabled
Enabled bool `json:"enabled"`
@@ -5136,6 +5160,9 @@ type ServiceTarget struct {
TargetType ServiceTargetTargetType `json:"target_type"`
}
// ServiceTargetAccessAction Access action applied after this target's HTTP path prefix is selected. "inherit" uses the service authentication configuration, "bypass" skips service authentication, and "block" denies access. HTTP services only.
type ServiceTargetAccessAction string
// ServiceTargetProtocol Protocol to use when connecting to the backend
type ServiceTargetProtocol string