Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Fixes

- (snapshots) Stop sending Sentry auth token to Objectstore ([#3286](https://github.com/getsentry/sentry-cli/pull/3286))

## 3.4.1

### Improvements
Expand Down
8 changes: 0 additions & 8 deletions src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,14 +450,6 @@ impl AuthenticatedApi<'_> {
self.api.request(method, url, None)
}

/// Returns the auth info for use in external service authorization.
pub fn auth(&self) -> &Auth {
self.api
.config
.get_auth()
.expect("AuthenticatedApi can only be constructed when auth exists")
}

// High-level method implementations

/// Performs an API request to verify the authentication status of the
Expand Down
18 changes: 2 additions & 16 deletions src/commands/build/snapshots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use sha2::{Digest as _, Sha256};
use walkdir::WalkDir;

use crate::api::{Api, CreateSnapshotResponse, ImageMetadata, SnapshotsManifest};
use crate::config::{Auth, Config};
use crate::config::Config;
use crate::utils::args::ArgExt as _;
use crate::utils::build_vcs::collect_git_metadata;
use crate::utils::ci::is_ci;
Expand Down Expand Up @@ -336,22 +336,8 @@ fn upload_images(
if let Some(token) = options.objectstore.auth_token {
builder = builder.token(token.expose_secret().to_owned());
}
let builder = builder;

let sentry_token = match authenticated_api.auth() {
Auth::Token(token) => token.raw().expose_secret().to_owned(),
};
let sentry_token = format!("Bearer {sentry_token}")
.parse()
// Ignore original error to avoid leaking the token (even though it's invalid)
.map_err(|_| anyhow::anyhow!("Invalid auth token"))?;
let client = builder
.configure_reqwest(|r| {
let mut headers = http::HeaderMap::new();
headers.insert(http::header::AUTHORIZATION, sentry_token);
r.connect_timeout(Duration::from_secs(10))
.default_headers(headers)
})
.configure_reqwest(|r| r.connect_timeout(Duration::from_secs(10)))
.build()?;

let scopes = options.objectstore.scopes;
Expand Down
Loading