Open ericwb opened 1 month ago
Note, this PR is a draft because its utilizing a few hacks to enable it to work properly. Once https://github.com/sphinx-extensions2/sphinx-pyscript/pull/6 has merged and a release issued to PyPI, then this change could be more appropriately merged.
This change introduces a new playground in the docs where a user can test out Bandit right within their browser. This code uses PyScript (and sphinx-pyscript) to generate an editor window on a sphinx page in our docs. When the user clicks the play button, it runs Bandit against the example code they have provided.
If Bandit finds issues it renders them in a box on the same page under the editable code.
The editor windows by default includes an example of correct and incorrect usage of ssl context.