Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
mkdocs-render-swagger-plugin
Advanced tools
This is the Mkdocs plugin for rendering swagger & openapi schemas using Swagger UI. It is written in Python.
Install the plugin using pip install mkdocs-render-swagger-plugin
.
Add the following lines to your mkdocs.yml:
plugins:
- render_swagger
Here's an example (courtesy of Scarf) of how the plugin renders swagger.
Place an OpenAPI json file in the same folder as the .md
file.
Enter !!swagger FILENAME!!
at the appropriate location inside the markdown file.
If you wish to reference any files on the filesytem (security risk), make sure
you enable allow_arbitrary_locations
in the config (mkdocs.yml) like so:
plugins:
- render_swagger:
allow_arbitrary_locations : true
You may reference an external OpenAPI json using the following syntax: !!swagger-http URL!!
.
You can explicitly specify the swagger-ui css and js dependencies if you wish to not use the unpkg CDN.
To specify this use javascript
and css
in your mkdocs.yaml:
plugins:
- render_swagger:
javascript: assets/js/swagger-ui-bundle.js
css: assets/css/swagger-ui.css
After downloading and extracting the .tar.gz
, install this package locally using pip
and the --editable
flag:
pip install --editable ".[dev]"
You'll then have the render-swagger
package available to use in Mkdocs and pip
will point the dependency to this folder. You are then able to run the docs using mkdocs serve
. Make sure you restart the process between code changes as the plugin is loaded on startup.
The Render Swagger MkDocs plugin uses a set of extensions and plugin APIs that MkDocs and Swagger UI supports. You can find more info about MkDocs plugins and Swagger UI on the official website of MkDocs and SwaggerUI.
The input OpenAPI files processed by the plugin should conform to the OpenAPI specification. It is generated by a few projects such as pydantic, FastAPI and others.
FAQs
MKDocs plugin for rendering swagger & openapi files.
We found that mkdocs-render-swagger-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.