Skip to content

Commit

Permalink
patch(meroctl): remove unnecessary commands
Browse files Browse the repository at this point in the history
  • Loading branch information
petarjuki7 committed Jan 27, 2025
1 parent bcf74fb commit 5b3dc1e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 55 deletions.
28 changes: 3 additions & 25 deletions crates/meroctl/src/cli/context/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,8 @@ pub struct GetCommand {

#[derive(Debug, Parser)]
pub enum GetSubcommand {
#[command(about = "Get context details")]
Context,

#[command(about = "Get context users")]
Users,
#[command(about = "Get context information")]
Info,

#[command(about = "Get client keys")]
ClientKeys,
Expand Down Expand Up @@ -85,14 +82,10 @@ impl GetCommand {
let client = Client::new();

match self.command {
GetSubcommand::Context => {
GetSubcommand::Info => {
self.get_context(environment, multiaddr, &client, &config.identity)
.await
}
GetSubcommand::Users => {
self.get_users(environment, multiaddr, &client, &config.identity)
.await
}
GetSubcommand::ClientKeys => {
self.get_client_keys(environment, multiaddr, &client, &config.identity)
.await
Expand Down Expand Up @@ -123,21 +116,6 @@ impl GetCommand {
.await
}

async fn get_users(
&self,
environment: &Environment,
multiaddr: &Multiaddr,
client: &Client,
keypair: &Keypair,
) -> EyreResult<()> {
let url = multiaddr_to_url(
multiaddr,
&format!("admin-api/dev/contexts/{}/users", self.context_id),
)?;
self.make_request::<GetContextUsersResponse>(environment, client, url, keypair)
.await
}

async fn get_client_keys(
&self,
environment: &Environment,
Expand Down
1 change: 0 additions & 1 deletion crates/server/src/admin/handlers/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pub mod get_context;
pub mod get_context_client_keys;
pub mod get_context_identities;
pub mod get_context_storage;
pub mod get_context_users;
pub mod get_contexts;
pub mod invite_to_context;
pub mod join_context;
Expand Down
19 changes: 0 additions & 19 deletions crates/server/src/admin/handlers/context/get_context_users.rs

This file was deleted.

11 changes: 1 addition & 10 deletions crates/server/src/admin/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ use crate::admin::handlers::applications::{
use crate::admin::handlers::challenge::request_challenge_handler;
use crate::admin::handlers::context::{
create_context, delete_context, get_context, get_context_client_keys, get_context_identities,
get_context_storage, get_context_users, get_contexts, invite_to_context, join_context,
update_context_application,
get_context_storage, get_contexts, invite_to_context, join_context, update_context_application,
};
use crate::admin::handlers::did::fetch_did_handler;
use crate::admin::handlers::identity::generate_context_identity;
Expand Down Expand Up @@ -114,10 +113,6 @@ pub(crate) fn setup(
.route("/contexts", post(create_context::handler))
.route("/contexts/:context_id", delete(delete_context::handler))
.route("/contexts/:context_id", get(get_context::handler))
.route(
"/contexts/:context_id/users",
get(get_context_users::handler),
)
.route(
"/contexts/:context_id/client-keys",
get(get_context_client_keys::handler),
Expand Down Expand Up @@ -215,10 +210,6 @@ pub(crate) fn setup(
)
.route("/dev/applications", get(list_applications::handler))
.route("/dev/contexts/:context_id", get(get_context::handler))
.route(
"/dev/contexts/:context_id/users",
get(get_context_users::handler),
)
.route(
"/dev/contexts/:context_id/client-keys",
get(get_context_client_keys::handler),
Expand Down

0 comments on commit 5b3dc1e

Please sign in to comment.