The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

REST API using proxy returns 403

Dani Asztalos
Contributor
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
Dani Asztalos
Contributor
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
Contributor
February 21, 2024

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

DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events