Skip to content

Commit

Permalink
Replace util.py with builtin method
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
dormant-user committed Sep 17, 2024
1 parent 9f18a7e commit 7543da6
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 83 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,23 @@ vaultapi start
- **DATABASE** - FilePath to store the secrets' database.
- **RATE_LIMIT** - List of dictionaries with `max_requests` and `seconds` to apply as rate limit.

<details>
<summary>Auto generate a <code>SECRET</code> value</summary>

This value will be used to encrypt/decrypt the secrets stored in the database.

**CLI**
```shell
vaultapi keygen
```

**IDE**
```python
from cryptography.fernet import Fernet
print(Fernet.generate_key())
```
</details>

## Coding Standards
Docstring format: [`Google`][google-docs] <br>
Styling conventions: [`PEP 8`][pep8] and [`isort`][isort]
Expand Down
6 changes: 3 additions & 3 deletions doc_gen/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'VaultAPI'
copyright = '2024, Vignesh Rao'
author = 'Vignesh Rao'
project = "VaultAPI"
copyright = "2024, Vignesh Rao"
author = "Vignesh Rao"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
5 changes: 0 additions & 5 deletions doc_gen/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ Squire

.. automodule:: vaultapi.squire

Util
====

.. automodule:: vaultapi.util

Indices and tables
==================

Expand Down
13 changes: 12 additions & 1 deletion docs/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,18 @@ <h2>Environment Variables<a class="headerlink" href="#environment-variables" tit
<li><p><strong>DATABASE</strong> - FilePath to store the secrets’ database.</p></li>
<li><p><strong>RATE_LIMIT</strong> - List of dictionaries with <code class="docutils literal notranslate"><span class="pre">max_requests</span></code> and <code class="docutils literal notranslate"><span class="pre">seconds</span></code> to apply as rate limit.</p></li>
</ul>
</section>
<details>
<summary>Auto generate a <code>SECRET</code> value</summary><p>This value will be used to encrypt/decrypt the secrets stored in the database.</p>
<p><strong>CLI</strong></p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>vaultapi<span class="w"> </span>keygen
</pre></div>
</div>
<p><strong>IDE</strong></p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">cryptography.fernet</span> <span class="kn">import</span> <span class="n">Fernet</span>
<span class="nb">print</span><span class="p">(</span><span class="n">Fernet</span><span class="o">.</span><span class="n">generate_key</span><span class="p">())</span>
</pre></div>
</div>
</details></section>
<section id="coding-standards">
<h2>Coding Standards<a class="headerlink" href="#coding-standards" title="Permalink to this heading"></a></h2>
<p>Docstring format: <a class="reference external" href="https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings"><code class="docutils literal notranslate"><span class="pre">Google</span></code></a> <br>
Expand Down
20 changes: 17 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,23 @@ vaultapi start
- **DATABASE** - FilePath to store the secrets' database.
- **RATE_LIMIT** - List of dictionaries with `max_requests` and `seconds` to apply as rate limit.

<details>
<summary>Auto generate a <code>SECRET</code> value</summary>

This value will be used to encrypt/decrypt the secrets stored in the database.

**CLI**
```shell
vaultapi keygen
```

**IDE**
```python
from cryptography.fernet import Fernet
print(Fernet.generate_key())
```
</details>

## Coding Standards
Docstring format: [`Google`][google-docs] <br>
Styling conventions: [`PEP 8`][pep8] and [`isort`][isort]
Expand Down Expand Up @@ -106,8 +123,6 @@ pre-commit run --all-files

Licensed under the [MIT License][license]

