Skip to content

Commit b383d38

Browse files
lcianclaude
andauthored
fix(snapshots): Remove Sentry auth token from objectstore client (#3286)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3a7d03f commit b383d38

3 files changed

Lines changed: 8 additions & 24 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- (snapshots) Stop sending Sentry auth token to Objectstore ([#3286](https://github.com/getsentry/sentry-cli/pull/3286))
8+
39
## 3.4.1
410

511
### Improvements

src/api/mod.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -450,14 +450,6 @@ impl AuthenticatedApi<'_> {
450450
self.api.request(method, url, None)
451451
}
452452

453-
/// Returns the auth info for use in external service authorization.
454-
pub fn auth(&self) -> &Auth {
455-
self.api
456-
.config
457-
.get_auth()
458-
.expect("AuthenticatedApi can only be constructed when auth exists")
459-
}
460-
461453
// High-level method implementations
462454

463455
/// Performs an API request to verify the authentication status of the

src/commands/build/snapshots.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use sha2::{Digest as _, Sha256};
1818
use walkdir::WalkDir;
1919

2020
use crate::api::{Api, CreateSnapshotResponse, ImageMetadata, SnapshotsManifest};
21-
use crate::config::{Auth, Config};
21+
use crate::config::Config;
2222
use crate::utils::args::ArgExt as _;
2323
use crate::utils::build_vcs::collect_git_metadata;
2424
use crate::utils::ci::is_ci;
@@ -336,22 +336,8 @@ fn upload_images(
336336
if let Some(token) = options.objectstore.auth_token {
337337
builder = builder.token(token.expose_secret().to_owned());
338338
}
339-
let builder = builder;
340-
341-
let sentry_token = match authenticated_api.auth() {
342-
Auth::Token(token) => token.raw().expose_secret().to_owned(),
343-
};
344-
let sentry_token = format!("Bearer {sentry_token}")
345-
.parse()
346-
// Ignore original error to avoid leaking the token (even though it's invalid)
347-
.map_err(|_| anyhow::anyhow!("Invalid auth token"))?;
348339
let client = builder
349-
.configure_reqwest(|r| {
350-
let mut headers = http::HeaderMap::new();
351-
headers.insert(http::header::AUTHORIZATION, sentry_token);
352-
r.connect_timeout(Duration::from_secs(10))
353-
.default_headers(headers)
354-
})
340+
.configure_reqwest(|r| r.connect_timeout(Duration::from_secs(10)))
355341
.build()?;
356342

357343
let scopes = options.objectstore.scopes;

0 commit comments

Comments
 (0)