Skip to content

Commit af03399

Browse files
Revert "feat(api): Validate Auth Tokens client-side (#1885)" (#1889)
1 parent 4ee79ca commit af03399

21 files changed

+81
-623
lines changed

Cargo.lock

Lines changed: 6 additions & 162 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ prettytable-rs = "0.10.0"
5454
proguard = { version = "5.0.0", features = ["uuid"] }
5555
r2d2 = "0.8.10"
5656
rayon = "1.6.1"
57-
regex = "1.7.3"
57+
regex = "1.7.1"
5858
runas = "1.0.0"
5959
rust-ini = "0.18.0"
6060
semver = "1.0.16"
@@ -83,9 +83,7 @@ chrono-tz = "0.8.4"
8383
insta = { version = "1.26.0", features = ["redactions", "yaml"] }
8484
mockito = "0.31.1"
8585
predicates = "2.1.5"
86-
rstest = "0.18.2"
8786
tempfile = "3.8.1"
88-
testing_logger = "0.1.1"
8987
trycmd = "0.14.11"
9088

9189
[features]

src/commands/login.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub fn make_command(command: Command) -> Command {
2020

2121
fn update_config(config: &Config, token: &str) -> Result<()> {
2222
let mut new_cfg = config.clone();
23-
new_cfg.set_auth(Auth::Token(token.into()))?;
23+
new_cfg.set_auth(Auth::Token(token.to_string()))?;
2424
new_cfg.save()?;
2525
Ok(())
2626
}
@@ -68,7 +68,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
6868
};
6969

7070
let test_cfg = config.make_copy(|cfg| {
71-
cfg.set_auth(Auth::Token(token.clone().into()))?;
71+
cfg.set_auth(Auth::Token(token.to_string()))?;
7272
Ok(())
7373
})?;
7474

src/commands/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use log::{debug, info, set_logger, set_max_level, LevelFilter};
1212
use crate::api::Api;
1313
use crate::config::{Auth, Config};
1414
use crate::constants::{ARCH, PLATFORM, VERSION};
15-
use crate::utils::auth_token::AuthToken;
1615
use crate::utils::logging::set_quiet_mode;
1716
use crate::utils::logging::Logger;
1817
use crate::utils::system::{init_backtrace, load_dotenv, print_error, QuietExit};
@@ -108,7 +107,7 @@ fn configure_args(config: &mut Config, matches: &ArgMatches) -> Result<()> {
108107
config.set_auth(Auth::Key(api_key.to_owned()))?;
109108
}
110109

111-
if let Some(auth_token) = matches.get_one::<AuthToken>("auth_token") {
110+
if let Some(auth_token) = matches.get_one::<String>("auth_token") {
112111
config.set_auth(Auth::Token(auth_token.to_owned()))?;
113112
}
114113

@@ -162,7 +161,6 @@ fn app() -> Command {
162161
.value_name("AUTH_TOKEN")
163162
.long("auth-token")
164163
.global(true)
165-
.value_parser(value_parser!(AuthToken))
166164
.help("Use the given Sentry auth token."),
167165
)
168166
.arg(

0 commit comments

Comments
 (0)