Skip to content

Commit

Permalink
Revert "feat(api): Validate Auth Tokens client-side (#1885)" (#1889)
Browse files Browse the repository at this point in the history
  • Loading branch information
szokeasaurusrex authored Jan 5, 2024
1 parent 4ee79ca commit af03399
Show file tree
Hide file tree
Showing 21 changed files with 81 additions and 623 deletions.
168 changes: 6 additions & 162 deletions Cargo.lock

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

4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ prettytable-rs = "0.10.0"
proguard = { version = "5.0.0", features = ["uuid"] }
r2d2 = "0.8.10"
rayon = "1.6.1"
regex = "1.7.3"
regex = "1.7.1"
runas = "1.0.0"
rust-ini = "0.18.0"
semver = "1.0.16"
Expand Down Expand Up @@ -83,9 +83,7 @@ chrono-tz = "0.8.4"
insta = { version = "1.26.0", features = ["redactions", "yaml"] }
mockito = "0.31.1"
predicates = "2.1.5"
rstest = "0.18.2"
tempfile = "3.8.1"
testing_logger = "0.1.1"
trycmd = "0.14.11"

[features]
Expand Down
4 changes: 2 additions & 2 deletions src/commands/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn make_command(command: Command) -> Command {

fn update_config(config: &Config, token: &str) -> Result<()> {
let mut new_cfg = config.clone();
new_cfg.set_auth(Auth::Token(token.into()))?;
new_cfg.set_auth(Auth::Token(token.to_string()))?;
new_cfg.save()?;
Ok(())
}
Expand Down Expand Up @@ -68,7 +68,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
};

let test_cfg = config.make_copy(|cfg| {
cfg.set_auth(Auth::Token(token.clone().into()))?;
cfg.set_auth(Auth::Token(token.to_string()))?;
Ok(())
})?;

Expand Down
4 changes: 1 addition & 3 deletions src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use log::{debug, info, set_logger, set_max_level, LevelFilter};
use crate::api::Api;
use crate::config::{Auth, Config};
use crate::constants::{ARCH, PLATFORM, VERSION};
use crate::utils::auth_token::AuthToken;
use crate::utils::logging::set_quiet_mode;
use crate::utils::logging::Logger;
use crate::utils::system::{init_backtrace, load_dotenv, print_error, QuietExit};
Expand Down Expand Up @@ -108,7 +107,7 @@ fn configure_args(config: &mut Config, matches: &ArgMatches) -> Result<()> {
config.set_auth(Auth::Key(api_key.to_owned()))?;
}

if let Some(auth_token) = matches.get_one::<AuthToken>("auth_token") {
if let Some(auth_token) = matches.get_one::<String>("auth_token") {
config.set_auth(Auth::Token(auth_token.to_owned()))?;
}

Expand Down Expand Up @@ -162,7 +161,6 @@ fn app() -> Command {
.value_name("AUTH_TOKEN")
.long("auth-token")
.global(true)
.value_parser(value_parser!(AuthToken))
.help("Use the given Sentry auth token."),
)
.arg(
Expand Down
Loading

0 comments on commit af03399

Please sign in to comment.