awslabs / aws-api-gateway-developer-portal

A Serverless Developer Portal for easily publishing and cataloging APIs
Apache License 2.0
924 stars 399 forks source link

Update vulnerable dependencies, simplify Markdown parsing #483

Closed ghost closed 3 years ago

ghost commented 3 years ago

Issue #, if available:

Description of changes:

Should resolve several Dependabot updates. I've omitted a few, but they're very low-risk.

The react-markdown update was very non-trivial with two major versions worth of breaking changes, so I decided it'd be a better use of time to just replace it and its underlying remark parser with Marked, a much more stable parser (it's had no major breaking change in years), and just use that directly rather than going through a third party component. Also, DOMPurify just happened to already exist, so adding it as a dependency doesn't actually bloat the bundle any. I've tested the changes and have manually verified it works as desired, including ensuring that Swagger API descriptions are sanitized of scripting and other similarly dangerous stuff.

Also added a couple features:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.