Skip to content

Commit 281b15d

Browse files
committed
delete pro and free tag
1 parent 730456e commit 281b15d

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

crates/chat-cli/src/cli/user.rs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ use crate::auth::builder_id::{
3232
BuilderIdToken,
3333
PollCreateToken,
3434
TokenType,
35+
is_idc_user,
3536
poll_create_token,
3637
start_device_authorization,
3738
};
@@ -62,7 +63,7 @@ use crate::util::{
6263

6364
#[derive(Args, Debug, PartialEq, Eq, Clone, Default)]
6465
pub struct LoginArgs {
65-
/// License type (pro for Identity Center, free for Builder ID)
66+
/// License type (Identity Center and Builder ID)
6667
#[arg(long, value_enum)]
6768
pub license: Option<LicenseType>,
6869

@@ -75,7 +76,7 @@ pub struct LoginArgs {
7576
pub region: Option<String>,
7677

7778
/// Social provider (google or github)
78-
#[arg(long, value_enum)]
79+
#[arg(long, value_enum, hide = true)]
7980
pub social: Option<SocialProvider>,
8081

8182
/// Always use the OAuth device flow for authentication. Useful for instances where browser
@@ -137,8 +138,8 @@ impl LoginArgs {
137138

138139
// Show menu for BuilderID or IdC only
139140
let login_method = match self.license {
140-
Some(LicenseType::Free) => AuthMethod::BuilderId,
141-
Some(LicenseType::Pro) => AuthMethod::IdentityCenter,
141+
Some(LicenseType::BuilderId) => AuthMethod::BuilderId,
142+
Some(LicenseType::Idc) => AuthMethod::IdentityCenter,
142143
None => {
143144
if self.identity_provider.is_some() && self.region.is_some() {
144145
// If license is specified and --identity-provider and --region are specified,
@@ -325,17 +326,15 @@ impl WhoamiArgs {
325326

326327
#[derive(Debug, Clone, Copy, PartialEq, Eq, clap::ValueEnum)]
327328
pub enum LicenseType {
328-
/// Free license with Builder ID
329-
Free,
330-
/// Pro license with Identity Center
331-
Pro,
329+
/// License with Builder ID
330+
BuilderId,
331+
/// License with Identity Center
332+
Idc,
332333
}
333334

334335
pub async fn profile(os: &mut Os) -> Result<ExitCode> {
335-
if let Ok(Some(token)) = BuilderIdToken::load(&os.database, Some(&os.telemetry)).await {
336-
if matches!(token.token_type(), TokenType::BuilderId) {
337-
bail!("This command is only available for Pro users");
338-
}
336+
if !is_idc_user(&os.database).await {
337+
bail!("This command is only available for IAM Identity Center users");
339338
}
340339

341340
select_profile_interactive(os, false).await?;
@@ -357,8 +356,8 @@ enum AuthMethod {
357356
impl Display for AuthMethod {
358357
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
359358
match self {
360-
AuthMethod::BuilderId => write!(f, "Use for Free with Builder ID"),
361-
AuthMethod::IdentityCenter => write!(f, "Use with Pro license"),
359+
AuthMethod::BuilderId => write!(f, "Use with Builder ID"),
360+
AuthMethod::IdentityCenter => write!(f, "Use with Idc Account"),
362361
AuthMethod::Social(SocialProvider::Google) => write!(f, "Use with Google"),
363362
AuthMethod::Social(SocialProvider::Github) => write!(f, "Use with GitHub"),
364363
}

0 commit comments

Comments
 (0)