I am writing a pipe that creates a report using commit/{id}/reports endpoint. I also want to create a build status reflecting the status of the report (passing/failing). The report endpoint works with the proxy on port 29418, but the request to commit/{id}/statuses/build returns status code Forbidden with the following error in body:
{"data": {"key": "INSUFFICIENT_RIGHTS"}, "type": "error", "error": {"message": "Access denied. You must have write or admin access.", "data": {"key": "INSUFFICIENT_RIGHTS"}}}
There is no proper documentation regarding the proxy anywhere... What scopes are available through the proxy? Is my only option to create a OAuth consumer and use it instead of the proxy?
@Amit Edelshtein there are two possible reasons:
- api endpoint you're using is not allowed to use with proxy
- user is not recognized when going through proxy. check user's permissions. Also, what authentication are you using? Check out how reports sub endpoints are used in one of our pipes (https://bitbucket.org/atlassian/checkstyle-report/src/66bc4e4048df4dd57cb111813871c992d0656ad5/src/main/java/com/atlassian/bitbucket/pipelines/checkstyle/report/Main.java#lines-136,
If you want actually to integrate with bitbucket code-insights where report is pushed, you may follow this way, like in our pipe https://bitbucket.org/atlassian/git-secrets-scan/src/69461ac7e1a17e14023a6fede3d9f9a51d64deec/pipe/pipe.py#lines-34
Also, check out if report plugin is turned on in your repo.
I guess, that perhaps it is that you want because reports url in official bitbucket api does not officially declare POST request https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/commit/%7Bcommit%7D/reports
Cheers, Galyna
I appreciate your answer @Halyna Berezovska .
However, the report and annotations endpoints work fine for me using the proxy. The error I am getting is from commit/{id}/statuses/build endpoint when using the proxy.
So I assume the proxy is somehow limited, but I could not find documentation detailing what are the limits of the proxy - is it certain scopes? Certain APIs?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
while debugging a similar issue I came across your post. It turns out only the Reports API can be used through the proxy. It is written in the docs, although one could argue it is not the most clearly written information there...
Using Bitbucket Pipelines allows you to use the Reports-API without extra authentication.
I also found feature request BCLOUD-21842 where you can vote for the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.