Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't retrieve spec from a private Nexus repository #252

Closed
aleksimo opened this issue Dec 21, 2022 · 7 comments · Fixed by #264
Closed

Can't retrieve spec from a private Nexus repository #252

aleksimo opened this issue Dec 21, 2022 · 7 comments · Fixed by #264
Labels
bug Something isn't working help wanted PRs are encouraged and will be accepted integration

Comments

@aleksimo
Copy link
Contributor

Hello there,

I am trying to integrate an API spec from a Nexus repo via Redocusaurus.
In Docusaurus, I have the following config:

'redocusaurus',
      {
        // Plugin Options for loading OpenAPI files
        specs: [
          {
            id: 'api',
            config: 'redocly.yaml',
            spec: 'https://repository.mycompany.com/content/groups/bla-bla/0.0.9/openapi.yaml',
            route: '/api/',
          },
}

As the Nexus repo requires authentication, in the root, I have added redocly.yaml with the resolve object and provided credentials. But this solution still results in error 401.

resolve:
  http:
    headers:
      - matches: https://repository.mycompany.com/**
        name: Authorization
        envVariable: Basic SOMEKEY

The logs from NODE_DEBUG=http,http2 npm start show that the header is empty and that the config is not attached. Though, when creating both redocly.yaml and .redocly.yaml in the project's root, I get the anticipated error.

What can be the problem here?
Thank you in advance.

@rohit-gohri rohit-gohri added bug Something isn't working integration labels Dec 21, 2022
@rohit-gohri
Copy link
Owner

It's a bug/missing feature. We don't pass the redocly options when loading specs - https://github.com/rohit-gohri/redocusaurus/blob/e94fc14255993467f73f839af86af8437139293d/packages/docusaurus-plugin-redoc/src/index.ts#LL66C42-L66C42

Will have to update that

@aleksimo
Copy link
Contributor Author

Wow, thank you for such a quick reply. I will be waiting for the fix.

@rohit-gohri rohit-gohri added the help wanted PRs are encouraged and will be accepted label Dec 21, 2022
@rohit-gohri
Copy link
Owner

I don't actively use this package now so it may be a while before I can fix this. But will be happy to merge a PR if you want to try your hand at it.

@aleksimo
Copy link
Contributor Author

No problem, we are already resolving this via a CI/CD tool but I hoped there could be a documented option working. I'm a techwriter, so it'll take some time for a PR from me to appear:)

@rohit-gohri
Copy link
Owner

Can you try the test release in this PR - #264 (comment) ?

@aleksimo
Copy link
Contributor Author

I tried, and it worked. Thank you so much!
Be aware that when running a website via npm start and with the applied config, the API pages that fetch specs from authenticated remote sources may not be rendered. But, when I execute npm run build and run the built website with npm run serve, everything works just fine. I've left a comment about that in your repo.

@rohit-gohri
Copy link
Owner

Should be live in v1.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted PRs are encouraged and will be accepted integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants