-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix(router, admin): Admin Swagger headers and route paths #83
Conversation
Admin's AuthMiddleware 'Authentication' header now prefixes its admin token with 'Bearer ' (previously 'JWT '). This change improves compatibility with OpenAPI and Swagger, while also improving consistency with user authentication. This is not a breaking change as backwards compatibility has been preserved.
… to shallow object copying
|
clientSecret: [], | ||
}, | ||
], | ||
security: JSON.parse(JSON.stringify(this._routerMetadata.globalSecurityHeaders)), |
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.
We could also entirely avoid repeated stringifications by just passing a pre-stringified globalSecurityHeaders
instead. Totally type hacky, but definitely worth it perf-wise.
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.
Ended up stringifying once per Swagger construction instead (that makes 2 times total).
* fix(router,admin): Admin Swagger using User headers * fix(router,admin): Admin Swagger routes not prefixed by '/admin' * chore(admin): Bearer prefix for admin Authentication header
Closes #80 and generally improves Swagger route doc generation.
/admin/
so that Swagger users no longer need to guess the proper baseUrl.This PR also converts Admin router's
Authentication
header format fromJWT adminToken
toBearer adminToken
.This change improves compatibility with OpenAPI and Swagger, while also improving consistency with user authentication.
This bit is not a breaking change as backwards compatibility has been preserved.
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
The PR fulfills these requirements:
main
branchfix #xxx
, where "xxx" is the issue number)