diff --git a/CHANGELOG.md b/CHANGELOG.md index 25b7d92f8..e502ef27d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,8 @@ All notable changes to this project will be documented in this file. ## Unreleased -- cli: `config set` accepts `--geo-program-id`; `config get` and `config set` print Geolocation Program ID -- cli: `doublezero geolocation probe ...` mirrors `doublezero-geolocation probe ...`; new `--geo-program-id` global flag - CLI + - cli: `doublezero geolocation` `probe ...` and `user ...` mirrors `doublezero-geolocation` versions; new `--geo-program-id` global flag, `config get/set` include Geolocation Program ID. - Drop the activator-only pollers from `doublezero` (user and multicastgroup activation waits). The `--wait` flag on `user create`, `user create-subscribe`, `user subscribe`, `multicastgroup create`, and `multicastgroup update` now fetches the post-create state once instead of polling — creates are atomic to `Activated` post-RFC-11, so the wait loop was watching a transition that no longer happens ([#3614](https://github.com/malbeclabs/doublezero/issues/3614)) - Trim the `Rejected` status arm from the device and link activation pollers; `Rejected` was itself an activator-driven transition ([#3614](https://github.com/malbeclabs/doublezero/issues/3614)) - Client diff --git a/client/doublezero/src/cli/geolocation/mod.rs b/client/doublezero/src/cli/geolocation/mod.rs index 0e73d4431..6f84a0cb0 100644 --- a/client/doublezero/src/cli/geolocation/mod.rs +++ b/client/doublezero/src/cli/geolocation/mod.rs @@ -1,8 +1,10 @@ use clap::{Args, Subcommand}; pub mod probe; +pub mod user; use probe::ProbeCliCommand; +use user::UserCliCommand; #[derive(Args, Debug)] pub struct GeolocationCliCommand { @@ -14,4 +16,6 @@ pub struct GeolocationCliCommand { pub enum GeolocationCommands { /// Manage geolocation probes Probe(ProbeCliCommand), + /// Manage geolocation users and targets + User(UserCliCommand), } diff --git a/client/doublezero/src/cli/geolocation/user.rs b/client/doublezero/src/cli/geolocation/user.rs new file mode 100644 index 000000000..751e075f1 --- /dev/null +++ b/client/doublezero/src/cli/geolocation/user.rs @@ -0,0 +1,36 @@ +use clap::{Args, Subcommand}; +use doublezero_cli::geolocation::user::{ + add_target::AddTargetCliCommand, create::CreateGeolocationUserCliCommand, + delete::DeleteGeolocationUserCliCommand, get::GetGeolocationUserCliCommand, + list::ListGeolocationUserCliCommand, remove_target::RemoveTargetCliCommand, + set_result_destination::SetResultDestinationCliCommand, + update::UpdateGeolocationUserCliCommand, update_payment_status::UpdatePaymentStatusCliCommand, +}; + +#[derive(Args, Debug)] +pub struct UserCliCommand { + #[command(subcommand)] + pub command: UserCommands, +} + +#[derive(Subcommand, Debug)] +pub enum UserCommands { + /// Create a new geolocation user + Create(CreateGeolocationUserCliCommand), + /// Delete a geolocation user + Delete(DeleteGeolocationUserCliCommand), + /// Update a geolocation user's payment token account + Update(UpdateGeolocationUserCliCommand), + /// Get details of a specific user + Get(GetGeolocationUserCliCommand), + /// List all geolocation users + List(ListGeolocationUserCliCommand), + /// Add a target to a user + AddTarget(AddTargetCliCommand), + /// Remove a target from a user + RemoveTarget(RemoveTargetCliCommand), + /// Set result destination for geolocation results + SetResultDestination(SetResultDestinationCliCommand), + /// Update payment status (foundation-only) + UpdatePayment(UpdatePaymentStatusCliCommand), +} diff --git a/client/doublezero/src/main.rs b/client/doublezero/src/main.rs index 964cf0cd6..7d2caf95f 100644 --- a/client/doublezero/src/main.rs +++ b/client/doublezero/src/main.rs @@ -13,7 +13,9 @@ use crate::cli::{ config::ConfigCommands, device::{DeviceCommands, InterfaceCommands}, exchange::ExchangeCommands, - geolocation::{probe::ProbeCommands, GeolocationCommands}, + geolocation::{ + probe::ProbeCommands, user::UserCommands as GeoUserCommands, GeolocationCommands, + }, globalconfig::{ AirdropCommands, AuthorityCommands, FeatureFlagsCommands, FoundationAllowlistCommands, GlobalConfigCommands, QaAllowlistCommands, @@ -373,6 +375,19 @@ async fn main() -> eyre::Result<()> { ProbeCommands::AddParent(args) => args.execute(&geo_cli, &mut handle), ProbeCommands::RemoveParent(args) => args.execute(&geo_cli, &mut handle), }, + GeolocationCommands::User(command) => match command.command { + GeoUserCommands::Create(args) => args.execute(&geo_cli, &mut handle), + GeoUserCommands::Delete(args) => args.execute(&geo_cli, &mut handle), + GeoUserCommands::Update(args) => args.execute(&geo_cli, &mut handle), + GeoUserCommands::Get(args) => args.execute(&geo_cli, &mut handle), + GeoUserCommands::List(args) => args.execute(&geo_cli, &mut handle), + GeoUserCommands::AddTarget(args) => args.execute(&geo_cli, &mut handle), + GeoUserCommands::RemoveTarget(args) => args.execute(&geo_cli, &mut handle), + GeoUserCommands::SetResultDestination(args) => { + args.execute(&geo_cli, &mut handle) + } + GeoUserCommands::UpdatePayment(args) => args.execute(&geo_cli, &mut handle), + }, } }