diff --git a/src/clients/grant.rs b/src/clients/grant.rs index f494862..98eade6 100644 --- a/src/clients/grant.rs +++ b/src/clients/grant.rs @@ -1,3 +1,5 @@ +use core::panic; + use async_trait::async_trait; use tracing::info; @@ -106,11 +108,11 @@ impl GrantClient for GrantClientLiv fn api_to_cli(role: golem_client::model::Role) -> Role { match role { golem_client::model::Role::Admin {} => Role::Admin, - golem_client::model::Role::WhitelistAdmin {} => Role::WhitelistAdmin, golem_client::model::Role::MarketingAdmin {} => Role::MarketingAdmin, golem_client::model::Role::ViewProject {} => Role::ViewProject, golem_client::model::Role::DeleteProject {} => Role::DeleteProject, golem_client::model::Role::CreateProject {} => Role::CreateProject, golem_client::model::Role::InstanceServer {} => Role::InstanceServer, + _ => panic!("Unknown role"), } } diff --git a/src/model.rs b/src/model.rs index 35199d8..8bacae6 100644 --- a/src/model.rs +++ b/src/model.rs @@ -16,7 +16,6 @@ use golem_client::template::TemplateError; use golem_client::token::TokenError; use golem_client::worker::WorkerError; use golem_examples::model::{Example, ExampleName, GuestLanguage, GuestLanguageTier}; -use indoc::indoc; use serde::{Deserialize, Serialize}; use strum::IntoEnumIterator; use strum_macros::EnumIter; @@ -141,20 +140,13 @@ impl From for GolemError { let joined = errors.join(", "); GolemError(format!("Invalid request: {joined}")) } - LoginError::Status403 { .. } => { - let msg = indoc! {" - At the moment account creation is restricted. - None of your verified emails is whitelisted. - Please contact us to create an account. - "}; - GolemError(msg.to_string()) - } LoginError::Status500 { error } => { GolemError(format!("Internal server error on Login: {error}")) } LoginError::Status401 { error } => { GolemError(format!("External service call error on Login: {error}")) } + _ => GolemError("Unexpected error on Login".to_string()), } } } @@ -550,7 +542,6 @@ pub enum TemplateIdOrName { #[derive(Copy, Clone, PartialEq, Eq, Debug, EnumIter, Serialize, Deserialize)] pub enum Role { Admin, - WhitelistAdmin, MarketingAdmin, ViewProject, DeleteProject, @@ -562,7 +553,6 @@ impl Display for Role { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { let s = match self { Role::Admin => "Admin", - Role::WhitelistAdmin => "WhitelistAdmin", Role::MarketingAdmin => "MarketingAdmin", Role::ViewProject => "ViewProject", Role::DeleteProject => "DeleteProject", @@ -580,7 +570,6 @@ impl FromStr for Role { fn from_str(s: &str) -> Result { match s { "Admin" => Ok(Role::Admin), - "WhitelistAdmin" => Ok(Role::WhitelistAdmin), "MarketingAdmin" => Ok(Role::MarketingAdmin), "ViewProject" => Ok(Role::ViewProject), "DeleteProject" => Ok(Role::DeleteProject),