Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- (Bugfix) (Platform) Fix Monitoring RBAC
- (Feature) (Platform) Do not require LM during install commands
- (Feature) (Platform) ArangoRoute Redirect
- (Feature) (Platform) Request ID & Header Standardization

## [1.3.1](https://github.com/arangodb/kube-arangodb/tree/1.3.1) (2025-10-07)
- (Documentation) Add ArangoPlatformStorage Docs & Examples
Expand Down
2 changes: 2 additions & 0 deletions integrations/envoy/auth/v3/impl/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ import (
"github.com/arangodb/kube-arangodb/integrations/envoy/auth/v3/impl/auth_custom"
"github.com/arangodb/kube-arangodb/integrations/envoy/auth/v3/impl/auth_required"
"github.com/arangodb/kube-arangodb/integrations/envoy/auth/v3/impl/pass_mode"
"github.com/arangodb/kube-arangodb/integrations/envoy/auth/v3/impl/request_id"
"github.com/arangodb/kube-arangodb/integrations/envoy/auth/v3/impl/required"
"github.com/arangodb/kube-arangodb/integrations/envoy/auth/v3/impl/users"
pbImplEnvoyAuthV3Shared "github.com/arangodb/kube-arangodb/integrations/envoy/auth/v3/shared"
)

func Factory() pbImplEnvoyAuthV3Shared.Factory {
return pbImplEnvoyAuthV3Shared.NewFactory(
request_id.New,
required.New,
auth_bearer.New,
auth_cookie.New,
Expand Down
52 changes: 52 additions & 0 deletions integrations/envoy/auth/v3/impl/request_id/impl.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//
// DISCLAIMER
//
// Copyright 2025 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//

package request_id

import (
"context"

pbEnvoyCoreV3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
pbEnvoyAuthV3 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v3"
"k8s.io/apimachinery/pkg/util/uuid"

pbImplEnvoyAuthV3Shared "github.com/arangodb/kube-arangodb/integrations/envoy/auth/v3/shared"
utilConstants "github.com/arangodb/kube-arangodb/pkg/util/constants"
)

func New(ctx context.Context, configuration pbImplEnvoyAuthV3Shared.Configuration) (pbImplEnvoyAuthV3Shared.AuthHandler, bool) {
return impl{}, true
}

type impl struct {
}

func (a impl) Handle(ctx context.Context, request *pbEnvoyAuthV3.CheckRequest, current *pbImplEnvoyAuthV3Shared.Response) error {
var header = pbEnvoyCoreV3.HeaderValueOption{
Header: &pbEnvoyCoreV3.HeaderValue{
Key: utilConstants.EnvoyRequestIDHeader,
Value: string(uuid.NewUUID()),
},
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HeaderValueOption should include an AppendAction field for consistency with other handlers and to explicitly define the header behavior. Consider adding:

var header = pbEnvoyCoreV3.HeaderValueOption{
	Header: &pbEnvoyCoreV3.HeaderValue{
		Key:   utilConstants.EnvoyRequestIDHeader,
		Value: string(uuid.NewUUID()),
	},
	AppendAction: pbEnvoyCoreV3.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD,
}

This ensures the request ID header behavior is predictable and consistent with the pattern used in other handlers like pass_mode.

Suggested change
},
},
AppendAction: pbEnvoyCoreV3.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD,

Copilot uses AI. Check for mistakes.
}
current.Headers = append(current.Headers, &header)
current.ResponseHeaders = append(current.ResponseHeaders, &header)

return nil
}
7 changes: 4 additions & 3 deletions pkg/deployment/resources/config_map_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,8 @@ func (r *Resources) renderGatewayConfig(cachedStatus inspectorInterface.Inspecto
dest.Match = util.NewType(gateway.ConfigMatchPath)
dest.Type = util.NewType(gateway.ConfigDestinationTypeRedirect)
dest.ResponseHeaders = map[string]string{
utilConstants.EnvoyRouteHeader: at.GetName(),
utilConstants.EnvoyRouteHeader: at.GetName(),
utilConstants.EnvoyRouteHeaderV2: at.GetName(),
}
dest.AuthExtension = &gateway.ConfigAuthZExtension{
AuthZExtension: map[string]string{
Expand Down Expand Up @@ -411,12 +412,12 @@ func (r *Resources) renderGatewayConfig(cachedStatus inspectorInterface.Inspecto
},
}
dest.ResponseHeaders = map[string]string{
utilConstants.EnvoyRouteHeader: at.GetName(),
utilConstants.EnvoyRouteHeader: at.GetName(),
utilConstants.EnvoyRouteHeaderV2: at.GetName(),
}
default:
return errors.Errorf("Unknown route destination type %s", target.Type)
}

cfg.Destinations[target.Route.Path] = dest

routes[at.GetName()] = &pbInventoryV1.InventoryNetworkingRoute{
Expand Down
7 changes: 4 additions & 3 deletions pkg/util/constants/envoy.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
package constants

const (
EnvoyRouteHeader = "arangodb-platform-route"
// Deprecated: Use EnvoyRouteHeaderV2 instead
EnvoyRouteHeader = "arangodb-platform-route"
EnvoyRouteHeaderV2 = "X-Arango-Platform-Route"
EnvoyRequestIDHeader = "X-Arango-Platform-Request-Id"

EnvoyInventoryConfigDestination = "/_inventory"
EnvoyInventoryHashConfigDestination = "/_inventory.hash"
Expand All @@ -32,6 +35,4 @@ const (
EnvoyIntegrationSidecarFilterName = "envoy.filters.http.ext_authz"

EnvoyIntegrationSidecarCluster = "integration_sidecar"

EnvoyIntegrationSidecarClusterHTTP = "integration_sidecar_http"
)
Loading