-
Notifications
You must be signed in to change notification settings - Fork 40
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
use oxnet::{ IpNet, Ipv4Net, Ipv6Net }
#5810
Conversation
use std::net::{Ipv4Addr, Ipv6Addr}; | ||
|
||
#[test] | ||
fn test_deserialize_allowed_source_ips() { | ||
let parsed: AllowedSourceIps = serde_json::from_str( | ||
r#"{"allow":"list","ips":["127.0.0.1","10.0.0.0/24","fd00::1/64"]}"#, | ||
r#"{"allow":"list","ips":["127.0.0.1/32","10.0.0.0/24","fd00::1/64"]}"#, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bnaecker this ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that looks fine to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. Love the change from network
to prefix
. Just small nits from me.
@@ -331,6 +331,7 @@ omicron-certificates = { path = "certificates" } | |||
omicron-passwords = { path = "passwords" } | |||
omicron-workspace-hack = "0.1.0" | |||
oxlog = { path = "dev-tools/oxlog" } | |||
oxnet = { git = "https://github.com/oxidecomputer/oxnet", branch = "main" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we relying on the lockfile to keep this in sync? I usually don't like relying on a branch directly. Can we give it a 1.0 version tag or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now; I want to get to something resembling stable in oxnet, publish to crates.io and depend on that. We have several other branch = main deps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, works for me.
@@ -419,33 +419,27 @@ impl TryFrom<types::ProducerEndpoint> | |||
} | |||
} | |||
|
|||
impl TryFrom<&omicron_common::api::external::Ipv4Net> for types::Ipv4Net { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we planning to get rid of the generated types
versions at some point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes; going to be rooting that out here and from other places like dendrite and propolis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
@@ -1334,22 +1335,22 @@ mod test { | |||
|
|||
let external_dns_ip = IpAddr::V4(Ipv4Addr::new(1, 2, 3, 4)); | |||
let external_dns_pip = DNS_OPTE_IPV4_SUBNET | |||
.nth(NUM_INITIAL_RESERVED_IP_ADDRESSES as u32 + 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very happy to get rid of the use of as
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good news: I added more back in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol
Co-authored-by: Andrew J. Stone <[email protected]>
No description provided.