Skip to content

Commit 7543da6

Browse files
committed
Replace util.py with builtin method
Update README.md
1 parent 9f18a7e commit 7543da6

15 files changed

+78
-83
lines changed

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,23 @@ vaultapi start
6161
- **DATABASE** - FilePath to store the secrets' database.
6262
- **RATE_LIMIT** - List of dictionaries with `max_requests` and `seconds` to apply as rate limit.
6363

64+
<details>
65+
<summary>Auto generate a <code>SECRET</code> value</summary>
66+
67+
This value will be used to encrypt/decrypt the secrets stored in the database.
68+
69+
**CLI**
70+
```shell
71+
vaultapi keygen
72+
```
73+
74+
**IDE**
75+
```python
76+
from cryptography.fernet import Fernet
77+
print(Fernet.generate_key())
78+
```
79+
</details>
80+
6481
## Coding Standards
6582
Docstring format: [`Google`][google-docs] <br>
6683
Styling conventions: [`PEP 8`][pep8] and [`isort`][isort]

doc_gen/conf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
# -- Project information -----------------------------------------------------
1414
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
1515

16-
project = 'VaultAPI'
17-
copyright = '2024, Vignesh Rao'
18-
author = 'Vignesh Rao'
16+
project = "VaultAPI"
17+
copyright = "2024, Vignesh Rao"
18+
author = "Vignesh Rao"
1919

2020
# -- General configuration ---------------------------------------------------
2121
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

doc_gen/index.rst

-5
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,6 @@ Squire
7676

7777
.. automodule:: vaultapi.squire
7878

79-
Util
80-
====
81-
82-
.. automodule:: vaultapi.util
83-
8479
Indices and tables
8580
==================
8681

docs/README.html

+12-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,18 @@ <h2>Environment Variables<a class="headerlink" href="#environment-variables" tit
9898
<li><p><strong>DATABASE</strong> - FilePath to store the secrets’ database.</p></li>
9999
<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>
100100
</ul>
101-
</section>
101+
<details>
102+
<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>
103+
<p><strong>CLI</strong></p>
104+
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>vaultapi<span class="w"> </span>keygen
105+
</pre></div>
106+
</div>
107+
<p><strong>IDE</strong></p>
108+
<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>
109+
<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>
110+
</pre></div>
111+
</div>
112+
</details></section>
102113
<section id="coding-standards">
103114
<h2>Coding Standards<a class="headerlink" href="#coding-standards" title="Permalink to this heading"></a></h2>
104115
<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>

docs/README.md

+17-3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,23 @@ vaultapi start
6161
- **DATABASE** - FilePath to store the secrets' database.
6262
- **RATE_LIMIT** - List of dictionaries with `max_requests` and `seconds` to apply as rate limit.
6363

64+
<details>
65+
<summary>Auto generate a <code>SECRET</code> value</summary>
66+
67+
This value will be used to encrypt/decrypt the secrets stored in the database.
68+
69+
**CLI**
70+
```shell
71+
vaultapi keygen
72+
```
73+
74+
**IDE**
75+
```python
76+
from cryptography.fernet import Fernet
77+
print(Fernet.generate_key())
78+
```
79+
</details>
80+
6481
## Coding Standards
6582
Docstring format: [`Google`][google-docs] <br>
6683
Styling conventions: [`PEP 8`][pep8] and [`isort`][isort]
@@ -106,8 +123,6 @@ pre-commit run --all-files
106123

107124
Licensed under the [MIT License][license]
108125

