Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCP Listener: fix bug in parsing TCP listener settings for proxy_protocol_behavior #27459

Merged
merged 2 commits into from
Jun 12, 2024
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
4 changes: 4 additions & 0 deletions changelog/27459.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```release-note:bug
config: Vault TCP listener config now correctly supports the documented proxy_protocol_behavior
setting of 'deny_unauthorized'
```
4 changes: 2 additions & 2 deletions internalshared/configutil/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,9 @@ func (l *Listener) parseProxySettings() error {

// Validation/sanity check on allowed settings for behavior.
switch l.ProxyProtocolBehavior {
case "allow_authorized", "deny_authorized", "use_always", "":
case "allow_authorized", "deny_unauthorized", "use_always", "":
// Ignore these cases, they're all valid values.
// In the case of 'allow_authorized' and 'deny_authorized', we don't need
// In the case of 'allow_authorized' and 'deny_unauthorized', we don't need
// to check how many addresses we have in ProxyProtocolAuthorizedAddrs
// as parseutil.ParseAddrs returns "one or more addresses" (or an error)
// so we'd have returned earlier.
Expand Down
2 changes: 1 addition & 1 deletion internalshared/configutil/listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ func TestListener_parseProxySettings(t *testing.T) {
"behavior-deny": {
rawProxyProtocolAuthorizedAddrs: "10.0.0.1,10.0.2.1",
expectedNumAddrs: 2,
proxyBehavior: "deny_authorized",
proxyBehavior: "deny_unauthorized",
isErrorExpected: false,
},
}
Expand Down
Loading