Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zenitysec/sphinx-rego

Sphinx extension that automatically documents Open Policy Agent Rego policies
https://github.com/zenitysec/sphinx-rego

conftest documentation-tool opa open-policy-agent open-policy-agent-python rego sphinx

Last synced: 24 days ago
JSON representation

Sphinx extension that automatically documents Open Policy Agent Rego policies

Awesome Lists containing this project

README

        

sphinx-rego
===============

A sphinx extension that automatically documents Open Policy Agent Rego policies using the _rego_metadoc_ property.

Maintained by [Zenity](https://zenity.io).

# Example

See [example/](/example) dir for a documented usage example.

![Sphinx Docs](/example/assets/policy.small.png)

# Prerequisites

- Install [Open Policy Agent](https://www.openpolicyagent.org/docs/latest/#1-download-opa)
- Make sure the `opa` CLI is available

# Installation:

Install with PIP

``` commandline
pip3 install sphinx-rego
```

Add to Sphinx `conf.py`
``` python
extensions += ["sphinxrego.ext"]
```

# Usage Example:
```
.. rego::
:policy: policies/**/*.rego
:norecursive:
:nocustom:
```

# Arguments:

_policy_: glob pathname to search for .rego policies with _rego_metadoc_ property

_norecursive_: whether to use glob recursive option

_norecursive_: whether to include custom properties