109-
[//]: # (Labels)
110-
111126
[label-actions-markdown]: https://github.com/thevickypedia/VaultAPI/actions/workflows/markdown.yaml/badge.svg
112127
[label-pypi-package]: https://img.shields.io/badge/Pypi%20Package-VaultAPI-blue?style=for-the-badge&logo=Python
113128
[label-sphinx-doc]: https://img.shields.io/badge/Made%20with-Sphinx-blue?style=for-the-badge&logo=Sphinx
@@ -135,4 +150,3 @@ Licensed under the [MIT License][license]
135150
[pypi-repo]: https://packaging.python.org/tutorials/packaging-projects/
136151
[license]: https://github.com/thevickypedia/VaultAPI/blob/master/LICENSE
137152
[runbook]: https://thevickypedia.github.io/VaultAPI/
138-
[samples]: https://github.com/thevickypedia/VaultAPI/tree/main/samples

docs/_sources/README.md.txt

+17-3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,23 @@ vaultapi start
6161
- **DATABASE** - FilePath to store the secrets' database.
6262
- **RATE_LIMIT** - List of dictionaries with `max_requests` and `seconds` to apply as rate limit.
6363

64+
<details>
65+
<summary>Auto generate a <code>SECRET</code> value</summary>
66+
67+
This value will be used to encrypt/decrypt the secrets stored in the database.
68+
69+
**CLI**
70+
```shell
71+
vaultapi keygen
72+
```
73+
74+
**IDE**
75+
```python
76+
from cryptography.fernet import Fernet
77+
print(Fernet.generate_key())
78+
```
79+
</details>
80+
6481
## Coding Standards
6582
Docstring format: [`Google`][google-docs] <br>
6683
Styling conventions: [`PEP 8`][pep8] and [`isort`][isort]
@@ -106,8 +123,6 @@ pre-commit run --all-files
106123

107124
Licensed under the [MIT License][license]
108125

109-
[//]: # (Labels)
110-
111126
[label-actions-markdown]: https://github.com/thevickypedia/VaultAPI/actions/workflows/markdown.yaml/badge.svg
112127
[label-pypi-package]: https://img.shields.io/badge/Pypi%20Package-VaultAPI-blue?style=for-the-badge&logo=Python
113128
[label-sphinx-doc]: https://img.shields.io/badge/Made%20with-Sphinx-blue?style=for-the-badge&logo=Sphinx
@@ -135,4 +150,3 @@ Licensed under the [MIT License][license]
135150
[pypi-repo]: https://packaging.python.org/tutorials/packaging-projects/
136151
[license]: https://github.com/thevickypedia/VaultAPI/blob/master/LICENSE
137152
[runbook]: https://thevickypedia.github.io/VaultAPI/
138-
[samples]: https://github.com/thevickypedia/VaultAPI/tree/main/samples

docs/_sources/index.rst.txt

-5
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,6 @@ Squire
7676

7777
.. automodule:: vaultapi.squire
7878

79-
Util
80-
====
81-
82-
.. automodule:: vaultapi.util
83-
8479
Indices and tables
8580
==================
8681

docs/genindex.html

-11
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ <h2 id="E">E</h2>
113113
<table style="width: 100%" class="indextable genindextable"><tr>
114114
<td style="width: 33%; vertical-align: top;"><ul>
115115
<li><a href="index.html#vaultapi.main.enable_cors">enable_cors() (in module vaultapi.main)</a>
116-
</li>
117-
<li><a href="index.html#vaultapi.util.encode_secret">encode_secret() (in module vaultapi.util)</a>
118116
</li>
119117
<li><a href="index.html#vaultapi.models.EnvConfig.endpoints">endpoints (vaultapi.models.EnvConfig attribute)</a>
120118
</li>
@@ -243,8 +241,6 @@ <h2 id="M">M</h2>
243241
<li><a href="index.html#module-vaultapi.routes">vaultapi.routes</a>
244242
</li>
245243
<li><a href="index.html#module-vaultapi.squire">vaultapi.squire</a>
246-
</li>
247-
<li><a href="index.html#module-vaultapi.util">vaultapi.util</a>
248244
</li>
249245
</ul></li>
250246
</ul></td>
@@ -389,13 +385,6 @@ <h2 id="V">V</h2>
389385

390386
<ul>
391387
<li><a href="index.html#module-vaultapi.squire">module</a>
392-
</li>
393-
</ul></li>
394-
<li>
395-
vaultapi.util
396-
397-
<ul>
398-
<li><a href="index.html#module-vaultapi.util">module</a>
399388
</li>
400389
</ul></li>
401390
</ul></td>

docs/index.html

-21
Original file line numberDiff line numberDiff line change
@@ -685,26 +685,6 @@ <h1>Payload<a class="headerlink" href="#payload" title="Permalink to this headin
685685
</dl>
686686
</dd></dl>
687687

688-
</section>
689-
<section id="module-vaultapi.util">
690-
<span id="util"></span><h1>Util<a class="headerlink" href="#module-vaultapi.util" title="Permalink to this heading"></a></h1>
691-
<dl class="py function">
692-
<dt class="sig sig-object py" id="vaultapi.util.encode_secret">
693-
<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>
694-
<dd><p>Encodes a key into URL safe string.</p>
695-
<dl class="field-list simple">
696-
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
697-
<dd class="field-odd"><p><strong>key</strong> – Key to be encoded.</p>
698-
</dd>
699-
<dt class="field-even">Returns<span class="colon">:</span></dt>
700-
<dd class="field-even"><p>Returns an encoded URL safe string.</p>
701-
</dd>
702-
<dt class="field-odd">Return type<span class="colon">:</span></dt>
703-
<dd class="field-odd"><p>ByteString</p>
704-
</dd>
705-
</dl>
706-
</dd></dl>
707-
708688
</section>
709689
<section id="indices-and-tables">
710690
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this heading"></a></h1>
@@ -735,7 +715,6 @@ <h3><a href="#">Table of Contents</a></h3>
735715
<li><a class="reference internal" href="#module-vaultapi.rate_limit">RateLimit</a></li>
736716
<li><a class="reference internal" href="#module-vaultapi.routes">API Routes</a></li>
737717
<li><a class="reference internal" href="#module-vaultapi.squire">Squire</a></li>
738-
<li><a class="reference internal" href="#module-vaultapi.util">Util</a></li>
739718
<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
740719
</ul>
741720

docs/objects.inv

-14 Bytes
Binary file not shown.

docs/py-modindex.html

-5
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,6 @@ <h1>Python Module Index</h1>
9898
<td>&#160;&#160;&#160;
9999
<a href="index.html#module-vaultapi.squire"><code class="xref">vaultapi.squire</code></a></td><td>
100100
<em></em></td></tr>
101-
<tr class="cg-1">
102-
<td></td>
103-
<td>&#160;&#160;&#160;
104-
<a href="index.html#module-vaultapi.util"><code class="xref">vaultapi.util</code></a></td><td>
105-
<em></em></td></tr>
106101
</table>
107102

108103

0 commit comments

Comments
 (0)