Skip to content

Commit

Permalink
Improve async tasks
Browse files Browse the repository at this point in the history
Update runbook
Remove redundancies
  • Loading branch information
vsivanandharao committed Sep 6, 2024
1 parent 454e289 commit 2750702
Show file tree
Hide file tree
Showing 19 changed files with 814 additions and 309 deletions.
29 changes: 29 additions & 0 deletions doc_gen/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,35 @@ Squire

.. automodule:: pyninja.squire

PyNinja - Monitor
=================

Authenticator
=============

.. automodule:: pyninja.monitor.authenticator

Configuration
=============

.. autoclass:: pyninja.monitor.config.Static(BaseModel)
:exclude-members: _abc_impl, model_config, model_fields, model_computed_fields

====

.. automodule:: pyninja.monitor.config
:exclude-members: Static

Routes
======

.. automodule:: pyninja.monitor.routes

Secure
======

.. automodule:: pyninja.monitor.secure

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

Expand Down
29 changes: 29 additions & 0 deletions docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,35 @@ Squire

.. automodule:: pyninja.squire

PyNinja - Monitor
=================

Authenticator
=============

.. automodule:: pyninja.monitor.authenticator

Configuration
=============

.. autoclass:: pyninja.monitor.config.Static(BaseModel)
:exclude-members: _abc_impl, model_config, model_fields, model_computed_fields

====

.. automodule:: pyninja.monitor.config
:exclude-members: Static

Routes
======

.. automodule:: pyninja.monitor.routes

Secure
======

.. automodule:: pyninja.monitor.secure

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

Expand Down
133 changes: 108 additions & 25 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ <h1 id="index">Index</h1>
<div class="genindex-jumpbox">
<a href="#_"><strong>_</strong></a>
| <a href="#A"><strong>A</strong></a>
| <a href="#B"><strong>B</strong></a>
| <a href="#C"><strong>C</strong></a>
| <a href="#D"><strong>D</strong></a>
| <a href="#E"><strong>E</strong></a>
Expand Down Expand Up @@ -90,15 +91,31 @@ <h2 id="A">A</h2>
</ul></td>
</tr></table>

<h2 id="B">B</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.monitor.secure.base64_decode">base64_decode() (in module pyninja.monitor.secure)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.monitor.secure.base64_encode">base64_encode() (in module pyninja.monitor.secure)</a>
</li>
</ul></td>
</tr></table>

