Skip to content

Commit 3723b80

Browse files
committed
refactor: adapt for the autonomy command
1 parent 7d4cb01 commit 3723b80

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+117
-150
lines changed

implementations/rust/ockam/ockam_api/src/cli_state/cli_state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,10 @@ impl CliState {
345345
/// If $OCKAM_HOME is not defined, then $HOME is used instead
346346
pub(super) fn default_dir() -> Result<PathBuf> {
347347
Ok(get_env_with_default::<PathBuf>(
348-
"OCKAM_HOME",
348+
"AUTONOMY_HOME",
349349
home::home_dir()
350350
.ok_or_else(|| CliStateError::InvalidPath("$HOME".to_string()))?
351-
.join(".ockam"),
351+
.join(".autonomy"),
352352
)?)
353353
}
354354
}

implementations/rust/ockam/ockam_api/src/enroll/ockam_oidc_provider.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use ockam_core::{Error, Result};
66
use std::time::Duration;
77
use url::Url;
88

9-
const PRODUCTION_AUTHENTICATOR_ENDPOINT: &str = "https://account.ockam.io";
9+
const PRODUCTION_AUTHENTICATOR_ENDPOINT: &str = "https://account.autonomy.computer";
1010

1111
pub fn authenticator_endpoint() -> String {
1212
get_env_with_default(
@@ -26,7 +26,7 @@ pub fn auth0_client_id() -> Result<String> {
2626
None => {
2727
let endpoint = authenticator_endpoint();
2828
if endpoint == PRODUCTION_AUTHENTICATOR_ENDPOINT {
29-
Ok("c1SAhEjrJAqEk6ArWjGjuWX11BD2gK8X".to_string())
29+
Ok("id3p8DPYZBdkjvA7RO2FqWjaUasruNGW".to_string())
3030
} else {
3131
Err(Error::new(Origin::Api, Kind::NotFound, format!("The OCKAM_AUTH0_CLIENT_ID variable must be defined when using the endpoint {endpoint}")))
3232
}

implementations/rust/ockam/ockam_api/src/ui/terminal/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ impl<W: TerminalWriter + Debug> Terminal<W> {
133133
no_color: bool,
134134
no_input: bool,
135135
output_format: OutputFormat,
136-
branding: OutputBranding,
136+
_branding: OutputBranding,
137137
) -> Self {
138138
let no_color = Self::should_disable_color(no_color);
139139
let no_input = Self::should_disable_user_input(no_input);
140-
let stdout = W::stdout(no_color, branding.clone());
141-
let stderr = W::stderr(no_color, branding);
140+
let stdout = W::stdout(no_color, OutputBranding::default());
141+
let stderr = W::stderr(no_color, OutputBranding::default());
142142
let max_width_col_count = get_size().map(|it| it.col_count).unwrap_or(ch!(80)).into();
143143
Self {
144144
stdout,

implementations/rust/ockam/ockam_command/Cargo.toml

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ockam_command"
3-
version = "0.157.0"
3+
version = "0.158.0"
44
authors = ["Ockam Developers"]
55
categories = [
66
"cryptography",
@@ -65,16 +65,28 @@ indicatif = "0.17.8"
6565
indoc = "2.0.5"
6666
miette = { version = "7.2.0", features = ["fancy-no-backtrace"] }
6767
mimalloc = { version = "0.1", features = ["secure"] }
68-
minicbor = { version = "0.26.3", default-features = false, features = ["alloc", "derive"] }
68+
minicbor = { version = "0.26.3", default-features = false, features = [
69+
"alloc",
70+
"derive",
71+
] }
6972
nix = { version = "0.29", features = ["signal"] }
7073
notify = "8.0.0"
71-
ockam = { path = "../ockam", version = "^0.157.0", features = ["software_vault"] }
74+
ockam = { path = "../ockam", version = "^0.157.0", features = [
75+
"software_vault",
76+
] }
7277
ockam_abac = { path = "../ockam_abac", version = "0.84.0", features = ["std"] }
73-
ockam_api = { path = "../ockam_api", version = "0.100.0", default-features = false, features = ["std"] }
78+
ockam_api = { path = "../ockam_api", version = "0.100.0", default-features = false, features = [
79+
"std",
80+
] }
7481
ockam_core = { path = "../ockam_core", version = "^0.126.0" }
75-
ockam_multiaddr = { path = "../ockam_multiaddr", version = "0.71.0", features = ["std"] }
82+
ockam_multiaddr = { path = "../ockam_multiaddr", version = "0.71.0", features = [
83+
"std",
84+
] }
7685
ockam_node = { path = "../ockam_node", version = "^0.142.0" }
77-
ockam_vault = { path = "../ockam_vault", version = "^0.136.0", default-features = false, features = ["storage", "std"] }
86+
ockam_vault = { path = "../ockam_vault", version = "^0.136.0", default-features = false, features = [
87+
"storage",
88+
"std",
89+
] }
7890
once_cell = "1.21"
7991
open = "5.3.0"
8092
opentelemetry = { version = "0.27", features = ["metrics", "trace"] }
@@ -83,7 +95,11 @@ r3bl_rs_utils_core = "0.9.12"
8395
r3bl_tui = "0.5.8"
8496
rand = "0.8"
8597
regex = "1.10.6"
86-
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls-native-roots", "blocking"] }
98+
reqwest = { version = "0.12", default-features = false, features = [
99+
"json",
100+
"rustls-tls-native-roots",
101+
"blocking",
102+
] }
87103
rustls = { version = "0.23.13", default-features = false }
88104
rustls-native-certs = "0.8.0"
89105
rustls-pki-types = "1.7.0"
@@ -92,9 +108,14 @@ semver = "1.0.23"
92108
serde = { version = "1", features = ["derive"] }
93109
serde_json = "1"
94110
serde_yaml = "0.9"
95-
shellexpand = { version = "3.1.0", default-features = false, features = ["base-0"] }
111+
shellexpand = { version = "3.1.0", default-features = false, features = [
112+
"base-0",
113+
] }
96114
strip-ansi-escapes = "0.2"
97-
syntect = { version = "5.2.0", default-features = false, features = ["default-syntaxes", "regex-onig"] }
115+
syntect = { version = "5.2.0", default-features = false, features = [
116+
"default-syntaxes",
117+
"regex-onig",
118+
] }
98119
tempfile = "3.17.1"
99120
thiserror = "2.0.9"
100121
tokio = { version = "1.43.1", features = ["full"] }
@@ -108,12 +129,18 @@ zip-extract = "0.2.3"
108129
[dev-dependencies]
109130
assert_cmd = "2"
110131
mockito = "1.5.0"
111-
ockam_api = { path = "../ockam_api", version = "0.100.0", default-features = false, features = ["test-utils"] }
132+
ockam_api = { path = "../ockam_api", version = "0.100.0", default-features = false, features = [
133+
"test-utils",
134+
] }
112135
ockam_macros = { path = "../ockam_macros", version = "^0.39.0" }
113136
serial_test = "3.0.0"
114137

115138
[features]
116139
default = ["rust-crypto", "privileged_portals"]
117140
privileged_portals = ["ockam_api/privileged_portals"]
118141
aws-lc = ["ockam_vault/aws-lc", "ockam_api/aws-lc", "rustls/aws-lc-rs"]
119-
rust-crypto = ["ockam_vault/rust-crypto", "ockam_api/rust-crypto", "rustls/ring"]
142+
rust-crypto = [
143+
"ockam_vault/rust-crypto",
144+
"ockam_api/rust-crypto",
145+
"rustls/ring",
146+
]

implementations/rust/ockam/ockam_command/src/base_command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use ockam_node::Context;
1313
#[derive(Clone, Debug, Args, Default)]
1414
pub struct BaseCommand {
1515
/// Whether to use a public AWS ECR
16-
#[arg(long)]
16+
#[arg(long, hide = true)]
1717
pub use_public_ecr: bool,
1818

1919
#[command(flatten)]

implementations/rust/ockam/ockam_command/src/cluster/enroll.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,25 @@ use crate::{docs, Command, CommandGlobalOpts};
66
use ockam::Context;
77

88
const LONG_ABOUT: &str = include_str!("./static/enroll/long_about.txt");
9-
const PREVIEW_TAG: &str = include_str!("../static/preview_tag.txt");
109
const AFTER_LONG_HELP: &str = include_str!("./static/enroll/after_long_help.txt");
1110

12-
/// Enroll your identity with your cluster
11+
/// Enroll with your cluster in autonomy.
1312
#[derive(Clone, Debug, Args, Default)]
1413
#[command(
1514
long_about = docs::about(LONG_ABOUT),
16-
before_help = docs::before_help(PREVIEW_TAG),
1715
after_long_help = docs::after_help(AFTER_LONG_HELP)
1816
)]
1917
pub struct EnrollCommand {
2018
#[arg(global = true, value_name = "IDENTITY_NAME", long)]
21-
#[arg(help = docs::about("\
22-
The name of an existing Ockam Identity that you wish to enroll. \
23-
You can use `ockam identity list` to get a list of existing Identities. \
24-
To create a new Identity, use `ockam identity create`. \
25-
If you don't specify an Identity name, and you don't have a default Identity, this command \
26-
will create a default Identity for you and save it locally in the default Vault
27-
"))]
19+
#[arg(help = docs::about("The name of an existing Identity that you wish to enroll."))]
2820
pub identity: Option<String>,
2921

3022
/// This option allows you to bypass pasting the one-time code and confirming device
3123
/// activation, and PKCE (Proof Key for Code Exchange) authorization flow. Please be
3224
/// careful with this option since it will open your default system browser. This
3325
/// option might be useful if you have already enrolled and want to re-enroll using
3426
/// the same account information
35-
#[arg(long)]
27+
#[arg(long, hide = true)]
3628
pub authorization_code_flow: bool,
3729

3830
#[arg(long, hide = true)]

implementations/rust/ockam/ockam_command/src/cluster/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::{docs, Command, CommandGlobalOpts};
1414
const LONG_ABOUT: &str = include_str!("./static/long_about.txt");
1515
const AFTER_LONG_HELP: &str = include_str!("./static/after_long_help.txt");
1616

17-
/// Manage Clusters
17+
/// Manage your cluster in autonomy.
1818
#[derive(Clone, Debug, Args)]
1919
#[command(
2020
arg_required_else_help = true,

implementations/rust/ockam/ockam_command/src/cluster/show.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@ use serde::Serialize;
1313
use std::sync::Arc;
1414

1515
const LONG_ABOUT: &str = include_str!("./static/show/long_about.txt");
16-
const PREVIEW_TAG: &str = include_str!("../static/preview_tag.txt");
1716
const AFTER_LONG_HELP: &str = include_str!("./static/show/after_long_help.txt");
1817

19-
/// Show the details of a cluster
18+
/// Show status of your cluster in autonomy.
2019
#[derive(Clone, Debug, Args)]
2120
#[command(
2221
long_about = docs::about(LONG_ABOUT),
23-
before_help = docs::before_help(PREVIEW_TAG),
2422
after_long_help = docs::after_help(AFTER_LONG_HELP)
2523
)]
2624
pub struct ShowCommand {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Enroll with your cluster in autonomy.
2+
3+
This command enrolls the default identity of this machine with your cluster
4+
in autonomy. Running it will give you the ability to manage your cluster from
5+
this machine. Once this machine is enrolled, it can deploy new zones.
6+
7+
If no default identity exists on this machine, this command will first create
8+
a new vault and a new identity. It will store the secrets of that identity in
9+
the new vault. It will also mark that new identity as the default identity of
10+
this machine. Finally, it will use that is new identity to enroll this machine
11+
with your cluster in autonomy.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Manage your cluster in autonomy.

0 commit comments

Comments
 (0)