-
Notifications
You must be signed in to change notification settings - Fork 77
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
Swagger UI additional middleware #636
Conversation
- Add lifecycles for additional swagger UI handling - Remove unnecessary express dependency - Split swagger plugin code into separate modules - Export interface for Swagger config so it can be extended
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No changes here; just split into a separate file because index.js
was getting a bit long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No changes here; just split into a separate file because index.js
was getting a bit long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No changes here; just split into a separate file because index.js
was getting a bit long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No changes here; just split into a separate file because index.js
was getting a bit long.
"@types/swagger-ui-express": "^4.1.3", | ||
"express": "^4.16.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is never imported.
"swagger-jsdoc": "^4.0.0", | ||
"swagger-ui-express": "^4.1.4" | ||
}, | ||
"devDependencies": { | ||
"@gasket/engine": "^6.43.0", | ||
"@gasket/plugin-log": "^6.43.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this because I changed the express
and fastify
hook tests to be more integration-y (using an actual Gasket plugin engine).
@jpage-godaddy Is this PR still relevant? Seems it got missed over time. Would like me to update it and approve? |
I think @agerard-godaddy was opposed to this idea. Slack thread for context. If you all agree you can close, but I'd be happy to keep it otherwise. |
Closed with ticket to explore solutions for this. |
Summary
Sometimes we need the ability to make Swagger UIs publicly inaccessible, but currently there's no easy way to add middleware that will intercept requests to the swagger UI routes so authentication can be injected.
Support thread for context.
Changelog
Included
Test Plan
Added unit tests. Did some sandbox local testing to ensure that
@godaddy/gasket-preset-api
worked with the new lifecycle. I couldn't get the Swagger plugin to work with fastify, so it may be broken, but if someone has an example setup that works I'll be happy to test there as well.