Skip to content

Commit a2b0be2

Browse files
yuvrajjsingh0ayushjain17
authored andcommitted
fix: use superposition bearer token
1 parent a9214fc commit a2b0be2

6 files changed

Lines changed: 1 addition & 62 deletions

File tree

Cargo.lock

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

airborne_server/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ aws-config = { version = "1.1.7", features = ["behavior-version-latest"] }
1414
aws-sdk-cloudfront = "1.81.0"
1515
aws-sdk-kms = "1.65.0"
1616
aws-sdk-s3 = "1.106.0"
17-
aws-smithy-runtime-api = { version = "1.2.5", features = ["client"] }
1817
aws-smithy-types = "1.2.5"
1918
base64 = "0.22"
2019
bytes = "1"

airborne_server/src/config.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ pub struct AppConfig {
6464
pub superposition_url: String,
6565
pub superposition_org_id: String,
6666
pub superposition_token: Option<String>,
67-
pub superposition_user_token: Option<String>,
68-
pub superposition_org_token: Option<String>,
6967
pub enable_authenticated_superposition: bool,
7068
pub superposition_clear_unused_providers: bool,
7169
pub superposition_unused_provider_ttl: u64,
@@ -213,8 +211,6 @@ impl AppConfig {
213211
superposition_url: get_env("SUPERPOSITION_URL", None)?,
214212
superposition_org_id: get_env("SUPERPOSITION_ORG_ID", None)?,
215213
superposition_token: get_optional_secret("SUPERPOSITION_TOKEN")?,
216-
superposition_user_token: get_optional_secret("SUPERPOSITION_USER_TOKEN")?,
217-
superposition_org_token: get_optional_secret("SUPERPOSITION_ORG_TOKEN")?,
218214
enable_authenticated_superposition: parse_env(
219215
"ENABLE_AUTHENTICATED_SUPERPOSITION",
220216
false,

airborne_server/src/main.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ use crate::{
6969
},
7070
},
7171
utils::{
72-
interceptor::CookieIntercept,
7372
metrics::push_metrics_task,
7473
migrations::{
7574
get_default_configs_from_file, migrate_superposition, SuperpositionMigrationStrategy,
@@ -374,25 +373,11 @@ async fn main() -> std::io::Result<()> {
374373
}
375374

376375
let superposition_client = if app_config.enable_authenticated_superposition {
377-
let superposition_user_token = app_config.superposition_user_token.clone().expect(
378-
"SUPERPOSITION_USER_TOKEN must be set when ENABLE_AUTHENTICATED_SUPERPOSITION=true",
379-
);
380-
let superposition_org_token = app_config.superposition_org_token.clone().expect(
381-
"SUPERPOSITION_ORG_TOKEN must be set when ENABLE_AUTHENTICATED_SUPERPOSITION=true",
382-
);
383-
384-
// Inject Auth cookie for Superposition SDK calls
385-
let cookie_interceptor = CookieIntercept::new(format!(
386-
"user={}; org_{}={}",
387-
superposition_user_token, superposition_org_id_env, superposition_org_token,
388-
));
389-
390376
superposition_sdk::Client::from_conf(
391377
SrsConfig::builder()
392-
.bearer_token("abcd".into())
378+
.bearer_token(superposition_token.clone().into())
393379
.endpoint_url(cac_url.clone())
394380
.behavior_version_latest()
395-
.interceptor(cookie_interceptor)
396381
.build(),
397382
)
398383
} else {

airborne_server/src/utils.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pub mod advisory_lock;
1616
pub mod db;
1717
pub mod document;
1818
pub mod encryption;
19-
pub mod interceptor;
2019
pub mod keycloak;
2120
pub mod kms;
2221
pub mod metrics;

airborne_server/src/utils/interceptor.rs

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)