Skip to content

Commit

Permalink
Add user create and delete subcommands to iggy cmd (#265)
Browse files Browse the repository at this point in the history
Add iggy user create with options for setting permissions and iggy
user delete commands with integration tests.
  • Loading branch information
BartoszCiesla authored Nov 8, 2023
1 parent 7a49f11 commit 929961e
Show file tree
Hide file tree
Showing 22 changed files with 2,355 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cmd"
version = "0.8.0"
version = "0.9.0"
edition = "2021"
authors = ["[email protected]"]
repository = "https://github.com/iggy-rs/iggy"
Expand Down
6 changes: 6 additions & 0 deletions cmd/src/args/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
pub(crate) mod common;
pub(crate) mod partition;
pub(crate) mod permissions;
pub(crate) mod personal_access_token;
pub(crate) mod stream;
pub(crate) mod system;
pub(crate) mod topic;
pub(crate) mod user;

use self::user::UserAction;
use crate::args::{
partition::PartitionAction, personal_access_token::PersonalAccessTokenAction,
stream::StreamAction, system::PingArgs, topic::TopicAction,
Expand Down Expand Up @@ -83,6 +86,9 @@ pub(crate) enum Command {
/// personal access token operations
#[clap(subcommand)]
Pat(PersonalAccessTokenAction),
/// user operations
#[clap(subcommand)]
User(UserAction),
}

impl IggyConsoleArgs {
Expand Down
28 changes: 28 additions & 0 deletions cmd/src/args/permissions/constants.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
pub(crate) const MANAGE_SERVERS_SHORT: &str = "m_srv";
pub(crate) const MANAGE_SERVERS_LONG: &str = "manage_servers";
pub(crate) const READ_SERVERS_SHORT: &str = "r_srv";
pub(crate) const READ_SERVERS_LONG: &str = "read_servers";
pub(crate) const MANAGE_USERS_SHORT: &str = "m_usr";
pub(crate) const MANAGE_USERS_LONG: &str = "manage_users";
pub(crate) const READ_USERS_SHORT: &str = "r_usr";
pub(crate) const READ_USERS_LONG: &str = "read_users";
pub(crate) const MANAGE_STREAMS_SHORT: &str = "m_str";
pub(crate) const MANAGE_STREAMS_LONG: &str = "manage_streams";
pub(crate) const READ_STREAMS_SHORT: &str = "r_str";
pub(crate) const READ_STREAMS_LONG: &str = "read_streams";
pub(crate) const MANAGE_TOPICS_SHORT: &str = "m_top";
pub(crate) const MANAGE_TOPICS_LONG: &str = "manage_topics";
pub(crate) const READ_TOPICS_SHORT: &str = "r_top";
pub(crate) const READ_TOPICS_LONG: &str = "read_topics";
pub(crate) const POLL_MESSAGES_SHORT: &str = "p_msg";
pub(crate) const POLL_MESSAGES_LONG: &str = "poll_messages";
pub(crate) const SEND_MESSAGES_SHORT: &str = "s_msg";
pub(crate) const SEND_MESSAGES_LONG: &str = "send_messages";
pub(crate) const MANAGE_STREAM_SHORT: &str = "m_str";
pub(crate) const MANAGE_STREAM_LONG: &str = "manage_stream";
pub(crate) const READ_STREAM_SHORT: &str = "r_str";
pub(crate) const READ_STREAM_LONG: &str = "read_stream";
pub(crate) const MANAGE_TOPIC_SHORT: &str = "m_top";
pub(crate) const MANAGE_TOPIC_LONG: &str = "manage_topic";
pub(crate) const READ_TOPIC_SHORT: &str = "r_top";
pub(crate) const READ_TOPIC_LONG: &str = "read_topic";
Loading

0 comments on commit 929961e

Please sign in to comment.