Skip to content

Commit

Permalink
Merge pull request #237 from stakwork/fix/add-admin-token-to-all-bolt…
Browse files Browse the repository at this point in the history
…wall-request

fix: added x-admin-token to all boltwall request
  • Loading branch information
tobi-bams authored Jun 20, 2024
2 parents c763d6b + 6310dd9 commit d5bab86
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/conn/boltwall/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,18 @@ pub async fn update_boltwall_accessibility(img: &BoltwallImage, is_public: bool)
}

pub async fn get_boltwall_accessibility(img: &BoltwallImage) -> Result<String> {
let admin_token = img.admin_token.clone().context(anyhow!("No admin token"))?;

let client = make_client();
let host = docker_domain(&img.name);

let route = format!("http://{}:{}/getPublicPrivate", host, img.port);

let response = client.get(route.as_str()).send().await?;
let response = client
.get(route.as_str())
.header("x-admin-token", admin_token)
.send()
.await?;

let response_text = response.text().await?;

Expand All @@ -245,12 +251,18 @@ pub async fn get_feature_flags(img: &BoltwallImage) -> Result<String> {
}

pub async fn get_second_brain_about_details(img: &BoltwallImage) -> Result<String> {
let admin_token = img.admin_token.clone().context(anyhow!("No admin token"))?;

let client = make_client();
let host = docker_domain(&img.name);

let route = format!("http://{}:{}/about", host, img.port);

let response = client.get(route.as_str()).send().await?;
let response = client
.get(route.as_str())
.header("x-admin-token", admin_token)
.send()
.await?;

let response_text = response.text().await?;

Expand Down

0 comments on commit d5bab86

Please sign in to comment.