Skip to content

Commit d965c4c

Browse files
revert auth json (#6883)
### Description We're currently blocked from shipping due to issues found with the `auth.json` code. We believe all of the issues have been addressed, but we should do some due diligence and dogfood a canary for a bit before cutting a release. We have some fixes that we need to get out and want the release to be solid without accidentally introducing some auth related regressions. ### Testing Instructions I believe these are all the auth.json related PRs and gets us back to a known good state. Closes TURBO-1989
1 parent 06211a7 commit d965c4c

File tree

39 files changed

+846
-1632
lines changed

39 files changed

+846
-1632
lines changed

Cargo.lock

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

crates/turborepo-api-client/src/lib.rs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ use serde::Deserialize;
1313
use turborepo_ci::{is_ci, Vendor};
1414
use turborepo_vercel_api::{
1515
APIError, CachingStatus, CachingStatusResponse, PreflightResponse, SpacesResponse, Team,
16-
TeamsResponse, TokenMetadata, TokenMetadataResponse, UserResponse, VerificationResponse,
17-
VerifiedSsoUser,
16+
TeamsResponse, UserResponse, VerificationResponse, VerifiedSsoUser,
1817
};
1918
use url::Url;
2019

@@ -33,7 +32,6 @@ lazy_static! {
3332

3433
#[async_trait]
3534
pub trait Client {
36-
fn base_url(&self) -> &str;
3735
async fn get_user(&self, token: &str) -> Result<UserResponse>;
3836
async fn get_teams(&self, token: &str) -> Result<TeamsResponse>;
3937
async fn get_team(&self, token: &str, team_id: &str) -> Result<Option<Team>>;
@@ -46,7 +44,6 @@ pub trait Client {
4644
) -> Result<CachingStatusResponse>;
4745
async fn get_spaces(&self, token: &str, team_id: Option<&str>) -> Result<SpacesResponse>;
4846
async fn verify_sso_token(&self, token: &str, token_name: &str) -> Result<VerifiedSsoUser>;
49-
async fn get_token_metadata(&self, token: &str) -> Result<TokenMetadata>;
5047
#[allow(clippy::too_many_arguments)]
5148
async fn put_artifact(
5249
&self,
@@ -108,24 +105,6 @@ pub struct APIAuth {
108105

109106
#[async_trait]
110107
impl Client for APIClient {
111-
fn base_url(&self) -> &str {
112-
&self.base_url
113-
}
114-
async fn get_token_metadata(&self, token: &str) -> Result<TokenMetadata> {
115-
let url = self.make_url("/v5/user/tokens/current");
116-
let request_builder = self
117-
.client
118-
.get(url)
119-
.header("User-Agent", self.user_agent.clone())
120-
.header("Authorization", format!("Bearer {}", token))
121-
.header("Content-Type", "application/json");
122-
let response = retry::make_retryable_request(request_builder)
123-
.await?
124-
.error_for_status()?;
125-
let json: TokenMetadataResponse = response.json().await?;
126-
127-
Ok(json.token)
128-
}
129108
async fn get_user(&self, token: &str) -> Result<UserResponse> {
130109
let url = self.make_url("/v2/user");
131110
let request_builder = self

crates/turborepo-auth/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,13 @@ async-trait.workspace = true
1313
axum-server = { workspace = true }
1414
axum.workspace = true
1515
chrono.workspace = true
16-
dirs-next = "2.0.0"
1716
hostname = "0.3.1"
1817
lazy_static.workspace = true
1918
reqwest.workspace = true
2019
serde.workspace = true
21-
serde_json.workspace = true
22-
tempfile.workspace = true
2320
thiserror = "1.0.38"
2421
tokio.workspace = true
2522
tracing.workspace = true
26-
turbopath = { workspace = true }
2723
turborepo-api-client = { workspace = true }
2824
turborepo-ui.workspace = true
2925
turborepo-vercel-api = { workspace = true }

0 commit comments

Comments
 (0)