-
-
Notifications
You must be signed in to change notification settings - Fork 563
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
feat(rust): improvements to portals commands arguments #8618
base: develop
Are you sure you want to change the base?
Conversation
3b584d0
to
21a6fbe
Compare
14f951b
to
91bb33a
Compare
91bb33a
to
a5f0e8c
Compare
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.
Sorry if my comments are a bit out of order. This is a good step forward but I think that could be even clearer in the naming of "addresses" so that there no ambiguity in the description on what an "address" is. Feel free to open another PR for modification.
@@ -346,6 +346,10 @@ mod tests { | |||
} | |||
|
|||
fn outlet_info(worker_addr: Address) -> OutletInfo { | |||
OutletInfo::new(HostnamePort::new("127.0.0.1", 0), Some(&worker_addr), true) | |||
OutletInfo::new( | |||
HostnamePort::new("127.0.0.1", 0).unwrap(), |
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.
Maybe we could make a function HostnamePort::localhost(u16)
that is guaranteed to succeed, instead of unwrapping here.
implementations/rust/ockam/ockam_command/src/influxdb/inlet/static/long_about.txt
Outdated
Show resolved
Hide resolved
implementations/rust/ockam/ockam_command/src/influxdb/outlet/create.rs
Outdated
Show resolved
Hide resolved
)] | ||
pub allow: Option<PolicyExpression>, | ||
|
||
/// Use eBPF and RawSocket to access TCP packets instead of TCP data stream. |
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.
I think it would be nice to either point to some documentation, or to explain that the overall goal is to support an end to end TCP connection, even across several Ockam nodes.
implementations/rust/ockam/ockam_command/src/kafka/consumer/create.rs
Outdated
Show resolved
Hide resolved
implementations/rust/ockam/ockam_command/src/kafka/inlet/create.rs
Outdated
Show resolved
Hide resolved
#[arg(long, display_order = 900, id = "NODE_NAME", value_parser = extract_address_value)] | ||
pub at: Option<String>, | ||
|
||
/// Address on which to accept InfluxDB connections, in the format <scheme>://<address>:<port>. |
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.
I think that we should keep the name Address
for the full <scheme>://<hostname>:<port>
format and then refer to each component separately with those names. For example "the default hostname is 127.0.0.1".
Or maybe even say base URL
instead of Address
? (it's not really a URL because there's no resource path). This would leave the name Address
for our multi-addresses like /project/default
.
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.
I've updated args docs to use the same words consistently, not sure if that's all you meant here.
@@ -27,26 +27,35 @@ use crate::{ | |||
/// Create a new Kafka Outlet | |||
#[derive(Clone, Debug, Args)] | |||
pub struct CreateCommand { | |||
/// Address of your Kafka Outlet, which is part of a route used in other commands. | |||
/// This unique address identifies the Kafka Outlet worker on the Node on your local machine. | |||
/// Examples are `/service/my-outlet` or `my-outlet`. |
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.
Can those 2 be really used interchangeably? If ${name}
is going to be injected somewhere, it will have to be of one form or the other I guess? Unless we always prepend /service
when it doesn't exist? Maybe we should have a dedicated type instead of String
for those things.
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 command is missing a value parser actually. It should use the extract_address_value
to parse the multiaddr into a valid Address
.
a5f0e8c
to
7e7aa90
Compare
7e7aa90
to
853cc48
Compare
create
commands now have a positional argument to define the portal's name. This argument replaces the currentalias
oraddr
. Old arguments are kept as deprecated flags. To ensure backward compatibility, if a deprecated flag is used, it will take precedence over the positional argumentcreate
commands also have the positional argument, as an alternative to the--from
argument. In this case, we'll keep--from
as a valid alternative (not deprecated).HostnamePort
now useSchemeHostnamePort
, allowing the user to optionally specify the scheme (tcp, tls or udp). The--tls
and--udp
flags have been deprecated (but kept), as this information can now be derived from the address arguments. To ensure backward compatibility, if a deprecated flag is used, it will take precedence over an address with an explicit scheme--allow
flag in all the commands