REST API using proxy returns 403

Dani Asztalos February 15, 2024

I'm creating a custom pipe, where I create a Report using the rest API and the proxies mentioned at the bottom of the Code Insights page.

  • Using the API as-is, with an Access Token in Auth header works.
  • Running it in pipelines directly through python (not in docker), with http://localhost:29418 proxy works.
  • But running it from the packaged pipe in another repository, and using the http://host.docker.internal:29418 proxy returns 403 with the following json.

 

{
"arguments": {},
"key": "report-service.general.forbidden",
"message": "Not authorized"
}

What am I doing wrong?

2 answers

1 accepted

2 votes
Answer accepted
Dani Asztalos February 21, 2024

It turned out I was passing an ACCESS TOKEN through headers and using the proxy, which resulted in 403. Removing the ACCESS TOKEN and using the proxy only resolved the issue.

1 vote
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 18, 2024

G'day, @Dani Asztalos 

Welcome to the community!

Could you try to add this to your pipe script and see if that helps?

export HTTP_PROXY=http://host.docker.internal:29418
export http_proxy=http://host.docker.internal:29418
export HTTPS_PROXY=http://host.docker.internal:29418
export https_proxy=http://host.docker.internal:29418
git config "http.${BITBUCKET_GIT_HTTP_ORIGIN}.proxy" http://host.docker.internal:29418

I believe you need to configure the git config proxy as well if it's from docker.

Regards,
Syahrul 

Dani Asztalos February 21, 2024

I am using the Rest api, not git, so setting the git proxy would not help.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events