Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Open Api Document plugin in Confluence using SSH repo for source

Dinio Dinev November 5, 2020

Hi all,

in my corporate Confluence I want to use OpenApi Documentation plugin

In the configurations I put:

URL: https://bitbucket.neterra.corp.com/projects/SS/sss/ddd/browse/apis/yyy-yyy.yaml

GitHub Access Token: put the BitBucket access token for the repo from the URL

But I have:

Failed to load API definition.

I tried with username/password but the same result.

 

Is it possible to do that to access BitBucket resource using accessToken and to create a reference in the COnfluence's Open Api Documentation Plugin?

 

2 answers

1 vote
Scott August 20, 2021

Hi Dinio & Luca,

We are the creators of the Open API Documentation for Confluence plugin (there are a few other Swagger plugins in the Marketplace, so it may be that you are using ours or one of our competitors).

Dinio - Bitbucket Server does have a few known issues because it doesn't properly deal with CORS requests (e.g. by default it doesn't handle OPTIONS requests).

CORS is a standard browser security feature that prevents Javascript code running in one domain (e.g. your Confluence server) from accessing resources in another domain (e.g. your Bitbucket server), without first getting permissions. It gets these permissions through a series of "Access-Control-*" headers, in both the request (from the browser displaying your Confluence page) and the response (from your Bitbucket server that has your YAML/JSON file).

In the case where your Bitbucket repository is not publicly accessible (i.e. requires a username + password), your browser must first perform what is called a "preflight" OPTIONS request to get the right permissions, and Bitbucket Server doesn't accept OPTIONS requests by default.  There are workarounds that involve using a proxy in front of your Bitbucket Server to deal with this.

 

Luca - GitLab is supported, and we have some details in our documentation on how to configure the macro.

https://oharagroup.bitbucket.io/confluence-open-api/#git

 

I hope this information is useful.

 

Kind regards,

Scott

0 votes
Luca Saba August 20, 2021

I'm having the same issue. I'm using GitLab and a project token.

By enabling the developer toolbar I can see that the request doesn't contain the required header (PRIVATE-TOKEN in my case).

Since this information is not provided, Gitlab correctly returns an HTTP 404 error message

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events