<h2 id="C">C</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.models.WSSession.client_auth">client_auth (pyninja.models.WSSession attribute)</a>
<li><a href="index.html#pyninja.monitor.secure.calculate_hash">calculate_hash() (in module pyninja.monitor.secure)</a>
</li>
<li><a href="index.html#pyninja.models.Payload.command">command (pyninja.models.Payload attribute)</a>
<li><a href="index.html#pyninja.monitor.config.clear_session">clear_session() (in module pyninja.monitor.config)</a>
</li>
<li><a href="index.html#pyninja.models.WSSession.client_auth">client_auth (pyninja.models.WSSession attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.models.Payload.command">command (pyninja.models.Payload attribute)</a>
</li>
<li><a href="index.html#pyninja.models.complexity_checker">complexity_checker() (in module pyninja.models)</a>
</li>
<li><a href="index.html#pyninja.models.WSSettings.cpu_interval">cpu_interval (pyninja.models.WSSettings attribute)</a>
Expand Down Expand Up @@ -139,26 +156,32 @@ <h2 id="E">E</h2>
</li>
<li><a href="index.html#pyninja.models.EnvConfig.Config">EnvConfig.Config (class in pyninja.models)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.squire.envfile_loader">envfile_loader() (in module pyninja.squire)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.auth.EPOCH">EPOCH() (in module pyninja.auth)</a>
</li>
<li><a href="index.html#pyninja.monitor.routes.error_endpoint">error_endpoint() (in module pyninja.monitor.routes)</a>
</li>
<li><a href="index.html#pyninja.models.EnvConfig.Config.extra">extra (pyninja.models.EnvConfig.Config attribute)</a>
</li>
<li><a href="index.html#pyninja.monitor.authenticator.extract_credentials">extract_credentials() (in module pyninja.monitor.authenticator)</a>
</li>
</ul></td>
</tr></table>

<h2 id="F">F</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.models.Session.forbid">forbid (pyninja.models.Session attribute)</a>
<li><a href="index.html#pyninja.monitor.authenticator.failed_auth_counter">failed_auth_counter() (in module pyninja.monitor.authenticator)</a>
</li>
<li><a href="index.html#pyninja.auth.forbidden">forbidden() (in module pyninja.auth)</a>
<li><a href="index.html#pyninja.models.Session.forbid">forbid (pyninja.models.Session attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.auth.forbidden">forbidden() (in module pyninja.auth)</a>
</li>
<li><a href="index.html#pyninja.squire.format_nos">format_nos() (in module pyninja.squire)</a>
</li>
<li><a href="index.html#pyninja.models.EnvConfig.from_env_file">from_env_file() (pyninja.models.EnvConfig class method)</a>
Expand All @@ -169,7 +192,7 @@ <h2 id="F">F</h2>
<h2 id="G">G</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.routers.generate_cookie">generate_cookie() (in module pyninja.routers)</a>
<li><a href="index.html#pyninja.monitor.authenticator.generate_cookie">generate_cookie() (in module pyninja.monitor.authenticator)</a>
</li>
<li><a href="index.html#pyninja.dockerized.get_all_containers">get_all_containers() (in module pyninja.dockerized)</a>
</li>
Expand All @@ -182,6 +205,8 @@ <h2 id="G">G</h2>
<li><a href="index.html#pyninja.dockerized.get_container_status">get_container_status() (in module pyninja.dockerized)</a>
</li>
<li><a href="index.html#pyninja.routers.get_cpu">get_cpu() (in module pyninja.routers)</a>
</li>
<li><a href="index.html#pyninja.monitor.config.get_expiry">get_expiry() (in module pyninja.monitor.config)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
Expand All @@ -208,10 +233,14 @@ <h2 id="H">H</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.auth.handle_auth_error">handle_auth_error() (in module pyninja.auth)</a>
</li>
<li><a href="index.html#pyninja.routers.health">health() (in module pyninja.routers)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.routers.health">health() (in module pyninja.routers)</a>
<li><a href="index.html#pyninja.monitor.secure.hex_decode">hex_decode() (in module pyninja.monitor.secure)</a>
</li>
<li><a href="index.html#pyninja.monitor.secure.hex_encode">hex_encode() (in module pyninja.monitor.secure)</a>
</li>
<li><a href="index.html#pyninja.models.EnvConfig.Config.hide_input_in_errors">hide_input_in_errors (pyninja.models.EnvConfig.Config attribute)</a>
</li>
Expand All @@ -223,11 +252,13 @@ <h2 id="I">I</h2>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.auth.incrementer">incrementer() (in module pyninja.auth)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.models.Session.info">info (pyninja.models.Session attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.rate_limit.RateLimiter.init">init() (pyninja.rate_limit.RateLimiter method)</a>
</li>
<li><a href="index.html#pyninja.models.WSSession.invalid">invalid (pyninja.models.WSSession attribute)</a>
</li>
</ul></td>
</tr></table>
Expand All @@ -249,13 +280,19 @@ <h2 id="L">L</h2>
</li>
<li><a href="index.html#pyninja.models.ServiceManager.Linux">Linux (pyninja.models.ServiceManager attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.squire.load_env">load_env() (in module pyninja.squire)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.models.EnvConfig.log_config">log_config (pyninja.models.EnvConfig attribute)</a>
</li>
<li><a href="index.html#pyninja.routers.logout">logout() (in module pyninja.routers)</a>
<li><a href="index.html#pyninja.monitor.config.Static.login_endpoint">login_endpoint (pyninja.monitor.config.Static attribute)</a>
</li>
<li><a href="index.html#pyninja.monitor.routes.login_endpoint">login_endpoint() (in module pyninja.monitor.routes)</a>
</li>
<li><a href="index.html#pyninja.monitor.config.Static.logout_endpoint">logout_endpoint (pyninja.monitor.config.Static attribute)</a>
</li>
<li><a href="index.html#pyninja.monitor.routes.logout_endpoint">logout_endpoint() (in module pyninja.monitor.routes)</a>
</li>
</ul></td>
</tr></table>
Expand Down Expand Up @@ -286,6 +323,14 @@ <h2 id="M">M</h2>
<li><a href="index.html#module-pyninja.main">pyninja.main</a>
</li>
<li><a href="index.html#module-pyninja.models">pyninja.models</a>
</li>
<li><a href="index.html#module-pyninja.monitor.authenticator">pyninja.monitor.authenticator</a>
</li>
<li><a href="index.html#module-pyninja.monitor.config">pyninja.monitor.config</a>
</li>
<li><a href="index.html#module-pyninja.monitor.routes">pyninja.monitor.routes</a>
</li>
<li><a href="index.html#module-pyninja.monitor.secure">pyninja.monitor.secure</a>
</li>
<li><a href="index.html#module-pyninja.process">pyninja.process</a>
</li>
Expand All @@ -300,7 +345,9 @@ <h2 id="M">M</h2>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.routers.monitor">monitor() (in module pyninja.routers)</a>
<li><a href="index.html#pyninja.monitor.config.Static.monitor_endpoint">monitor_endpoint (pyninja.monitor.config.Static attribute)</a>
</li>
<li><a href="index.html#pyninja.monitor.routes.monitor_endpoint">monitor_endpoint() (in module pyninja.monitor.routes)</a>
</li>
<li><a href="index.html#pyninja.models.EnvConfig.monitor_password">monitor_password (pyninja.models.EnvConfig attribute)</a>
</li>
Expand Down Expand Up @@ -370,8 +417,6 @@ <h2 id="P">P</h2>
<li><a href="index.html#module-pyninja.exceptions">module</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
pyninja.main

Expand All @@ -384,6 +429,36 @@ <h2 id="P">P</h2>

<ul>
<li><a href="index.html#module-pyninja.models">module</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
pyninja.monitor.authenticator

<ul>
<li><a href="index.html#module-pyninja.monitor.authenticator">module</a>
</li>
</ul></li>
<li>
pyninja.monitor.config

<ul>
<li><a href="index.html#module-pyninja.monitor.config">module</a>
</li>
</ul></li>
<li>
pyninja.monitor.routes

<ul>
<li><a href="index.html#module-pyninja.monitor.routes">module</a>
</li>
</ul></li>
<li>
pyninja.monitor.secure

<ul>
<li><a href="index.html#module-pyninja.monitor.secure">module</a>
</li>
</ul></li>
<li>
Expand Down Expand Up @@ -427,16 +502,22 @@ <h2 id="P">P</h2>
<h2 id="R">R</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.monitor.authenticator.raise_error">raise_error() (in module pyninja.monitor.authenticator)</a>
</li>
<li><a href="index.html#pyninja.models.EnvConfig.rate_limit">rate_limit (pyninja.models.EnvConfig attribute)</a>
</li>
<li><a href="index.html#pyninja.models.RateLimit">RateLimit (class in pyninja.models)</a>
</li>
<li><a href="index.html#pyninja.rate_limit.RateLimiter">RateLimiter (class in pyninja.rate_limit)</a>
</li>
<li><a href="index.html#pyninja.models.WSSettings.refresh_interval">refresh_interval (pyninja.models.WSSettings attribute)</a>
<li><a href="index.html#pyninja.main.redirect_exception_handler">redirect_exception_handler() (in module pyninja.main)</a>
</li>
<li><a href="index.html#pyninja.exceptions.RedirectException">RedirectException</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.models.WSSettings.refresh_interval">refresh_interval (pyninja.models.WSSettings attribute)</a>
</li>
<li><a href="index.html#pyninja.models.EnvConfig.remote_execution">remote_execution (pyninja.models.EnvConfig attribute)</a>
</li>
<li><a href="index.html#pyninja.database.remove_record">remove_record() (in module pyninja.database)</a>
Expand All @@ -462,14 +543,20 @@ <h2 id="S">S</h2>
<li><a href="index.html#pyninja.models.ServiceManager">ServiceManager (class in pyninja.models)</a>
</li>
<li><a href="index.html#pyninja.models.ServiceStatus">ServiceStatus (class in pyninja.models)</a>
</li>
<li><a href="index.html#pyninja.models.Session">Session (class in pyninja.models)</a>
</li>
<li><a href="index.html#pyninja.monitor.authenticator.session_error">session_error() (in module pyninja.monitor.authenticator)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.models.Session">Session (class in pyninja.models)</a>
<li><a href="index.html#pyninja.exceptions.SessionError">SessionError</a>
</li>
<li><a href="index.html#pyninja.squire.size_converter">size_converter() (in module pyninja.squire)</a>
</li>
<li><a href="index.html#pyninja.main.start">start() (in module pyninja.main)</a>
</li>
<li><a href="index.html#pyninja.monitor.config.Static">Static (class in pyninja.monitor.config)</a>
</li>
<li><a href="index.html#pyninja.models.ServiceStatus.status_code">status_code (pyninja.models.ServiceStatus attribute)</a>
</li>
Expand All @@ -482,10 +569,6 @@ <h2 id="S">S</h2>

<h2 id="T">T</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.models.WSSettings.template">template (pyninja.models.WSSettings attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.models.Payload.timeout">timeout (pyninja.models.Payload attribute)</a>
</li>
Expand All @@ -509,19 +592,19 @@ <h2 id="U">U</h2>
<h2 id="V">V</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.routers.validate_session">validate_session() (in module pyninja.routers)</a>
<li><a href="index.html#pyninja.monitor.authenticator.validate_session">validate_session() (in module pyninja.monitor.authenticator)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.routers.verify_monitor_creds">verify_monitor_creds() (in module pyninja.routers)</a>
<li><a href="index.html#pyninja.monitor.authenticator.verify_login">verify_login() (in module pyninja.monitor.authenticator)</a>
</li>
</ul></td>
</tr></table>

<h2 id="W">W</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.routers.websocket_endpoint">websocket_endpoint() (in module pyninja.routers)</a>
<li><a href="index.html#pyninja.monitor.routes.websocket_endpoint">websocket_endpoint() (in module pyninja.monitor.routes)</a>
</li>
<li><a href="index.html#pyninja.models.ServiceManager.windows">windows (pyninja.models.ServiceManager attribute)</a>
</li>
Expand Down
Loading

0 comments on commit 2750702

Please sign in to comment.