Skip to content

Commit 12e7c77

Browse files
authored
TCP Listener: fix bug in parsing TCP listener settings for proxy_protocol_behavior (#27459)
* update code and test to support the documented config setting 'deny_unauthorized' rather than 'deny_authorized' which was incorrect * changelog
1 parent 2db5d6a commit 12e7c77

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

changelog/27459.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
```release-note:bug
2+
config: Vault TCP listener config now correctly supports the documented proxy_protocol_behavior
3+
setting of 'deny_unauthorized'
4+
```

internalshared/configutil/listener.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,9 @@ func (l *Listener) parseProxySettings() error {
562562

563563
// Validation/sanity check on allowed settings for behavior.
564564
switch l.ProxyProtocolBehavior {
565-
case "allow_authorized", "deny_authorized", "use_always", "":
565+
case "allow_authorized", "deny_unauthorized", "use_always", "":
566566
// Ignore these cases, they're all valid values.
567-
// In the case of 'allow_authorized' and 'deny_authorized', we don't need
567+
// In the case of 'allow_authorized' and 'deny_unauthorized', we don't need
568568
// to check how many addresses we have in ProxyProtocolAuthorizedAddrs
569569
// as parseutil.ParseAddrs returns "one or more addresses" (or an error)
570570
// so we'd have returned earlier.

internalshared/configutil/listener_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ func TestListener_parseProxySettings(t *testing.T) {
529529
"behavior-deny": {
530530
rawProxyProtocolAuthorizedAddrs: "10.0.0.1,10.0.2.1",
531531
expectedNumAddrs: 2,
532-
proxyBehavior: "deny_authorized",
532+
proxyBehavior: "deny_unauthorized",
533533
isErrorExpected: false,
534534
},
535535
}

0 commit comments

Comments
 (0)