Skip to content

Commit dcde299

Browse files
committed
fix: address PR review comments for basic auth and path pattern
- Add basic auth ExtensionRef filter to gRPC routes (matching HTTP routes) - Restrict path regex pattern to exclude {, }, ;, ^ characters
1 parent 418716f commit dcde299

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

modules/ingress/nginx_gateway_fabric_legacy/1.0/facets.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ spec:
298298
type: string
299299
title: Path
300300
description: Path of the application (required for HTTP routes)
301-
pattern: ^(/[^\s]*)$
301+
pattern: ^(/[^\s{};^]*)$
302302
x-ui-placeholder: "Enter path (e.g., / or /api or /api/v[0-9]+)"
303303
x-ui-error-message: "Path must start with /"
304304
x-ui-visible-if:

modules/ingress/nginx_gateway_fabric_legacy/1.0/main.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,16 @@ locals {
477477
}
478478
] : []
479479

480+
# Basic auth filter (applied when basic_auth is enabled and route doesn't have disable_auth)
481+
filters = lookup(var.instance.spec, "basic_auth", false) && !lookup(v, "disable_auth", false) ? [{
482+
type = "ExtensionRef"
483+
extensionRef = {
484+
group = "gateway.nginx.org"
485+
kind = "AuthenticationFilter"
486+
name = "${local.name}-basic-auth"
487+
}
488+
}] : []
489+
480490
backendRefs = [{
481491
name = v.service_name
482492
port = tonumber(v.port)

0 commit comments

Comments
 (0)