[//]: # (Labels)

[label-actions-markdown]: https://github.com/thevickypedia/VaultAPI/actions/workflows/markdown.yaml/badge.svg
[label-pypi-package]: https://img.shields.io/badge/Pypi%20Package-VaultAPI-blue?style=for-the-badge&logo=Python
[label-sphinx-doc]: https://img.shields.io/badge/Made%20with-Sphinx-blue?style=for-the-badge&logo=Sphinx
Expand Down Expand Up @@ -135,4 +150,3 @@ Licensed under the [MIT License][license]
[pypi-repo]: https://packaging.python.org/tutorials/packaging-projects/
[license]: https://github.com/thevickypedia/VaultAPI/blob/master/LICENSE
[runbook]: https://thevickypedia.github.io/VaultAPI/
[samples]: https://github.com/thevickypedia/VaultAPI/tree/main/samples
20 changes: 17 additions & 3 deletions docs/_sources/README.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,23 @@ vaultapi start
- **DATABASE** - FilePath to store the secrets' database.
- **RATE_LIMIT** - List of dictionaries with `max_requests` and `seconds` to apply as rate limit.

<details>
<summary>Auto generate a <code>SECRET</code> value</summary>

This value will be used to encrypt/decrypt the secrets stored in the database.

**CLI**
```shell
vaultapi keygen
```

**IDE**
```python
from cryptography.fernet import Fernet
print(Fernet.generate_key())
```
</details>

## Coding Standards
Docstring format: [`Google`][google-docs] <br>
Styling conventions: [`PEP 8`][pep8] and [`isort`][isort]
Expand Down Expand Up @@ -106,8 +123,6 @@ pre-commit run --all-files

Licensed under the [MIT License][license]

[//]: # (Labels)

[label-actions-markdown]: https://github.com/thevickypedia/VaultAPI/actions/workflows/markdown.yaml/badge.svg
[label-pypi-package]: https://img.shields.io/badge/Pypi%20Package-VaultAPI-blue?style=for-the-badge&logo=Python
[label-sphinx-doc]: https://img.shields.io/badge/Made%20with-Sphinx-blue?style=for-the-badge&logo=Sphinx
Expand Down Expand Up @@ -135,4 +150,3 @@ Licensed under the [MIT License][license]
[pypi-repo]: https://packaging.python.org/tutorials/packaging-projects/
[license]: https://github.com/thevickypedia/VaultAPI/blob/master/LICENSE
[runbook]: https://thevickypedia.github.io/VaultAPI/
[samples]: https://github.com/thevickypedia/VaultAPI/tree/main/samples
5 changes: 0 additions & 5 deletions docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ Squire

.. automodule:: vaultapi.squire

Util
====

.. automodule:: vaultapi.util

Indices and tables
==================

Expand Down
11 changes: 0 additions & 11 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ <h2 id="E">E</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#vaultapi.main.enable_cors">enable_cors() (in module vaultapi.main)</a>
</li>
<li><a href="index.html#vaultapi.util.encode_secret">encode_secret() (in module vaultapi.util)</a>
</li>
<li><a href="index.html#vaultapi.models.EnvConfig.endpoints">endpoints (vaultapi.models.EnvConfig attribute)</a>
</li>
Expand Down Expand Up @@ -243,8 +241,6 @@ <h2 id="M">M</h2>
<li><a href="index.html#module-vaultapi.routes">vaultapi.routes</a>
</li>
<li><a href="index.html#module-vaultapi.squire">vaultapi.squire</a>
</li>
<li><a href="index.html#module-vaultapi.util">vaultapi.util</a>
</li>
</ul></li>
</ul></td>
Expand Down Expand Up @@ -389,13 +385,6 @@ <h2 id="V">V</h2>

<ul>
<li><a href="index.html#module-vaultapi.squire">module</a>
</li>
</ul></li>
<li>
vaultapi.util

<ul>
<li><a href="index.html#module-vaultapi.util">module</a>
</li>
</ul></li>
</ul></td>
Expand Down
21 changes: 0 additions & 21 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -685,26 +685,6 @@ <h1>Payload<a class="headerlink" href="#payload" title="Permalink to this headin
</dl>
</dd></dl>

</section>
<section id="module-vaultapi.util">
<span id="util"></span><h1>Util<a class="headerlink" href="#module-vaultapi.util" title="Permalink to this heading"></a></h1>
<dl class="py function">
<dt class="sig sig-object py" id="vaultapi.util.encode_secret">
<span class="sig-prename descclassname"><span class="pre">vaultapi.util.</span></span><span class="sig-name descname"><span class="pre">encode_secret</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">ByteString</span></span></span><a class="headerlink" href="#vaultapi.util.encode_secret" title="Permalink to this definition"></a></dt>
<dd><p>Encodes a key into URL safe string.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>key</strong> – Key to be encoded.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Returns an encoded URL safe string.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>ByteString</p>
</dd>
</dl>
</dd></dl>

</section>
<section id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this heading"></a></h1>
Expand Down Expand Up @@ -735,7 +715,6 @@ <h3><a href="#">Table of Contents</a></h3>
<li><a class="reference internal" href="#module-vaultapi.rate_limit">RateLimit</a></li>
<li><a class="reference internal" href="#module-vaultapi.routes">API Routes</a></li>
<li><a class="reference internal" href="#module-vaultapi.squire">Squire</a></li>
<li><a class="reference internal" href="#module-vaultapi.util">Util</a></li>
<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
</ul>

Expand Down
Binary file modified docs/objects.inv
Binary file not shown.
5 changes: 0 additions & 5 deletions docs/py-modindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@ <h1>Python Module Index</h1>
<td>&#160;&#160;&#160;
<a href="index.html#module-vaultapi.squire"><code class="xref">vaultapi.squire</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="index.html#module-vaultapi.util"><code class="xref">vaultapi.util</code></a></td><td>
<em></em></td></tr>
</table>


Expand Down
Loading

0 comments on commit 7543da6

Please sign in to comment.