-
Notifications
You must be signed in to change notification settings - Fork 413
fix(server)!: reject a wildcard bind with no advertised address #3923
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
Merged
hubcio
merged 33 commits into
apache:master
from
chengxilo:fix-unreachable-roster-candidates
Aug 31, 2026
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
2b6fc1a
fix(server)!: reject a wildcard bind with no advertised address
chengxilo 7f78459
fix(test): add env for test container for Csharp and Python
chengxilo 20031ae
retry-ci
chengxilo 8611c14
Merge branch 'master' into fix-unreachable-roster-candidates
chengxilo 0bd9d96
Merge branch 'master' into fix-unreachable-roster-candidates
chengxilo 2c5c5c5
Merge branch 'master' into fix-unreachable-roster-candidates
chengxilo 219d539
fix(configs): restore serde default on personal access token
chengxilo 201b6bc
fix(configs): reject the v4-mapped spelling of the wildcard address
chengxilo 3317d35
fix(server): compare roster and bind addresses on the canonical form
chengxilo 3a23b62
fix(docker): advertise a dialable address in docker compose
chengxilo fab6dc2
update Java test container env for new rule
chengxilo 8fbfa25
fix(doc): update the command example
chengxilo 4e03b36
feat(helm): refuse setting the advertised address two ways at once
chengxilo 1806876
fix(server): publish the single node's advertised address normalized
chengxilo 7a4d1d0
fix(configs): reject an unspecified address at roster node conversion
chengxilo 850c340
fix(server): warn when the derived address misses a listener
chengxilo aa5bead
Merge branch 'master' into fix-unreachable-roster-candidates
chengxilo 28cc4db
fix: .devcontainer use localhost as advertised address
chengxilo a8d0916
style(server): move [node] above [http] in config.toml
chengxilo 7dadb8e
fix(web): expose localhost as advertised address
chengxilo 1c46f13
refactor(configs): validate roster nodes via ResolvedClusterNode to
chengxilo f0ee942
fix(configs): canonicalize advertised address when parsing, and remove
chengxilo e700f9a
fix(server): derive the client-facing address from an enabled listener,
chengxilo f980366
fix(configs): name both port sources when an advertised address carries
chengxilo 542eca4
docs(server): tell operators peer certs need IP SANs, not DNS ones
chengxilo 39f42ab
docs(server): show the advertised address in the --help examples
chengxilo 4fc33a5
fix(helm): require a non-empty advertised address in server.env
chengxilo 0f1d210
docs(helm): scope the start-up refusal to builds that have the setting
chengxilo ddd80f2
docs(server): drop `bdd/` assert metadata addresses, check "single node"
chengxilo a76933b
docs(server): fix the comment regarding ipv6 ip normalizing
chengxilo 770e1ec
Merge branch 'master' into fix-unreachable-roster-candidates
chengxilo 3be47e6
Merge branch 'master' into fix-unreachable-roster-candidates
hubcio c5aefe3
fix(server): unbreak partition forwarding after the master merge
hubcio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you 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. | ||
|
|
||
| // This node's own client-facing identity, for the cluster-disabled server. | ||
|
|
||
| use super::COMPONENT; | ||
| use super::cluster::AdvertisedAddress; | ||
| use crate::ConfigurationError; | ||
| use configs::ConfigEnv; | ||
| use iggy_common::Validatable; | ||
| use serde::{Deserialize, Serialize}; | ||
|
|
||
| /// Named to match its roster counterpart: `advertised_address` here and | ||
| /// `cluster.nodes[*].advertised_address` there are the same setting for the | ||
| /// same question, and an operator moving between the two modes should not have | ||
| /// to learn a second spelling. | ||
| #[derive(Debug, Default, Deserialize, Serialize, Clone, ConfigEnv)] | ||
| #[serde(deny_unknown_fields)] | ||
| pub struct NodeConfig { | ||
| /// Client-facing address: a literal IP or a DNS hostname. `None` leaves | ||
| /// the server deriving one from its bind address. | ||
| #[serde(default)] | ||
| pub advertised_address: Option<String>, | ||
| } | ||
|
|
||
| impl Validatable<ConfigurationError> for NodeConfig { | ||
| fn validate(&self) -> Result<(), ConfigurationError> { | ||
| let Some(address) = self.advertised_address.as_deref() else { | ||
| return Ok(()); | ||
| }; | ||
|
|
||
| address.parse::<AdvertisedAddress>().map_err(|error| { | ||
| eprintln!("{COMPONENT} - node.advertised_address '{address}': {error}"); | ||
| ConfigurationError::InvalidConfigurationValue | ||
| })?; | ||
|
|
||
| Ok(()) | ||
| } | ||
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod tests { | ||
| use super::*; | ||
|
|
||
| fn advertised(address: &str) -> NodeConfig { | ||
| NodeConfig { | ||
| advertised_address: Some(address.to_owned()), | ||
| } | ||
| } | ||
|
|
||
| #[test] | ||
| fn validate_accepts_an_unset_address() { | ||
| assert!(NodeConfig::default().validate().is_ok()); | ||
| } | ||
|
|
||
| #[test] | ||
| fn validate_accepts_a_routable_address() { | ||
| assert!(advertised("203.0.113.10").validate().is_ok()); | ||
| assert!(advertised("broker-1.example.com").validate().is_ok()); | ||
| assert!(advertised("2001:db8::1").validate().is_ok()); | ||
| } | ||
|
|
||
| #[test] | ||
| fn validate_rejects_an_unspecified_address() { | ||
| assert!(advertised("0.0.0.0").validate().is_err()); | ||
| assert!(advertised("::").validate().is_err()); | ||
| } | ||
|
|
||
| #[test] | ||
| fn validate_rejects_an_unparsable_address() { | ||
| assert!(advertised("broker-1.example.com:8090").validate().is_err()); | ||
| assert!(advertised("10.0.0.256").validate().is_err()); | ||
| assert!(advertised("").validate().is_err()); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.