feat: docs
304
docs/v1/cli_commands-quart-imp_blueprint.html
Normal file
@@ -0,0 +1,304 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Generate A Quart-Imp Blueprint | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">Generate a Quart-Imp Blueprint</h1>
|
||||
<p>Quart-Imp has its own type of blueprint. It comes with some methods to auto import routes, and nested blueprints etc...
|
||||
see <a href="impblueprint-introduction.html">ImpBlueprint / Introduction</a> for more information.</p>
|
||||
<p>You have the option to generate a regular template rendering blueprint, or a API blueprint that returns a JSON response.</p>
|
||||
<div class="highlight"><pre><span></span>quart-imp<span class="w"> </span>blueprint<span class="w"> </span>--help
|
||||
</pre></div>
|
||||
<p>or</p>
|
||||
<div class="highlight"><pre><span></span>quart-imp<span class="w"> </span>api-blueprint<span class="w"> </span>--help
|
||||
</pre></div>
|
||||
<p>To generate a Quart-Imp blueprint, run the following command:</p>
|
||||
<div class="highlight"><pre><span></span>quart-imp<span class="w"> </span>blueprint
|
||||
</pre></div>
|
||||
<p>or</p>
|
||||
<div class="highlight"><pre><span></span>quart-imp<span class="w"> </span>api-blueprint
|
||||
</pre></div>
|
||||
<p>After running this command, you will be prompted to enter the location of where you want to create your blueprint:</p>
|
||||
<div class="highlight"><pre><span></span>~ $ quart-imp blueprint
|
||||
(Creation is relative to the current working directory)
|
||||
Folder to create blueprint in [Current Working Directory]:
|
||||
</pre></div>
|
||||
<p>As detailed in the prompt, the creation of the blueprint is relative to the current working directory. So to create a
|
||||
blueprint in the folder <code>app/blueprints</code>, you would enter <code>app/blueprints</code> in the prompt.</p>
|
||||
<div class="highlight"><pre><span></span>~ $ quart-imp blueprint
|
||||
(Creation is relative to the current working directory)
|
||||
Folder to create blueprint in [Current Working Directory]: app/blueprints
|
||||
</pre></div>
|
||||
<p>You will then be prompted to enter a name for your blueprint:</p>
|
||||
<div class="highlight"><pre><span></span>~ $ quart-imp blueprint
|
||||
...
|
||||
Name of the blueprint to create [my_new_blueprint]:
|
||||
</pre></div>
|
||||
<p>The default name is 'my_new_blueprint', we will change this to 'admin'</p>
|
||||
<div class="highlight"><pre><span></span>~ $ quart-imp blueprint
|
||||
...
|
||||
Name of the blueprint to create [my_new_blueprint]: admin
|
||||
</pre></div>
|
||||
<p>After creating your blueprint, the folder structure will look like this:</p>
|
||||
<div class="highlight"><pre><span></span>app/
|
||||
├── blueprints
|
||||
│ └── admin
|
||||
│ ├── routes
|
||||
│ │ └── index.py
|
||||
│ │
|
||||
│ ├── static
|
||||
│ │ ├── css
|
||||
│ │ │ └── water.css
|
||||
│ │ ├── img
|
||||
│ │ │ └── quart-imp-logo.png
|
||||
│ │ └── js
|
||||
│ │ └── main.js
|
||||
│ │
|
||||
│ ├── templates
|
||||
│ │ └── www
|
||||
│ │ ├── extends
|
||||
│ │ │ └── main.html
|
||||
│ │ ├── includes
|
||||
│ │ │ ├── footer.html
|
||||
│ │ │ └── header.html
|
||||
│ │ └── index.html
|
||||
│ │
|
||||
│ └── __init__.py
|
||||
│
|
||||
...
|
||||
</pre></div>
|
||||
<p>This is a self-contained blueprint, so it has its own static, templates and routes folders.
|
||||
You can now navigate '/admin'</p>
|
||||
<p>You can streamline this process by specifying the name of the blueprint, the folder to
|
||||
create it in and the configuration to use, like so:</p>
|
||||
<div class="highlight"><pre><span></span>quart-imp<span class="w"> </span>blueprint<span class="w"> </span>-n<span class="w"> </span>admin<span class="w"> </span>-f<span class="w"> </span>app/blueprints
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
398
docs/v1/cli_commands-quart-imp_init.html
Normal file
@@ -0,0 +1,398 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Initialising A Quart-Imp Project | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">Initialising a Quart-Imp Project</h1>
|
||||
<p>Quart-Imp has a cli command that deploys a new ready-to-go project.
|
||||
This project is structured in a way to give you the best idea of
|
||||
how to use Quart-Imp.</p>
|
||||
<div class="highlight"><pre><span></span>quart-imp<span class="w"> </span>init<span class="w"> </span>--help
|
||||
</pre></div>
|
||||
<h2>Create a new project</h2>
|
||||
<p>Make sure you are in the virtual environment, and at the root of your
|
||||
project folder, then run the following command:</p>
|
||||
<div class="highlight"><pre><span></span>quart-imp<span class="w"> </span>init
|
||||
</pre></div>
|
||||
<p>After running this command, you will be prompted to choose what type of
|
||||
app you want to deploy:</p>
|
||||
<div class="highlight"><pre><span></span>~ $ quart-imp init
|
||||
What type of app would you like to create? (minimal, slim, full) [minimal]:
|
||||
</pre></div>
|
||||
<p>See below for the differences between the app types.</p>
|
||||
<p>After this, you will be prompted to enter a name for your app:</p>
|
||||
<div class="highlight"><pre><span></span>~ $ quart-imp init
|
||||
...
|
||||
What would you like to call your app? [app]:
|
||||
</pre></div>
|
||||
<p>'app' is the default name, so if you just press enter, your app will be
|
||||
called 'app'. You will then see this output:</p>
|
||||
<div class="highlight"><pre><span></span>~ FILES CREATED WILL LOOP OUT HERE ~
|
||||
|
||||
===================
|
||||
Quart app deployed!
|
||||
===================
|
||||
|
||||
Your app has the default name of 'app'
|
||||
Quart will automatically look for this!
|
||||
Run: quart run --debug
|
||||
</pre></div>
|
||||
<p>If you called your app something other than 'app', like 'new' for example, you will see:</p>
|
||||
<div class="highlight"><pre><span></span>~ FILES CREATED WILL LOOP OUT HERE ~
|
||||
|
||||
===================
|
||||
Quart app deployed!
|
||||
===================
|
||||
|
||||
Your app has the name of 'new'
|
||||
Run: quart --app new run --debug
|
||||
</pre></div>
|
||||
<p>As you can see from the output, it gives you instructions on how to start your app,
|
||||
depending on the name you gave it.</p>
|
||||
<p>You should see a new folder that has been given the name you specified in
|
||||
the <code>quart-imp init</code> command.</p>
|
||||
<h3>Additional options</h3>
|
||||
<p>You can also specify a name for your app in the command itself, like so:</p>
|
||||
<div class="highlight"><pre><span></span>quart-imp<span class="w"> </span>init<span class="w"> </span>-n<span class="w"> </span>my_app
|
||||
</pre></div>
|
||||
<p>This will create a new app called 'my_app'.
|
||||
The default will be a minimal app, this has no blueprints.</p>
|
||||
<p>You can also deploy a slim app, that will have one blueprint, like so:</p>
|
||||
<div class="highlight"><pre><span></span>quart-imp<span class="w"> </span>init<span class="w"> </span>-n<span class="w"> </span>my_app<span class="w"> </span>--slim
|
||||
</pre></div>
|
||||
<p>You can also deploy a full app that is setup for multiple blueprints, like so:</p>
|
||||
<div class="highlight"><pre><span></span>quart-imp<span class="w"> </span>init<span class="w"> </span>-n<span class="w"> </span>my_app<span class="w"> </span>--full
|
||||
</pre></div>
|
||||
<h2>init Folder structures</h2>
|
||||
<h3>Minimal app (default)</h3>
|
||||
<p><code>quart-imp init --minimal</code>:</p>
|
||||
<div class="highlight"><pre><span></span>app/
|
||||
├── resources
|
||||
│ ├── static
|
||||
│ │ ├── css
|
||||
│ │ │ └── water.css
|
||||
│ │ ├── img
|
||||
│ │ │ └── quart-imp-logo.png
|
||||
│ │ └── favicon.ico
|
||||
│ ├── templates
|
||||
│ │ └── index.html
|
||||
│ └── routes.py
|
||||
│
|
||||
└── __init__.py
|
||||
</pre></div>
|
||||
<h3>Slim app</h3>
|
||||
<p><code>quart-imp init --slim</code>:</p>
|
||||
<div class="highlight"><pre><span></span>app/
|
||||
├── extensions
|
||||
│ └── __init__.py
|
||||
│
|
||||
├── resources
|
||||
│ ├── cli
|
||||
│ │ └── cli.py
|
||||
│ ├── error_handlers
|
||||
│ │ └── error_handlers.py
|
||||
│ ├── static
|
||||
│ │ ├── css
|
||||
│ │ │ └── water.css
|
||||
│ │ ├── img
|
||||
│ │ │ └── quart-imp-logo.png
|
||||
│ │ └── favicon.ico
|
||||
│ └── templates
|
||||
│ └── error.html
|
||||
│
|
||||
├── www
|
||||
│ ├── __init__.py
|
||||
│ ├── routes
|
||||
│ │ └── index.py
|
||||
│ ├── static
|
||||
│ │ ├── css
|
||||
│ │ │ └── water.css
|
||||
│ │ ├── img
|
||||
│ │ │ └── quart-imp-logo.png
|
||||
│ │ └── js
|
||||
│ │ └── main.js
|
||||
│ └── templates
|
||||
│ └── www
|
||||
│ ├── extends
|
||||
│ │ └── main.html
|
||||
│ ├── includes
|
||||
│ │ ├── footer.html
|
||||
│ │ └── header.html
|
||||
│ └── index.html
|
||||
│
|
||||
└── __init__.py
|
||||
</pre></div>
|
||||
<h3>Full app</h3>
|
||||
<p><code>quart-imp init --full</code>:</p>
|
||||
<div class="highlight"><pre><span></span>app/
|
||||
├── blueprints
|
||||
│ └── www
|
||||
│ ├── __init__.py
|
||||
│ ├── routes
|
||||
│ │ └── index.py
|
||||
│ ├── static
|
||||
│ │ ├── css
|
||||
│ │ │ └── water.css
|
||||
│ │ ├── img
|
||||
│ │ │ └── quart-imp-logo.png
|
||||
│ │ └── js
|
||||
│ │ └── main.js
|
||||
│ └── templates
|
||||
│ └── www
|
||||
│ ├── extends
|
||||
│ │ └── main.html
|
||||
│ ├── includes
|
||||
│ │ ├── footer.html
|
||||
│ │ └── header.html
|
||||
│ └── index.html
|
||||
│
|
||||
├── extensions
|
||||
│ └── __init__.py
|
||||
│
|
||||
├── resources
|
||||
│ ├── cli
|
||||
│ │ └── cli.py
|
||||
│ ├── context_processors
|
||||
│ │ └── context_processors.py
|
||||
│ ├── error_handlers
|
||||
│ │ └── error_handlers.py
|
||||
│ ├── filters
|
||||
│ │ └── filters.py
|
||||
│ ├── routes
|
||||
│ │ └── routes.py
|
||||
│ ├── static
|
||||
│ │ └── favicon.ico
|
||||
│ └── templates
|
||||
│ └── error.html
|
||||
│
|
||||
└── __init__.py
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
304
docs/v1/imp-import_app_resources.html
Normal file
@@ -0,0 +1,304 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Imp.import_app_resources | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">Imp.import_app_resources</h1>
|
||||
<div class="highlight"><pre><span></span><span class="n">import_app_resources</span><span class="p">(</span>
|
||||
<span class="n">folder</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"resources"</span><span class="p">,</span>
|
||||
<span class="n">factories</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">List</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">static_folder</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"static"</span><span class="p">,</span>
|
||||
<span class="n">templates_folder</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"templates"</span><span class="p">,</span>
|
||||
<span class="n">files_to_import</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">List</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">folders_to_import</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">List</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="p">)</span> <span class="o">-></span> <span class="kc">None</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Import standard app resources from the specified folder.</p>
|
||||
<p>This will import any resources that have been set to the Quart app.</p>
|
||||
<p>Routes, context processors, cli, etc.</p>
|
||||
<p><strong>Can only be called once.</strong></p>
|
||||
<p>If no static and or template folder is found, the static and or template folder will be set to None in the Quart app
|
||||
config.</p>
|
||||
<h4>Small example of usage:</h4>
|
||||
<div class="highlight"><pre><span></span><span class="n">imp</span><span class="o">.</span><span class="n">import_app_resources</span><span class="p">(</span><span class="n">folder</span><span class="o">=</span><span class="s2">"resources"</span><span class="p">)</span>
|
||||
<span class="c1"># or</span>
|
||||
<span class="n">imp</span><span class="o">.</span><span class="n">import_app_resources</span><span class="p">()</span>
|
||||
<span class="c1"># as the default folder is "resources"</span>
|
||||
</pre></div>
|
||||
<p>Folder Structure: <code>resources</code></p>
|
||||
<div class="highlight"><pre><span></span>app
|
||||
├── resources
|
||||
│ ├── routes.py
|
||||
│ ├── app_fac.py
|
||||
│ ├── static
|
||||
│ │ └── css
|
||||
│ │ └── style.css
|
||||
│ └── templates
|
||||
│ └── index.html
|
||||
└── ...
|
||||
...
|
||||
</pre></div>
|
||||
<p>File: <code>routes.py</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart</span> <span class="kn">import</span> <span class="n">current_app</span> <span class="k">as</span> <span class="n">app</span>
|
||||
<span class="kn">from</span> <span class="nn">quart</span> <span class="kn">import</span> <span class="n">render_template</span>
|
||||
|
||||
|
||||
<span class="nd">@app</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/"</span><span class="p">)</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">index</span><span class="p">():</span>
|
||||
<span class="k">return</span> <span class="k">await</span> <span class="n">render_template</span><span class="p">(</span><span class="s2">"index.html"</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
<h4>How factories work</h4>
|
||||
<p>Factories are functions that are called when importing the app resources. Here's an example:</p>
|
||||
<div class="highlight"><pre><span></span><span class="n">imp</span><span class="o">.</span><span class="n">import_app_resources</span><span class="p">(</span>
|
||||
<span class="n">folder</span><span class="o">=</span><span class="s2">"resources"</span><span class="p">,</span>
|
||||
<span class="n">factories</span><span class="o">=</span><span class="p">[</span><span class="s2">"development_cli"</span><span class="p">]</span>
|
||||
<span class="p">)</span>
|
||||
</pre></div>
|
||||
<p><code>["development_cli"]</code> => <code>development_cli(app)</code> function will be called, and the current app will be passed in.</p>
|
||||
<p>File: <code>app_fac.py</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">development_cli</span><span class="p">(</span><span class="n">app</span><span class="p">):</span>
|
||||
<span class="nd">@app</span><span class="o">.</span><span class="n">cli</span><span class="o">.</span><span class="n">command</span><span class="p">(</span><span class="s2">"dev"</span><span class="p">)</span>
|
||||
<span class="k">def</span> <span class="nf">dev</span><span class="p">():</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"dev cli command"</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
<h4>Scoping imports</h4>
|
||||
<p>By default, all files and folders will be imported.</p>
|
||||
<p>To disable this, set <code>files_to_import</code> and or
|
||||
<code>folders_to_import</code> to <code>[None]</code>.</p>
|
||||
<div class="highlight"><pre><span></span><span class="n">imp</span><span class="o">.</span><span class="n">import_app_resources</span><span class="p">(</span><span class="n">scope_import</span><span class="o">=</span><span class="p">[</span><span class="kc">None</span><span class="p">],</span> <span class="n">folders_to_import</span><span class="o">=</span><span class="p">[</span><span class="kc">None</span><span class="p">])</span>
|
||||
</pre></div>
|
||||
<p>To scope the imports, set the <code>files_to_import</code> and or <code>folders_to_import</code> to a list of files and or folders.</p>
|
||||
<p><code>files_to_import=["cli.py", "routes.py"]</code> => will only import the files <code>resources/cli.py</code>
|
||||
and <code>resources/routes.py</code></p>
|
||||
<p><code>folders_to_import=["template_filters", "context_processors"]</code> => will import all files in the folders
|
||||
<code>resources/template_filters/*.py</code> and <code>resources/context_processors/*.py</code></p>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
324
docs/v1/imp-import_blueprint.html
Normal file
@@ -0,0 +1,324 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Imp.import_blueprint | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">Imp.import_blueprint</h1>
|
||||
<div class="highlight"><pre><span></span><span class="n">import_blueprint</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">blueprint</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Import a specified Quart-Imp or standard Quart Blueprint relative to the Quart app root.</p>
|
||||
<div class="highlight"><pre><span></span>app
|
||||
├── my_blueprint
|
||||
│ ├── ...
|
||||
│ └── __init__.py
|
||||
├── ...
|
||||
└── __init__.py
|
||||
</pre></div>
|
||||
<p>File: <code>app/__init__.py</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart</span> <span class="kn">import</span> <span class="n">Quart</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">quart_imp</span> <span class="kn">import</span> <span class="n">Imp</span>
|
||||
|
||||
<span class="n">imp</span> <span class="o">=</span> <span class="n">Imp</span><span class="p">()</span>
|
||||
|
||||
|
||||
<span class="k">def</span> <span class="nf">create_app</span><span class="p">():</span>
|
||||
<span class="n">app</span> <span class="o">=</span> <span class="n">Quart</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
|
||||
<span class="n">imp</span><span class="o">.</span><span class="n">init_app</span><span class="p">(</span><span class="n">app</span><span class="p">)</span>
|
||||
|
||||
<span class="n">imp</span><span class="o">.</span><span class="n">import_blueprint</span><span class="p">(</span><span class="s2">"my_blueprint"</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">app</span>
|
||||
</pre></div>
|
||||
<p>Quart-Imp Blueprints have the ability to auto import resources, and initialize session variables.</p>
|
||||
<p>For more information on how Quart-Imp Blueprints work, see the <a href="impblueprint-introduction.html">ImpBlueprint / Introduction</a></p>
|
||||
<h5>Example of 'my_blueprint' as a Quart-Imp Blueprint:</h5>
|
||||
<div class="highlight"><pre><span></span>app
|
||||
├── my_blueprint
|
||||
│ ├── routes
|
||||
│ │ └── index.py
|
||||
│ ├── static
|
||||
│ │ └── css
|
||||
│ │ └── style.css
|
||||
│ ├── templates
|
||||
│ │ └── my_blueprint
|
||||
│ │ └── index.html
|
||||
│ ├── __init__.py
|
||||
│ └── config.toml
|
||||
└── ...
|
||||
</pre></div>
|
||||
<p>File: <code>__init__.py</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp</span> <span class="kn">import</span> <span class="n">ImpBlueprint</span>
|
||||
<span class="kn">from</span> <span class="nn">quart_imp.config</span> <span class="kn">import</span> <span class="n">ImpBlueprintConfig</span>
|
||||
|
||||
<span class="n">bp</span> <span class="o">=</span> <span class="n">ImpBlueprint</span><span class="p">(</span>
|
||||
<span class="vm">__name__</span><span class="p">,</span>
|
||||
<span class="n">ImpBlueprintConfig</span><span class="p">(</span>
|
||||
<span class="n">enabled</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
|
||||
<span class="n">url_prefix</span><span class="o">=</span><span class="s2">"/my-blueprint"</span><span class="p">,</span>
|
||||
<span class="n">static_folder</span><span class="o">=</span><span class="s2">"static"</span><span class="p">,</span>
|
||||
<span class="n">template_folder</span><span class="o">=</span><span class="s2">"templates"</span><span class="p">,</span>
|
||||
<span class="n">static_url_path</span><span class="o">=</span><span class="s2">"/static/my_blueprint"</span><span class="p">,</span>
|
||||
<span class="n">init_session</span><span class="o">=</span><span class="p">{</span><span class="s2">"my_blueprint"</span><span class="p">:</span> <span class="s2">"session_value"</span><span class="p">},</span>
|
||||
<span class="p">),</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
<span class="n">bp</span><span class="o">.</span><span class="n">import_resources</span><span class="p">(</span><span class="s2">"routes"</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
<p>File: <code>routes / index.py</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">..</span> <span class="kn">import</span> <span class="n">bp</span>
|
||||
|
||||
|
||||
<span class="nd">@bp</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/"</span><span class="p">)</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">index</span><span class="p">():</span>
|
||||
<span class="k">return</span> <span class="s2">"regular_blueprint"</span>
|
||||
</pre></div>
|
||||
<h5>Example of 'my_blueprint' as a standard Quart Blueprint:</h5>
|
||||
<div class="highlight"><pre><span></span>app
|
||||
├── my_blueprint
|
||||
│ ├── ...
|
||||
│ └── __init__.py
|
||||
└── ...
|
||||
</pre></div>
|
||||
<p>File: <code>__init__.py</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart</span> <span class="kn">import</span> <span class="n">Blueprint</span>
|
||||
|
||||
<span class="n">bp</span> <span class="o">=</span> <span class="n">Blueprint</span><span class="p">(</span><span class="s2">"my_blueprint"</span><span class="p">,</span> <span class="vm">__name__</span><span class="p">,</span> <span class="n">url_prefix</span><span class="o">=</span><span class="s2">"/my-blueprint"</span><span class="p">)</span>
|
||||
|
||||
|
||||
<span class="nd">@bp</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/"</span><span class="p">)</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">index</span><span class="p">():</span>
|
||||
<span class="k">return</span> <span class="s2">"regular_blueprint"</span>
|
||||
</pre></div>
|
||||
<p>Both of the above examples will work with <code>imp.import_blueprint("my_blueprint")</code>, they will be registered
|
||||
with the Quart app, and will be accessible via <code>url_for("my_blueprint.index")</code>.</p>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
271
docs/v1/imp-import_blueprints.html
Normal file
@@ -0,0 +1,271 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Imp.import_blueprints | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">Imp.import_blueprints</h1>
|
||||
<div class="highlight"><pre><span></span><span class="n">import_blueprints</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">folder</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Import all Quart-Imp or standard Quart Blueprints from a specified folder relative to the Quart app root.</p>
|
||||
<div class="highlight"><pre><span></span>app/
|
||||
├── blueprints/
|
||||
│ ├── admin/
|
||||
│ │ ├── ...
|
||||
│ │ └── __init__.py
|
||||
│ ├── www/
|
||||
│ │ ├── ...
|
||||
│ │ └── __init__.py
|
||||
│ └── api/
|
||||
│ ├── ...
|
||||
│ └── __init__.py
|
||||
├── ...
|
||||
└── __init__.py
|
||||
</pre></div>
|
||||
<p>File: <code>app/__init__.py</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart</span> <span class="kn">import</span> <span class="n">Quart</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">quart_imp</span> <span class="kn">import</span> <span class="n">Imp</span>
|
||||
|
||||
<span class="n">imp</span> <span class="o">=</span> <span class="n">Imp</span><span class="p">()</span>
|
||||
|
||||
|
||||
<span class="k">def</span> <span class="nf">create_app</span><span class="p">():</span>
|
||||
<span class="n">app</span> <span class="o">=</span> <span class="n">Quart</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
|
||||
<span class="n">imp</span><span class="o">.</span><span class="n">init_app</span><span class="p">(</span><span class="n">app</span><span class="p">)</span>
|
||||
|
||||
<span class="n">imp</span><span class="o">.</span><span class="n">import_blueprints</span><span class="p">(</span><span class="s2">"blueprints"</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">app</span>
|
||||
</pre></div>
|
||||
<p>This will import all Blueprints from the <code>blueprints</code> folder using the <code>Imp.import_blueprint</code> method.
|
||||
See <a href="imp-import_blueprint.html">Imp / import_blueprint</a> for more information.</p>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
248
docs/v1/imp-init_app-init.html
Normal file
@@ -0,0 +1,248 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Imp.init_app, __init__ | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">Imp.init_app, __init__</h1>
|
||||
<div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">init_app</span><span class="p">(</span>
|
||||
<span class="n">app</span><span class="p">:</span> <span class="n">Quart</span><span class="p">,</span>
|
||||
<span class="n">config</span><span class="p">:</span> <span class="n">ImpConfig</span>
|
||||
<span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="c1"># -or- </span>
|
||||
<span class="n">Imp</span><span class="p">(</span>
|
||||
<span class="n">app</span><span class="p">:</span> <span class="n">Quart</span><span class="p">,</span>
|
||||
<span class="n">config</span><span class="p">:</span> <span class="n">ImpConfig</span>
|
||||
<span class="p">)</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Initializes the quart app to work with quart-imp.</p>
|
||||
<p>See <a href="quart_imp_config-impconfig.html">quart_imp_config-impconfig.md</a> for more information on the <code>ImpConfig</code> class.</p>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
263
docs/v1/imp-init_session.html
Normal file
@@ -0,0 +1,263 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Imp.init_session | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">Imp.init_session</h1>
|
||||
<div class="highlight"><pre><span></span><span class="n">init_session</span><span class="p">()</span> <span class="o">-></span> <span class="kc">None</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Initialize the session variables found in the config. Commonly used in <code>app.before_request</code>.</p>
|
||||
<div class="highlight"><pre><span></span><span class="nd">@app</span><span class="o">.</span><span class="n">before_request</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">before_request</span><span class="p">():</span>
|
||||
<span class="n">imp</span><span class="o">.</span><span class="n">_init_session</span><span class="p">()</span>
|
||||
</pre></div>
|
||||
<p>File: <code>config.toml</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="p">...</span>
|
||||
<span class="k">[SESSION]</span>
|
||||
<span class="n">logged_in</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">false</span>
|
||||
<span class="p">...</span>
|
||||
</pre></div>
|
||||
<p><code>logged_in</code> is now available in the session.</p>
|
||||
<div class="highlight"><pre><span></span><span class="nd">@app</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s1">'/get-session-value'</span><span class="p">)</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">login</span><span class="p">():</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">session</span><span class="p">[</span><span class="s1">'logged_in'</span><span class="p">])</span>
|
||||
<span class="k">return</span> <span class="s2">"Check Terminal"</span>
|
||||
</pre></div>
|
||||
<p><code>Output: False</code></p>
|
||||
<p>Can also be used to reset the values in the session. Here's an example:</p>
|
||||
<div class="highlight"><pre><span></span><span class="nd">@app</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s1">'/logout'</span><span class="p">)</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">logout</span><span class="p">():</span>
|
||||
<span class="n">session</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
|
||||
<span class="n">imp</span><span class="o">.</span><span class="n">_init_session</span><span class="p">()</span>
|
||||
<span class="k">return</span> <span class="n">redirect</span><span class="p">(</span><span class="n">url_for</span><span class="p">(</span><span class="s1">'index'</span><span class="p">))</span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
297
docs/v1/imp-introduction.html
Normal file
@@ -0,0 +1,297 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Quart-Imp Introduction | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">Quart-Imp Introduction</h1>
|
||||
<p>Quart-Imp is a Quart extension that provides auto import methods for various Quart resources. It will import
|
||||
blueprints, and other resources. It uses the importlib module to achieve this.</p>
|
||||
<p>Quart-Imp favors the application factory pattern as a project structure, and is opinionated towards using
|
||||
Blueprints. However, you can use Quart-Imp without using Blueprints.</p>
|
||||
<p>Here's an example of a standard Quart-Imp project structure:</p>
|
||||
<div class="highlight"><pre><span></span>app/
|
||||
├── blueprints/
|
||||
│ ├── admin/...
|
||||
│ ├── api/...
|
||||
│ └── www/...
|
||||
├── resources/
|
||||
│ ├── filters/...
|
||||
│ ├── context_processors/...
|
||||
│ ├── static/...
|
||||
│ └── templates/...
|
||||
└── __init__.py
|
||||
</pre></div>
|
||||
<p>Here's an example of the <code>app/__init__.py</code> file:</p>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart</span> <span class="kn">import</span> <span class="n">Quart</span>
|
||||
<span class="kn">from</span> <span class="nn">quart_sqlalchemy</span> <span class="kn">import</span> <span class="n">SQLAlchemy</span>
|
||||
<span class="kn">from</span> <span class="nn">quart_imp</span> <span class="kn">import</span> <span class="n">Imp</span>
|
||||
<span class="kn">from</span> <span class="nn">quart_imp.config</span> <span class="kn">import</span> <span class="n">QuartConfig</span><span class="p">,</span> <span class="n">ImpConfig</span>
|
||||
|
||||
<span class="n">db</span> <span class="o">=</span> <span class="n">SQLAlchemy</span><span class="p">()</span>
|
||||
<span class="n">imp</span> <span class="o">=</span> <span class="n">Imp</span><span class="p">()</span>
|
||||
|
||||
|
||||
<span class="k">def</span> <span class="nf">create_app</span><span class="p">():</span>
|
||||
<span class="n">app</span> <span class="o">=</span> <span class="n">Quart</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
|
||||
<span class="n">QuartConfig</span><span class="p">(</span>
|
||||
<span class="n">secret_key</span><span class="o">=</span><span class="s2">"super_secret_key"</span><span class="p">,</span>
|
||||
<span class="n">app_instance</span><span class="o">=</span><span class="n">app</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
<span class="n">imp</span><span class="o">.</span><span class="n">init_app</span><span class="p">(</span><span class="n">app</span><span class="p">,</span> <span class="n">config</span><span class="o">=</span><span class="n">ImpConfig</span><span class="p">(</span>
|
||||
<span class="n">init_session</span><span class="o">=</span><span class="p">{</span><span class="s2">"logged_in"</span><span class="p">:</span> <span class="kc">False</span><span class="p">},</span>
|
||||
<span class="p">))</span>
|
||||
<span class="n">imp</span><span class="o">.</span><span class="n">import_app_resources</span><span class="p">(</span><span class="s2">"resources"</span><span class="p">)</span>
|
||||
<span class="n">imp</span><span class="o">.</span><span class="n">import_blueprints</span><span class="p">(</span><span class="s2">"blueprints"</span><span class="p">)</span>
|
||||
|
||||
<span class="n">db</span><span class="o">.</span><span class="n">init_app</span><span class="p">(</span><span class="n">app</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">app</span>
|
||||
</pre></div>
|
||||
<p>The Quart configuration can be loaded from any standard Quart configuration method, or from the <code>QuartConfig</code> class
|
||||
shown above.</p>
|
||||
<p>This class contains the standard Quart configuration options found in the Quart documentation.</p>
|
||||
<p>The <code>ImpConfig</code> class is used to configure the <code>Imp</code> instance.</p>
|
||||
<p>The <code>init_session</code> option of the <code>ImpConfig</code> class is used to set the initial session variables for the Quart app.
|
||||
This happens before the request is processed.</p>
|
||||
<p><code>ImpConfig</code> also has the ability to set <code>SQLALCHEMY_DATABASE_URI</code> and <code>SQLALCHEMY_BINDS</code></p>
|
||||
<p>For more information about the configuration setting see
|
||||
<a href="quart_imp_config-impconfig.html">quart_imp_config-impconfig.md</a>.</p>
|
||||
<p><code>import_app_resources</code> will walk one level deep into the <code>resources</code> folder, and import
|
||||
all <code>.py</code> files as modules.
|
||||
It will also check for the existence of a <code>static</code> and <code>templates</code> folder, and register them with the Quart app.</p>
|
||||
<p>There is a couple of options for <code>import_app_resources</code> to control what
|
||||
is imported, see: <a href="imp-import_app_resources.html">Imp / import_app_resources</a></p>
|
||||
<p><code>import_blueprints</code> expects a folder that contains many Blueprint as Python packages.
|
||||
It will check each blueprint folder's <code>__init__.py</code> file for an instance of a Quart Blueprint or a
|
||||
Quart-Imp Blueprint. That instant will then be registered with the Quart app.</p>
|
||||
<p>See more about how importing blueprints work here: <a href="impblueprint-introduction.html">ImpBlueprint / Introduction</a></p>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
291
docs/v1/impblueprint-import_nested_blueprint.html
Normal file
@@ -0,0 +1,291 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Impblueprint.import_nested_blueprint | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">ImpBlueprint.import_nested_blueprint</h1>
|
||||
<div class="highlight"><pre><span></span><span class="n">import_nested_blueprint</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">blueprint</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Import a specified Quart-Imp or standard Quart Blueprint relative to the Blueprint root.</p>
|
||||
<p>Works the same as <a href="imp-import_blueprint.html">Imp / import_blueprint</a> but relative to the Blueprint root.</p>
|
||||
<p>Blueprints that are imported this way will be scoped to the parent Blueprint that imported them.</p>
|
||||
<p><code>url_for('my_blueprint.my_nested_blueprint.index')</code></p>
|
||||
<div class="highlight"><pre><span></span>my_blueprint/
|
||||
├── routes/...
|
||||
├── static/...
|
||||
├── templates/...
|
||||
│
|
||||
├── my_nested_blueprint/
|
||||
│ ├── routes/
|
||||
│ │ └── index.py
|
||||
│ ├── static/...
|
||||
│ ├── templates/...
|
||||
│ ├── __init__.py
|
||||
│
|
||||
├── __init__.py
|
||||
</pre></div>
|
||||
<p>File: <code>my_blueprint/__init__.py</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp</span> <span class="kn">import</span> <span class="n">ImpBlueprint</span>
|
||||
<span class="kn">from</span> <span class="nn">quart_imp.config</span> <span class="kn">import</span> <span class="n">ImpBlueprintConfig</span>
|
||||
|
||||
<span class="n">bp</span> <span class="o">=</span> <span class="n">ImpBlueprint</span><span class="p">(</span><span class="vm">__name__</span><span class="p">,</span> <span class="n">ImpBlueprintConfig</span><span class="p">(</span>
|
||||
<span class="n">enabled</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
|
||||
<span class="n">static_folder</span><span class="o">=</span><span class="s2">"static"</span><span class="p">,</span>
|
||||
<span class="n">template_folder</span><span class="o">=</span><span class="s2">"templates"</span><span class="p">,</span>
|
||||
<span class="p">))</span>
|
||||
|
||||
<span class="n">bp</span><span class="o">.</span><span class="n">import_resources</span><span class="p">(</span><span class="s2">"routes"</span><span class="p">)</span>
|
||||
<span class="n">bp</span><span class="o">.</span><span class="n">import_nested_blueprint</span><span class="p">(</span><span class="s2">"my_nested_blueprint"</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
<p>File: <code>my_blueprint/my_nested_blueprint/__init__.py</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp</span> <span class="kn">import</span> <span class="n">ImpBlueprint</span>
|
||||
<span class="kn">from</span> <span class="nn">quart_imp.config</span> <span class="kn">import</span> <span class="n">ImpBlueprintConfig</span>
|
||||
|
||||
<span class="n">bp</span> <span class="o">=</span> <span class="n">ImpBlueprint</span><span class="p">(</span><span class="vm">__name__</span><span class="p">,</span> <span class="n">ImpBlueprintConfig</span><span class="p">(</span>
|
||||
<span class="n">enabled</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
|
||||
<span class="n">static_folder</span><span class="o">=</span><span class="s2">"static"</span><span class="p">,</span>
|
||||
<span class="n">template_folder</span><span class="o">=</span><span class="s2">"templates"</span><span class="p">,</span>
|
||||
<span class="p">))</span>
|
||||
|
||||
<span class="n">bp</span><span class="o">.</span><span class="n">import_resources</span><span class="p">(</span><span class="s2">"routes"</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
<p>File: <code>my_blueprint/my_nested_blueprint/routes/index.py</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart</span> <span class="kn">import</span> <span class="n">render_template</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">..</span> <span class="kn">import</span> <span class="n">bp</span>
|
||||
|
||||
|
||||
<span class="nd">@bp</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/"</span><span class="p">)</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">index</span><span class="p">():</span>
|
||||
<span class="k">return</span> <span class="k">await</span> <span class="n">render_template</span><span class="p">(</span><span class="n">bp</span><span class="o">.</span><span class="n">tmpl</span><span class="p">(</span><span class="s2">"index.html"</span><span class="p">))</span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
277
docs/v1/impblueprint-import_nested_blueprints.html
Normal file
@@ -0,0 +1,277 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Impblueprint.import_nested_blueprints | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">ImpBlueprint.import_nested_blueprints</h1>
|
||||
<div class="highlight"><pre><span></span><span class="n">import_nested_blueprints</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">folder</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Will import all the Blueprints from the given folder relative to the Blueprint's root directory.</p>
|
||||
<p>Uses <a href="blueprint-import_nested_blueprint.html">Blueprint / import_nested_blueprint</a> to import blueprints from
|
||||
the specified folder.</p>
|
||||
<p>Blueprints that are imported this way will be scoped to the parent Blueprint that imported them.</p>
|
||||
<p><code>url_for('my_blueprint.nested_bp_one.index')</code></p>
|
||||
<p><code>url_for('my_blueprint.nested_bp_two.index')</code></p>
|
||||
<p><code>url_for('my_blueprint.nested_bp_three.index')</code></p>
|
||||
<div class="highlight"><pre><span></span>my_blueprint/
|
||||
├── routes/...
|
||||
├── static/...
|
||||
├── templates/...
|
||||
│
|
||||
├── nested_blueprints/
|
||||
│ │
|
||||
│ ├── nested_bp_one/
|
||||
│ │ ├── ...
|
||||
│ │ ├── __init__.py
|
||||
│ ├── nested_bp_two/
|
||||
│ │ ├── ...
|
||||
│ │ ├── __init__.py
|
||||
│ └── nested_bp_three/
|
||||
│ ├── ...
|
||||
│ ├── __init__.py
|
||||
│
|
||||
├── __init__.py
|
||||
</pre></div>
|
||||
<p>File: <code>my_blueprint/__init__.py</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp</span> <span class="kn">import</span> <span class="n">ImpBlueprint</span>
|
||||
<span class="kn">from</span> <span class="nn">quart_imp.config</span> <span class="kn">import</span> <span class="n">ImpBlueprintConfig</span>
|
||||
|
||||
<span class="n">bp</span> <span class="o">=</span> <span class="n">ImpBlueprint</span><span class="p">(</span><span class="vm">__name__</span><span class="p">,</span> <span class="n">ImpBlueprintConfig</span><span class="p">(</span>
|
||||
<span class="n">enabled</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
|
||||
<span class="n">static_folder</span><span class="o">=</span><span class="s2">"static"</span><span class="p">,</span>
|
||||
<span class="n">template_folder</span><span class="o">=</span><span class="s2">"templates"</span><span class="p">,</span>
|
||||
<span class="p">))</span>
|
||||
|
||||
<span class="n">bp</span><span class="o">.</span><span class="n">import_resources</span><span class="p">(</span><span class="s2">"routes"</span><span class="p">)</span>
|
||||
<span class="n">bp</span><span class="o">.</span><span class="n">import_nested_blueprints</span><span class="p">(</span><span class="s2">"nested_blueprints"</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
276
docs/v1/impblueprint-import_resources.html
Normal file
@@ -0,0 +1,276 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Impblueprint.import_resources | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">ImpBlueprint.import_resources</h1>
|
||||
<div class="highlight"><pre><span></span><span class="n">import_resources</span><span class="p">(</span><span class="n">folder</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"routes"</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Will import all the resources (cli, routes, filters, context_processors...) from the given folder relative to the
|
||||
Blueprint's root directory.</p>
|
||||
<div class="highlight"><pre><span></span>my_blueprint
|
||||
├── user_routes
|
||||
│ ├── user_dashboard.py
|
||||
│ └── user_settings.py
|
||||
├── car_routes
|
||||
│ ├── car_dashboard.py
|
||||
│ └── car_settings.py
|
||||
├── static/...
|
||||
├── templates/
|
||||
│ └── my_blueprint/
|
||||
│ ├── user_dashboard.html
|
||||
│ └── ...
|
||||
├── __init__.py
|
||||
</pre></div>
|
||||
<p>File: <code>my_blueprint/__init__.py</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp</span> <span class="kn">import</span> <span class="n">ImpBlueprint</span>
|
||||
<span class="kn">from</span> <span class="nn">quart_imp.config</span> <span class="kn">import</span> <span class="n">ImpBlueprintConfig</span>
|
||||
|
||||
<span class="n">bp</span> <span class="o">=</span> <span class="n">ImpBlueprint</span><span class="p">(</span><span class="vm">__name__</span><span class="p">,</span> <span class="n">ImpBlueprintConfig</span><span class="p">(</span>
|
||||
<span class="n">enabled</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
|
||||
<span class="n">static_folder</span><span class="o">=</span><span class="s2">"static"</span><span class="p">,</span>
|
||||
<span class="n">template_folder</span><span class="o">=</span><span class="s2">"templates"</span><span class="p">,</span>
|
||||
<span class="p">))</span>
|
||||
|
||||
<span class="n">bp</span><span class="o">.</span><span class="n">import_resources</span><span class="p">(</span><span class="s2">"user_routes"</span><span class="p">)</span>
|
||||
<span class="n">bp</span><span class="o">.</span><span class="n">import_resources</span><span class="p">(</span><span class="s2">"car_routes"</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
<p>File: <code>my_blueprint/user_routes/user_dashboard.py</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart</span> <span class="kn">import</span> <span class="n">render_template</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">..</span> <span class="kn">import</span> <span class="n">bp</span>
|
||||
|
||||
<span class="nd">@bp</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/user-dashboard"</span><span class="p">)</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">user_dashboard</span><span class="p">():</span>
|
||||
<span class="k">return</span> <span class="k">await</span> <span class="n">render_template</span><span class="p">(</span><span class="n">bp</span><span class="o">.</span><span class="n">tmpl</span><span class="p">(</span><span class="s2">"user_dashboard.html"</span><span class="p">))</span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
242
docs/v1/impblueprint-init.html
Normal file
@@ -0,0 +1,242 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Quart-Imp Blueprint __init__ | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">Quart-Imp Blueprint __init__</h1>
|
||||
<div class="highlight"><pre><span></span><span class="n">ImpBlueprint</span><span class="p">(</span><span class="n">dunder_name</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">config</span><span class="p">:</span> <span class="n">ImpBlueprintConfig</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Initializes the Quart-Imp Blueprint.</p>
|
||||
<p><code>dunder_name</code> should always be set to <code>__name__</code></p>
|
||||
<p><code>config</code> is an instance of <code>ImpBlueprintConfig</code> that will be used to load the Blueprint's configuration.
|
||||
See <a href="quart_imp_config-impblueprintconfig.html">quart_imp.config / ImpBlueprintConfig</a> for more information.</p>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
285
docs/v1/impblueprint-introduction.html
Normal file
@@ -0,0 +1,285 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Quart-Imp Blueprint Introduction | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">Quart-Imp Blueprint Introduction</h1>
|
||||
<p>The Quart-Imp Blueprint inherits from the Quart Blueprint class, then adds some additional methods to allow for auto
|
||||
importing of resources and other nested blueprints.</p>
|
||||
<p>The Quart-Imp Blueprint requires you to provide the <code>ImpBlueprintConfig</code> class as the second argument to the Blueprint.</p>
|
||||
<p>Here's an example of a Quart-Imp Blueprint structure:</p>
|
||||
<div class="highlight"><pre><span></span>www/
|
||||
├── nested_blueprints/
|
||||
│ ├── blueprint_one/
|
||||
│ │ ├── ...
|
||||
│ │ └── __init__.py
|
||||
│ └── blueprint_two/
|
||||
│ ├── ...
|
||||
│ └── __init__.py
|
||||
├── standalone_nested_blueprint/
|
||||
│ ├── ...
|
||||
│ └── __init__.py
|
||||
├── routes/
|
||||
│ └── index.py
|
||||
├── static/
|
||||
│ └── ...
|
||||
├── templates/
|
||||
│ └── www/
|
||||
│ └── index.html
|
||||
└── __init__.py
|
||||
</pre></div>
|
||||
<p>File: <code>__init__.py</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp</span> <span class="kn">import</span> <span class="n">ImpBlueprint</span>
|
||||
<span class="kn">from</span> <span class="nn">quart_imp.config</span> <span class="kn">import</span> <span class="n">ImpBlueprintConfig</span>
|
||||
|
||||
<span class="n">bp</span> <span class="o">=</span> <span class="n">ImpBlueprint</span><span class="p">(</span><span class="vm">__name__</span><span class="p">,</span> <span class="n">ImpBlueprintConfig</span><span class="p">(</span>
|
||||
<span class="n">enabled</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
|
||||
<span class="n">url_prefix</span><span class="o">=</span><span class="s2">"/www"</span><span class="p">,</span>
|
||||
<span class="n">static_folder</span><span class="o">=</span><span class="s2">"static"</span><span class="p">,</span>
|
||||
<span class="n">template_folder</span><span class="o">=</span><span class="s2">"templates"</span><span class="p">,</span>
|
||||
<span class="n">init_session</span><span class="o">=</span><span class="p">{</span><span class="s2">"logged_in"</span><span class="p">:</span> <span class="kc">False</span><span class="p">},</span>
|
||||
<span class="p">))</span>
|
||||
|
||||
<span class="n">bp</span><span class="o">.</span><span class="n">import_resources</span><span class="p">(</span><span class="s2">"routes"</span><span class="p">)</span>
|
||||
<span class="n">bp</span><span class="o">.</span><span class="n">import_nested_blueprints</span><span class="p">(</span><span class="s2">"nested_blueprints"</span><span class="p">)</span>
|
||||
<span class="n">bp</span><span class="o">.</span><span class="n">import_nested_blueprint</span><span class="p">(</span><span class="s2">"standalone_nested_blueprint"</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
<p>The <code>ImpBlueprintConfig</code> class is used to configure the Blueprint. It provides a little more flexibility than the
|
||||
standard Quart Blueprint configuration, like the ability to enable or disable the Blueprint.</p>
|
||||
<p><code>ImpBlueprintConfig</code>'s <code>init_session</code> works the same as <code>ImpConfig</code>'s <code>init_session</code>, this will add the session data to
|
||||
the Quart app's session object on initialization of the Quart app.</p>
|
||||
<p>To see more about configuration see: <a href="quart_imp_config-impblueprintconfig.html">quart_imp.config / ImpBlueprintConfig</a></p>
|
||||
<p><code>import_resources</code> method will walk one level deep into the <code>routes</code> folder, and import all <code>.py</code> files as modules.
|
||||
For more information see: <a href="impblueprint-import_resources.html">ImpBlueprint / import_resources</a></p>
|
||||
<p><code>import_nested_blueprints</code> will do the same as <code>imp.import_blueprints</code>, but will register the blueprints found as
|
||||
nested to the current blueprint. For example <code>www.blueprint_one.index</code></p>
|
||||
<p><code>import_nested_blueprint</code> behaves the same as <code>import_nested_blueprints</code>, but will only import a single blueprint.</p>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
264
docs/v1/impblueprint-tmpl.html
Normal file
@@ -0,0 +1,264 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Impblueprint.tmpl | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">ImpBlueprint.tmpl</h1>
|
||||
<div class="highlight"><pre><span></span><span class="n">tmpl</span><span class="p">(</span><span class="n">template</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Scopes the template lookup to the name of the blueprint (this takes from the <code>__name__</code> attribute of the Blueprint).</p>
|
||||
<p>Due to the way Quart templating works, and to avoid template name collisions.
|
||||
It is standard practice to place the name of the Blueprint in the template path,
|
||||
then to place any templates under that folder.</p>
|
||||
<div class="highlight"><pre><span></span>my_blueprint/
|
||||
├── routes/
|
||||
│ └── index.py
|
||||
├── static/...
|
||||
│
|
||||
├── templates/
|
||||
│ └── my_blueprint/
|
||||
│ └── index.html
|
||||
│
|
||||
├── __init__.py
|
||||
</pre></div>
|
||||
<p>File: <code>my_blueprint/routes/index.py</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart</span> <span class="kn">import</span> <span class="n">render_template</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">..</span> <span class="kn">import</span> <span class="n">bp</span>
|
||||
|
||||
|
||||
<span class="nd">@bp</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/"</span><span class="p">)</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">index</span><span class="p">():</span>
|
||||
<span class="k">return</span> <span class="k">await</span> <span class="n">render_template</span><span class="p">(</span><span class="n">bp</span><span class="o">.</span><span class="n">tmpl</span><span class="p">(</span><span class="s2">"index.html"</span><span class="p">))</span>
|
||||
</pre></div>
|
||||
<p><code>bp.tmpl("index.html")</code> will output <code>"my_blueprint/index.html"</code>.</p>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
317
docs/v1/index.html
Normal file
@@ -0,0 +1,317 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1>Welcome to the Quart-Imp Documentation</h1>
|
||||
<h2>What is Quart-Imp?</h2>
|
||||
<p>Quart-Imp's main purpose is to help simplify the importing of blueprints, and resources. It has a few extra
|
||||
features built in to help with securing pages and password authentication.</p>
|
||||
<h2>Install Quart-Imp</h2>
|
||||
<div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>quart-imp
|
||||
</pre></div>
|
||||
<h2>Getting Started</h2>
|
||||
<p>To get started right away, you can use the CLI commands to create a new Quart-Imp project.</p>
|
||||
<div class="highlight"><pre><span></span>quart-imp<span class="w"> </span>init
|
||||
</pre></div>
|
||||
<h3>Minimal Quart-Imp Setup</h3>
|
||||
<p>Run the following command to create a minimal Quart-Imp project.</p>
|
||||
<div class="highlight"><pre><span></span>quart-imp<span class="w"> </span>init<span class="w"> </span>-n<span class="w"> </span>app<span class="w"> </span>--minimal
|
||||
</pre></div>
|
||||
<p>See <a href="cli_commands-quart-imp_init.html">CLI Commands / quart-imp init</a> for more information.</p>
|
||||
<h3>The minimal structure</h3>
|
||||
<h4>Folder Structure</h4>
|
||||
<div class="highlight"><pre><span></span>app/
|
||||
├── resources/
|
||||
│ ├── static/...
|
||||
│ ├── templates/
|
||||
│ │ └── index.html
|
||||
│ └── index.py
|
||||
└── __init__.py
|
||||
</pre></div>
|
||||
<p>File: <code>app/__init__.py</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart</span> <span class="kn">import</span> <span class="n">Quart</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">quart_imp</span> <span class="kn">import</span> <span class="n">Imp</span>
|
||||
<span class="kn">from</span> <span class="nn">quart_imp.config</span> <span class="kn">import</span> <span class="n">QuartConfig</span><span class="p">,</span> <span class="n">ImpConfig</span>
|
||||
|
||||
<span class="n">imp</span> <span class="o">=</span> <span class="n">Imp</span><span class="p">()</span>
|
||||
|
||||
|
||||
<span class="k">def</span> <span class="nf">create_app</span><span class="p">():</span>
|
||||
<span class="n">app</span> <span class="o">=</span> <span class="n">Quart</span><span class="p">(</span><span class="vm">__name__</span><span class="p">,</span> <span class="n">static_url_path</span><span class="o">=</span><span class="s2">"/"</span><span class="p">)</span>
|
||||
<span class="n">QuartConfig</span><span class="p">(</span>
|
||||
<span class="n">secret_key</span><span class="o">=</span><span class="s2">"secret_key"</span><span class="p">,</span>
|
||||
<span class="n">app_instance</span><span class="o">=</span><span class="n">app</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
<span class="n">imp</span><span class="o">.</span><span class="n">init_app</span><span class="p">(</span><span class="n">app</span><span class="p">,</span> <span class="n">ImpConfig</span><span class="p">())</span>
|
||||
|
||||
<span class="n">imp</span><span class="o">.</span><span class="n">import_app_resources</span><span class="p">()</span>
|
||||
<span class="c1"># Takes argument 'folder' default folder is 'resources'</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">app</span>
|
||||
</pre></div>
|
||||
<p>File: <code>app/resources/routes.py</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart</span> <span class="kn">import</span> <span class="n">current_app</span> <span class="k">as</span> <span class="n">app</span>
|
||||
<span class="kn">from</span> <span class="nn">quart</span> <span class="kn">import</span> <span class="n">render_template</span>
|
||||
|
||||
|
||||
<span class="nd">@app</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/"</span><span class="p">)</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">index</span><span class="p">():</span>
|
||||
<span class="k">return</span> <span class="k">await</span> <span class="n">render_template</span><span class="p">(</span><span class="s2">"index.html"</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
<p>File: <code>app/resources/templates/index.html</code></p>
|
||||
<div class="highlight"><pre><span></span><span class="cp"><!DOCTYPE html></span>
|
||||
<span class="p"><</span><span class="nt">html</span> <span class="na">lang</span><span class="o">=</span><span class="s">"en"</span><span class="p">></span>
|
||||
<span class="p"><</span><span class="nt">head</span><span class="p">></span>
|
||||
<span class="p"><</span><span class="nt">meta</span> <span class="na">charset</span><span class="o">=</span><span class="s">"UTF-8"</span><span class="p">></span>
|
||||
<span class="p"><</span><span class="nt">title</span><span class="p">></span>Quart-Imp<span class="p"></</span><span class="nt">title</span><span class="p">></span>
|
||||
<span class="p"></</span><span class="nt">head</span><span class="p">></span>
|
||||
<span class="p"><</span><span class="nt">body</span><span class="p">></span>
|
||||
<span class="p"><</span><span class="nt">h1</span><span class="p">></span>Quart-Imp<span class="p"></</span><span class="nt">h1</span><span class="p">></span>
|
||||
<span class="p"></</span><span class="nt">body</span><span class="p">></span>
|
||||
<span class="p"></</span><span class="nt">html</span><span class="p">></span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Setting up a virtual environment is recommended.</p>
|
||||
<p><strong>Linux / Darwin</strong></p>
|
||||
<div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>venv<span class="w"> </span>venv
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="nb">source</span><span class="w"> </span>venv/bin/activate
|
||||
</pre></div>
|
||||
<p><strong>Windows</strong></p>
|
||||
<div class="highlight"><pre><span></span>python<span class="w"> </span>-m<span class="w"> </span>venv<span class="w"> </span>venv
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span>.\venv\Scripts\activate
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
272
docs/v1/quart_imp_auth-authenticate_password.html
Normal file
@@ -0,0 +1,272 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Authenticate_password - Quart_imp.auth | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">authenticate_password - quart_imp.auth</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.auth</span> <span class="kn">import</span> <span class="n">authenticate_password</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="n">authenticate_password</span><span class="p">(</span>
|
||||
<span class="n">input_password</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
|
||||
<span class="n">database_password</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
|
||||
<span class="n">database_salt</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
|
||||
<span class="n">encryption_level</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">512</span><span class="p">,</span>
|
||||
<span class="n">pepper_length</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span>
|
||||
<span class="n">pepper_position</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Literal</span><span class="p">[</span><span class="s2">"start"</span><span class="p">,</span> <span class="s2">"end"</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"end"</span>
|
||||
<span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>For use in password hashing.</p>
|
||||
<p>To be used alongside the <a href="quart_imp_auth-encrypt_password.html">quart_imp.auth / encrypt_password</a> function.</p>
|
||||
<p>Takes the plain input password, the stored hashed password along with the stored salt
|
||||
and will try every possible combination of pepper values to find a match.</p>
|
||||
<p><strong>Note:</strong></p>
|
||||
<ul>
|
||||
<li>You must know the pepper length used to hash the password.</li>
|
||||
<li>You must know the position of the pepper used to hash the password.</li>
|
||||
<li>You must know the encryption level used to hash the password.</li>
|
||||
</ul>
|
||||
<h4>Authentication Scenario:</h4>
|
||||
<pre><code>Plain password: "password"
|
||||
Generated salt: "^%$*" (randomly generated)
|
||||
Generated pepper (length 1): "A" (randomly generated)
|
||||
Pepper position: "end"
|
||||
</code></pre><div class="highlight"><pre><span></span><span class="n">input_password</span> <span class="o">=</span> <span class="s2">"password"</span>
|
||||
<span class="n">database_password</span> <span class="o">=</span> <span class="s2">"a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0..."</span> <span class="c1"># pulled from database</span>
|
||||
<span class="n">database_salt</span> <span class="o">=</span> <span class="s2">"^%$*"</span> <span class="c1"># pulled from database</span>
|
||||
|
||||
<span class="n">authenticate_password</span><span class="p">(</span>
|
||||
<span class="n">input_password</span><span class="p">,</span>
|
||||
<span class="n">database_password</span><span class="p">,</span>
|
||||
<span class="n">database_salt</span>
|
||||
<span class="p">)</span> <span class="c1"># >>> True</span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
269
docs/v1/quart_imp_auth-encrypt_password.html
Normal file
@@ -0,0 +1,269 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Encrypt_password - Quart_imp.auth | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">encrypt_password - quart_imp.auth</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.auth</span> <span class="kn">import</span> <span class="n">encrypt_password</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="n">encrypt_password</span><span class="p">(</span>
|
||||
<span class="n">password</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
|
||||
<span class="n">salt</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
|
||||
<span class="n">encryption_level</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">512</span><span class="p">,</span>
|
||||
<span class="n">pepper_length</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span>
|
||||
<span class="n">pepper_position</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Literal</span><span class="p">[</span><span class="s2">"start"</span><span class="p">,</span> <span class="s2">"end"</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"end"</span>
|
||||
<span class="p">)</span> <span class="o">-></span> <span class="nb">str</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>For use in password hashing.</p>
|
||||
<p>To be used alongside the <a href="quart_imp_auth-authenticate_password.html">quart_imp.auth / authenticate_password</a> function.</p>
|
||||
<p>Takes the plain password, applies a pepper, salts it, then produces a digested sha512 or sha256 if specified.</p>
|
||||
<p>Can set the encryption level to 256 or 512, defaults to 512.</p>
|
||||
<p>Can set the pepper length, defaults to 1. Max is 3.</p>
|
||||
<p>Can set the pepper position, "start" or "end", defaults to "end".</p>
|
||||
<p><strong>Note:</strong></p>
|
||||
<ul>
|
||||
<li>You must inform the authenticate_password function of the pepper length used to hash the password.</li>
|
||||
<li>You must inform the authenticate_password function of the position of the pepper used to hash the password.</li>
|
||||
<li>You must inform the authenticate_password function of the encryption level used to hash the password.</li>
|
||||
</ul>
|
||||
<h4>Encryption Scenario:</h4>
|
||||
<pre><code>Plain password: "password"
|
||||
Generated salt: "^%$*" (randomly generated)
|
||||
Generated pepper (length 1): "A" (randomly generated)
|
||||
Pepper position: "end"
|
||||
</code></pre><ol>
|
||||
<li>Pepper is added to the end of the plain password: "passwordA"</li>
|
||||
<li>Salt is added to the end of the peppered password: "passwordA^%$*"</li>
|
||||
<li>Password is hashed: "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0..."</li>
|
||||
<li>Salt and hashed password are then stored in the database.</li>
|
||||
</ol>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
245
docs/v1/quart_imp_auth-generate_alphanumeric_validator.html
Normal file
@@ -0,0 +1,245 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Generate_alphanumeric_validator - Quart_imp.auth | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">generate_alphanumeric_validator - quart_imp.auth</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.auth</span> <span class="kn">import</span> <span class="n">generate_alphanumeric_validator</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="n">generate_alphanumeric_validator</span><span class="p">(</span><span class="n">length</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">8</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Generates a random alphanumeric string of the given length.</p>
|
||||
<p>(letters are capitalized)</p>
|
||||
<h5>Example:</h5>
|
||||
<div class="highlight"><pre><span></span><span class="n">generate_alphanumeric_validator</span><span class="p">(</span><span class="mi">8</span><span class="p">)</span> <span class="c1"># >>> 'A1B2C3D4'</span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
246
docs/v1/quart_imp_auth-generate_csrf_token.html
Normal file
@@ -0,0 +1,246 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Generate_csrf_token - Quart_imp.auth | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">generate_csrf_token - quart_imp.auth</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.auth</span> <span class="kn">import</span> <span class="n">generate_csrf_token</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="n">generate_csrf_token</span><span class="p">()</span> <span class="o">-></span> <span class="nb">str</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Generates a SHA1 using the current date and time.</p>
|
||||
<p>For use in Cross-Site Request Forgery.</p>
|
||||
<p>Also used by the <a href="quart_imp_security-include_csrf.html">quart_imp.security / csrf_protect</a> decorator.</p>
|
||||
<h5>Example:</h5>
|
||||
<div class="highlight"><pre><span></span><span class="n">generate_csrf_token</span><span class="p">()</span> <span class="c1"># >>> 'a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0'</span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
248
docs/v1/quart_imp_auth-generate_email_validator.html
Normal file
@@ -0,0 +1,248 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Generate_email_validator - Quart_imp.auth | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">generate_email_validator - quart_imp.auth</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.auth</span> <span class="kn">import</span> <span class="n">generate_email_validator</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="n">generate_email_validator</span><span class="p">()</span> <span class="o">-></span> <span class="nb">str</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Uses <code>generate_alphanumeric_validator</code> with a length of 8 to
|
||||
generate a random alphanumeric value for the specific use of
|
||||
validating accounts via email.</p>
|
||||
<p>See <a href="quart_imp_auth-generate_alphanumeric_validator.html">quart_imp.auth / generate_alphanumeric_validator</a>
|
||||
for more information.</p>
|
||||
<h5>Example:</h5>
|
||||
<div class="highlight"><pre><span></span><span class="n">generate_email_validator</span><span class="p">()</span> <span class="c1"># >>> 'A1B2C3D4'</span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
246
docs/v1/quart_imp_auth-generate_numeric_validator.html
Normal file
@@ -0,0 +1,246 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Generate_numeric_validator - Quart_imp.auth | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">generate_numeric_validator - quart_imp.auth</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.auth</span> <span class="kn">import</span> <span class="n">generate_numeric_validator</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="n">generate_numeric_validator</span><span class="p">(</span><span class="n">length</span><span class="p">:</span> <span class="nb">int</span><span class="p">)</span> <span class="o">-></span> <span class="nb">int</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Generates random choice between 1 * (length) and 9 * (length).</p>
|
||||
<p>If the length is 4, it will generate a number between 1111 and 9999.</p>
|
||||
<p>For use in MFA email, or unique filename generation.</p>
|
||||
<h5>Example:</h5>
|
||||
<div class="highlight"><pre><span></span><span class="n">generate_numeric_validator</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span> <span class="c1"># >>> 1234</span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
246
docs/v1/quart_imp_auth-generate_password.html
Normal file
@@ -0,0 +1,246 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Generate_password - Quart_imp.auth | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">generate_password - quart_imp.auth</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.auth</span> <span class="kn">import</span> <span class="n">generate_password</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="n">generate_password</span><span class="p">(</span><span class="n">style</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"mixed"</span><span class="p">,</span> <span class="n">length</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">3</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Generates a password of (length) characters.</p>
|
||||
<p>The Default length is 3.</p>
|
||||
<p>Style options: "animals", "colors", "mixed" - defaults to "mixed"</p>
|
||||
<h5>Example:</h5>
|
||||
<div class="highlight"><pre><span></span><span class="n">generate_password</span><span class="p">(</span><span class="n">style</span><span class="o">=</span><span class="s2">"animals"</span><span class="p">,</span> <span class="n">length</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span> <span class="c1"># >>> 'Cat-Goat-Pig12'</span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
260
docs/v1/quart_imp_auth-generate_private_key.html
Normal file
@@ -0,0 +1,260 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Generate_private_key - Quart_imp.auth | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">generate_private_key - quart_imp.auth</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.auth</span> <span class="kn">import</span> <span class="n">generate_private_key</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="n">generate_private_key</span><span class="p">(</span><span class="n">hook</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">])</span> <span class="o">-></span> <span class="nb">str</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Generates a sha256 private key from a passed in hook value.</p>
|
||||
<p>If no hook is passed in, it will generate a hook using datetime.now() and a
|
||||
random number between 1 and 1000.</p>
|
||||
<div class="highlight"><pre><span></span><span class="nd">@app</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s1">'/register'</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s1">'GET'</span><span class="p">,</span> <span class="s1">'POST'</span><span class="p">])</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">register</span><span class="p">():</span>
|
||||
<span class="k">if</span> <span class="n">request</span><span class="o">.</span><span class="n">method</span> <span class="o">==</span> <span class="s2">"POST"</span><span class="p">:</span>
|
||||
<span class="o">...</span>
|
||||
<span class="n">salt</span> <span class="o">=</span> <span class="n">generate_salt</span><span class="p">()</span>
|
||||
<span class="n">password</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">form</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'password'</span><span class="p">)</span>
|
||||
<span class="n">encrypted_password</span> <span class="o">=</span> <span class="n">encrypt_password</span><span class="p">(</span><span class="n">password</span><span class="p">,</span> <span class="n">salt</span><span class="p">)</span>
|
||||
<span class="o">...</span>
|
||||
<span class="n">user</span> <span class="o">=</span> <span class="n">User</span><span class="p">(</span>
|
||||
<span class="n">username</span><span class="o">=</span><span class="n">username</span><span class="p">,</span>
|
||||
<span class="n">email</span><span class="o">=</span><span class="n">email</span><span class="p">,</span>
|
||||
<span class="n">password</span><span class="o">=</span><span class="n">encrypted_password</span><span class="p">,</span>
|
||||
<span class="n">salt</span><span class="o">=</span><span class="n">salt</span><span class="p">,</span>
|
||||
<span class="n">private_key</span><span class="o">=</span><span class="n">generate_private_key</span><span class="p">(</span><span class="n">hook</span><span class="o">=</span><span class="n">username</span><span class="p">)</span>
|
||||
<span class="p">)</span>
|
||||
<span class="o">...</span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
263
docs/v1/quart_imp_auth-generate_salt.html
Normal file
@@ -0,0 +1,263 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Generate_salt - Quart_imp.auth | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">generate_salt - quart_imp.auth</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.auth</span> <span class="kn">import</span> <span class="n">generate_salt</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="n">generate_salt</span><span class="p">(</span><span class="n">length</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">4</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Generates a string of (length) characters of punctuation.</p>
|
||||
<p>The Default length is 4.</p>
|
||||
<p>For use in password hashing and storage of passwords in the database.</p>
|
||||
<h5>Example:</h5>
|
||||
<div class="highlight"><pre><span></span><span class="n">generate_salt</span><span class="p">()</span> <span class="c1"># >>> '*!$%'</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="nd">@app</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s1">'/register'</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s1">'GET'</span><span class="p">,</span> <span class="s1">'POST'</span><span class="p">])</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">register</span><span class="p">():</span>
|
||||
<span class="k">if</span> <span class="n">request</span><span class="o">.</span><span class="n">method</span> <span class="o">==</span> <span class="s2">"POST"</span><span class="p">:</span>
|
||||
<span class="o">...</span>
|
||||
<span class="n">salt</span> <span class="o">=</span> <span class="n">generate_salt</span><span class="p">()</span>
|
||||
<span class="n">password</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">form</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'password'</span><span class="p">)</span>
|
||||
<span class="n">encrypted_password</span> <span class="o">=</span> <span class="n">encrypt_password</span><span class="p">(</span><span class="n">password</span><span class="p">,</span> <span class="n">salt</span><span class="p">)</span>
|
||||
<span class="o">...</span>
|
||||
|
||||
<span class="n">user</span> <span class="o">=</span> <span class="n">User</span><span class="p">(</span>
|
||||
<span class="n">username</span><span class="o">=</span><span class="n">username</span><span class="p">,</span>
|
||||
<span class="n">email</span><span class="o">=</span><span class="n">email</span><span class="p">,</span>
|
||||
<span class="n">password</span><span class="o">=</span><span class="n">encrypted_password</span><span class="p">,</span>
|
||||
<span class="n">salt</span><span class="o">=</span><span class="n">salt</span>
|
||||
<span class="p">)</span>
|
||||
<span class="o">...</span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
260
docs/v1/quart_imp_auth-is_email_address_valid.html
Normal file
@@ -0,0 +1,260 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Is_email_address_valid - Quart_imp.auth | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">is_email_address_valid - quart_imp.auth</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.auth</span> <span class="kn">import</span> <span class="n">is_email_address_valid</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="n">is_email_address_valid</span><span class="p">(</span>
|
||||
<span class="n">email_address</span><span class="p">:</span> <span class="nb">str</span>
|
||||
<span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Checks if an email address is valid.</p>
|
||||
<p>Is not completely RFC 5322 compliant, but it is good enough for most use cases.</p>
|
||||
<p>Here are examples of mistakes that it will not catch:</p>
|
||||
<h5>Valid but fails:</h5>
|
||||
<div class="highlight"><pre><span></span>email@[123.123.123.123]
|
||||
“email”@example.com
|
||||
very.unusual.“@”.unusual.com@example.com
|
||||
very.“(),:;<>[]”.VERY.“very@\\ "very”.unusual@strange.example.com
|
||||
</pre></div>
|
||||
<h5>Invalid but passes:</h5>
|
||||
<div class="highlight"><pre><span></span>email@example.com (Joe Smith)
|
||||
email@111.222.333.44444
|
||||
</pre></div>
|
||||
<h5>Example:</h5>
|
||||
<div class="highlight"><pre><span></span><span class="n">is_email_address_valid</span><span class="p">(</span><span class="s1">'hello@example.com'</span><span class="p">)</span> <span class="c1"># >>> True</span>
|
||||
|
||||
<span class="n">is_email_address_valid</span><span class="p">(</span><span class="s1">'hello@hello@example.com'</span><span class="p">)</span> <span class="c1"># >>> False</span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
269
docs/v1/quart_imp_auth-is_username_valid.html
Normal file
@@ -0,0 +1,269 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Is_username_valid - Quart_imp.auth | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">is_username_valid - quart_imp.auth</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.auth</span> <span class="kn">import</span> <span class="n">is_username_valid</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="n">is_username_valid</span><span class="p">(</span>
|
||||
<span class="n">username</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
|
||||
<span class="n">allowed</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Literal</span><span class="p">[</span><span class="s2">"all"</span><span class="p">,</span> <span class="s2">"dot"</span><span class="p">,</span> <span class="s2">"dash"</span><span class="p">,</span> <span class="s2">"under"</span><span class="p">]]]</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>Checks if a username is valid.</p>
|
||||
<p>Valid usernames can only include letters,
|
||||
numbers, ., -, and _ but cannot begin or end with
|
||||
the last three mentioned.</p>
|
||||
<h5>Example "all":</h5>
|
||||
<div class="highlight"><pre><span></span><span class="n">is_username_valid</span><span class="p">(</span><span class="s2">"username"</span><span class="p">,</span> <span class="n">allowed</span><span class="o">=</span><span class="p">[</span><span class="s2">"all"</span><span class="p">])</span>
|
||||
</pre></div>
|
||||
<p>Output:</p>
|
||||
<div class="highlight"><pre><span></span>username : WILL PASS : True
|
||||
user.name : WILL PASS : True
|
||||
user-name : WILL PASS : True
|
||||
user_name : WILL PASS : True
|
||||
_user_name : WILL PASS : False
|
||||
</pre></div>
|
||||
<h5>Example "dot", "dash":</h5>
|
||||
<div class="highlight"><pre><span></span><span class="n">is_username_valid</span><span class="p">(</span><span class="s2">"username"</span><span class="p">,</span> <span class="n">allowed</span><span class="o">=</span><span class="p">[</span><span class="s2">"dot"</span><span class="p">,</span> <span class="s2">"dash"</span><span class="p">])</span>
|
||||
</pre></div>
|
||||
<p>Output:</p>
|
||||
<div class="highlight"><pre><span></span>username : WILL PASS : True
|
||||
user.name : WILL PASS : True
|
||||
user-name : WILL PASS : True
|
||||
user-name.name : WILL PASS : True
|
||||
user_name : WILL PASS : False
|
||||
_user_name : WILL PASS : False
|
||||
.user.name : WILL PASS : False
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
255
docs/v1/quart_imp_config-impblueprintconfig.html
Normal file
@@ -0,0 +1,255 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Impblueprintconfig - Quart_imp.config | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">ImpBlueprintConfig - quart_imp.config</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.config</span> <span class="kn">import</span> <span class="n">ImpBlueprintConfig</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="n">ImpBlueprintConfig</span><span class="p">(</span>
|
||||
<span class="n">enabled</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="n">url_prefix</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">subdomain</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">url_defaults</span><span class="p">:</span> <span class="nb">dict</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">static_folder</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">template_folder</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">static_url_path</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">root_path</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">cli_group</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">init_session</span><span class="p">:</span> <span class="nb">dict</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="p">)</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>A class that holds a Quart-Imp blueprint configuration.</p>
|
||||
<p>Most of these values are passed to the <code>Blueprint</code> class when the blueprint is registered.</p>
|
||||
<p>The <code>enabled</code> argument is used to enable or disable the blueprint. This is useful for feature flags.</p>
|
||||
<p><code>init_session</code> is used to set the session values in the main <code>before_request</code> function.</p>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
255
docs/v1/quart_imp_config-impconfig.html
Normal file
@@ -0,0 +1,255 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Impconfig - Quart_imp.config | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">ImpConfig - quart_imp.config</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.config</span> <span class="kn">import</span> <span class="n">ImpConfig</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="n">ImpConfig</span><span class="p">(</span>
|
||||
<span class="n">init_session</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>The <code>ImpConfig</code> class is used to set the initial session data
|
||||
that the application will use.</p>
|
||||
<div class="highlight"><pre><span></span><span class="n">imp_config</span> <span class="o">=</span> <span class="n">ImpConfig</span><span class="p">(</span>
|
||||
<span class="n">init_session</span><span class="o">=</span><span class="p">{</span><span class="s2">"key"</span><span class="p">:</span> <span class="s2">"value"</span><span class="p">},</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
|
||||
<span class="k">def</span> <span class="nf">create_app</span><span class="p">():</span>
|
||||
<span class="n">app</span> <span class="o">=</span> <span class="n">Quart</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
|
||||
<span class="n">QuartConfig</span><span class="p">(</span><span class="n">debug</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">app_instance</span><span class="o">=</span><span class="n">app</span><span class="p">)</span>
|
||||
<span class="n">imp</span><span class="o">.</span><span class="n">init_app</span><span class="p">(</span><span class="n">app</span><span class="p">,</span> <span class="n">imp_config</span><span class="p">)</span>
|
||||
<span class="o">...</span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
280
docs/v1/quart_imp_config-quartconfig.html
Normal file
@@ -0,0 +1,280 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Quartconfig - Quart_imp.config | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">QuartConfig - quart_imp.config</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.config</span> <span class="kn">import</span> <span class="n">QuartConfig</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="n">QuartConfig</span><span class="p">(</span>
|
||||
<span class="n">debug</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">propagate_exceptions</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">trap_http_exceptions</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">trap_bad_request_errors</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">secret_key</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">session_cookie_name</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">session_cookie_domain</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">session_cookie_path</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">session_cookie_httponly</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">session_cookie_secure</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">session_cookie_samesite</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Literal</span><span class="p">[</span><span class="s2">"Lax"</span><span class="p">,</span> <span class="s2">"Strict"</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">permanent_session_lifetime</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">int</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">session_refresh_each_request</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">use_x_sendfile</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">send_file_max_age_default</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">int</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">error_404_help</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">server_name</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">application_root</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">preferred_url_scheme</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">max_content_length</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">int</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">templates_auto_reload</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">explain_template_loading</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">max_cookie_size</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">int</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">app_instance</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="s2">"Quart"</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="p">)</span>
|
||||
</pre></div>
|
||||
<hr />
|
||||
<p>A class that holds a Quart configuration values.</p>
|
||||
<p>You can set the configuration values to the app instance by either passing the app instance to the <code>app_instance</code>
|
||||
parameter or by calling the <code>apply_config</code> method on the <code>QuartConfig</code> instance.</p>
|
||||
<div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">create_app</span><span class="p">():</span>
|
||||
<span class="n">app</span> <span class="o">=</span> <span class="n">Quart</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
|
||||
<span class="n">QuartConfig</span><span class="p">(</span><span class="n">debug</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">app_instance</span><span class="o">=</span><span class="n">app</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">app</span>
|
||||
</pre></div>
|
||||
<p>or</p>
|
||||
<div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">create_app</span><span class="p">():</span>
|
||||
<span class="n">app</span> <span class="o">=</span> <span class="n">Quart</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
|
||||
<span class="n">config</span> <span class="o">=</span> <span class="n">QuartConfig</span><span class="p">(</span><span class="n">debug</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
<span class="n">config</span><span class="o">.</span><span class="n">apply_config</span><span class="p">(</span><span class="n">app</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">app</span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
261
docs/v1/quart_imp_security-api_login_check.html
Normal file
@@ -0,0 +1,261 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Api_login_check - Quart_imp.security | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">api_login_check - quart_imp.security</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.security</span> <span class="kn">import</span> <span class="n">api_login_check</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="n">api_login_check</span><span class="p">(</span>
|
||||
<span class="n">session_key</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
|
||||
<span class="n">values_allowed</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Union</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">int</span><span class="p">,</span> <span class="nb">bool</span><span class="p">]],</span> <span class="nb">str</span><span class="p">,</span> <span class="nb">int</span><span class="p">,</span> <span class="nb">bool</span><span class="p">],</span>
|
||||
<span class="n">fail_json</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="p">)</span>
|
||||
</pre></div>
|
||||
<p><code>@api_login_check(...)</code></p>
|
||||
<hr />
|
||||
<p>A decorator that is used to secure API routes that return JSON responses.</p>
|
||||
<p><code>session_key</code> The session key to check for.</p>
|
||||
<p><code>values_allowed</code> A list of or singular value(s) that the session key must contain.</p>
|
||||
<p><code>fail_json</code> JSON that is returned on failure. <code>{"error": "You are not logged in."}</code> by default.</p>
|
||||
<h5>Example:</h5>
|
||||
<div class="highlight"><pre><span></span><span class="nd">@bp</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/resource"</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"GET"</span><span class="p">])</span>
|
||||
<span class="nd">@api_login_check</span><span class="p">(</span><span class="s1">'logged_in'</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">api_page</span><span class="p">():</span>
|
||||
<span class="o">...</span>
|
||||
</pre></div>
|
||||
<h5>Example of defined fail_json:</h5>
|
||||
<div class="highlight"><pre><span></span><span class="nd">@bp</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/resource"</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"GET"</span><span class="p">])</span>
|
||||
<span class="nd">@api_login_check</span><span class="p">(</span><span class="s1">'logged_in'</span><span class="p">,</span> <span class="kc">True</span><span class="p">,</span> <span class="n">fail_json</span><span class="o">=</span><span class="p">{</span><span class="s2">"failed"</span><span class="p">:</span> <span class="s2">"You need to be logged in."</span><span class="p">})</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">api_page</span><span class="p">():</span>
|
||||
<span class="o">...</span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
265
docs/v1/quart_imp_security-include_csrf.html
Normal file
@@ -0,0 +1,265 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Include_csrf - Quart_imp.security | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">include_csrf - quart_imp.security</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.security</span> <span class="kn">import</span> <span class="n">include_csrf</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="n">include_csrf</span><span class="p">(</span>
|
||||
<span class="n">session_key</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"csrf"</span><span class="p">,</span>
|
||||
<span class="n">form_key</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"csrf"</span><span class="p">,</span>
|
||||
<span class="n">abort_code</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">401</span>
|
||||
<span class="p">)</span>
|
||||
</pre></div>
|
||||
<p><code>@include_csrf(...)</code></p>
|
||||
<hr />
|
||||
<p>A decorator that handles CSRF protection.</p>
|
||||
<p>On a <strong>GET</strong> request, a CSRF token is generated and stored in the session key
|
||||
specified by the session_key parameter.</p>
|
||||
<p>On a <strong>POST</strong> request, the form_key specified is checked against the session_key
|
||||
specified.</p>
|
||||
<ul>
|
||||
<li>If they match, the request is allowed to continue.</li>
|
||||
<li>If no match, the response will be abort(abort_code), default 401.</li>
|
||||
</ul>
|
||||
<div class="highlight"><pre><span></span><span class="nd">@bp</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/admin"</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"GET"</span><span class="p">,</span> <span class="s2">"POST"</span><span class="p">])</span>
|
||||
<span class="nd">@include_csrf</span><span class="p">(</span><span class="n">session_key</span><span class="o">=</span><span class="s2">"csrf"</span><span class="p">,</span> <span class="n">form_key</span><span class="o">=</span><span class="s2">"csrf"</span><span class="p">)</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">admin_page</span><span class="p">():</span>
|
||||
<span class="o">...</span>
|
||||
<span class="c1"># You must pass in the CSRF token from the session into the template.</span>
|
||||
<span class="c1"># Then add <input type="hidden" name="csrf" value="{{ csrf }}"> to the form.</span>
|
||||
<span class="k">return</span> <span class="k">await</span> <span class="n">render_template</span><span class="p">(</span><span class="s2">"admin.html"</span><span class="p">,</span> <span class="n">csrf</span><span class="o">=</span><span class="n">session</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"csrf"</span><span class="p">))</span>
|
||||
</pre></div>
|
||||
<p>Form key:</p>
|
||||
<div class="highlight"><pre><span></span><span class="p"><</span><span class="nt">input</span> <span class="na">type</span><span class="o">=</span><span class="s">"hidden"</span> <span class="na">name</span><span class="o">=</span><span class="s">"csrf"</span> <span class="na">value</span><span class="o">=</span><span class="s">"{{ csrf }}"</span><span class="p">></span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
278
docs/v1/quart_imp_security-login_check.html
Normal file
@@ -0,0 +1,278 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Login_check - Quart_imp.security | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">login_check - quart_imp.security</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.security</span> <span class="kn">import</span> <span class="n">login_check</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="n">login_check</span><span class="p">(</span>
|
||||
<span class="n">session_key</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
|
||||
<span class="n">values_allowed</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Union</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">int</span><span class="p">,</span> <span class="nb">bool</span><span class="p">]],</span> <span class="nb">str</span><span class="p">,</span> <span class="nb">int</span><span class="p">,</span> <span class="nb">bool</span><span class="p">],</span>
|
||||
<span class="n">fail_endpoint</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">pass_endpoint</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">endpoint_kwargs</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">int</span><span class="p">]]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">message</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">message_category</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"message"</span>
|
||||
<span class="p">)</span>
|
||||
</pre></div>
|
||||
<p><code>@login_check(...)</code></p>
|
||||
<hr />
|
||||
<p>A decorator that checks if the specified session key exists and contains the specified value.</p>
|
||||
<p><code>session_key</code> The session key to check for.</p>
|
||||
<p><code>values_allowed</code> A list of or singular value(s) that the session key must contain.</p>
|
||||
<p><code>fail_endpoint</code> The endpoint to redirect to if the session key does not exist or does not contain the specified values.</p>
|
||||
<p><code>endpoint_kwargs</code> A dictionary of keyword arguments to pass to the redirect endpoint.</p>
|
||||
<p><code>message</code> If a message is specified, a flash message is shown.</p>
|
||||
<p><code>message_category</code> The category of the flash message.</p>
|
||||
<h5>Example of a route that requires a user to be logged in:</h5>
|
||||
<div class="highlight"><pre><span></span><span class="nd">@bp</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/admin"</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"GET"</span><span class="p">])</span>
|
||||
<span class="nd">@login_check</span><span class="p">(</span>
|
||||
<span class="s1">'logged_in'</span><span class="p">,</span>
|
||||
<span class="kc">True</span><span class="p">,</span>
|
||||
<span class="n">fail_endpoint</span><span class="o">=</span><span class="s1">'blueprint.login_page'</span><span class="p">,</span>
|
||||
<span class="n">message</span><span class="o">=</span><span class="s2">"Login needed"</span>
|
||||
<span class="p">)</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">admin_page</span><span class="p">():</span>
|
||||
<span class="o">...</span>
|
||||
</pre></div>
|
||||
<h5>Example of a route that if the user is already logged in, redirects to the specified endpoint:</h5>
|
||||
<div class="highlight"><pre><span></span><span class="nd">@bp</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/login-page"</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"GET"</span><span class="p">])</span>
|
||||
<span class="nd">@login_check</span><span class="p">(</span>
|
||||
<span class="s1">'logged_in'</span><span class="p">,</span>
|
||||
<span class="kc">True</span><span class="p">,</span>
|
||||
<span class="n">pass_endpoint</span><span class="o">=</span><span class="s1">'blueprint.admin_page'</span><span class="p">,</span>
|
||||
<span class="n">message</span><span class="o">=</span><span class="s2">"Already logged in"</span>
|
||||
<span class="p">)</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">login_page</span><span class="p">():</span>
|
||||
<span class="o">...</span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
326
docs/v1/quart_imp_security-pass_function_check.html
Normal file
@@ -0,0 +1,326 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Pass_function_check - Quart_imp.security | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">pass_function_check - quart_imp.security</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.security</span> <span class="kn">import</span> <span class="n">pass_function_check</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">pass_function_check</span><span class="p">(</span>
|
||||
<span class="n">function</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Callable</span><span class="p">,</span>
|
||||
<span class="n">predefined_args</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">fail_endpoint</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">pass_endpoint</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">endpoint_kwargs</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">int</span><span class="p">]]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">message</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">message_category</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"message"</span><span class="p">,</span>
|
||||
<span class="n">fail_on_missing_kwargs</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="n">with_app_context</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="p">)</span>
|
||||
</pre></div>
|
||||
<p><strong>NOTE: This was added mostly as an experimental feature, but ended up being useful in some cases.</strong></p>
|
||||
<p>A decorator that takes the result of a function and checks if it is True or False.</p>
|
||||
<p>URL variables from <code>@route</code> will be read by this decorator.
|
||||
To use URL variables in your passed in function,
|
||||
make sure your functions argument(s) name(s) match the name(s) of the URL variable(s).</p>
|
||||
<p><strong>Example:</strong></p>
|
||||
<div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">check_if_number</span><span class="p">(</span><span class="n">value</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">int</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="kc">True</span>
|
||||
<span class="k">return</span> <span class="kc">False</span>
|
||||
|
||||
<span class="nd">@bp</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/admin-page/<int:value>"</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"GET"</span><span class="p">])</span>
|
||||
<span class="nd">@login_check</span><span class="p">(</span><span class="s1">'logged_in'</span><span class="p">,</span> <span class="kc">True</span><span class="p">,</span> <span class="s1">'blueprint.login_page'</span><span class="p">)</span> <span class="c1"># can be mixed with login_check</span>
|
||||
<span class="nd">@pass_function_check</span><span class="p">(</span>
|
||||
<span class="n">check_if_number</span><span class="p">,</span>
|
||||
<span class="n">predefined_args</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">fail_endpoint</span><span class="o">=</span><span class="s1">'www.index'</span><span class="p">,</span>
|
||||
<span class="n">message</span><span class="o">=</span><span class="s2">"Failed message"</span>
|
||||
<span class="p">)</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">admin_page</span><span class="p">():</span>
|
||||
<span class="o">...</span>
|
||||
|
||||
<span class="nd">@bp</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/admin-page/<int:value>"</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"GET"</span><span class="p">])</span>
|
||||
<span class="nd">@login_check</span><span class="p">(</span><span class="s1">'logged_in'</span><span class="p">,</span> <span class="kc">True</span><span class="p">,</span> <span class="s1">'blueprint.login_page'</span><span class="p">)</span> <span class="c1"># can be mixed with login_check</span>
|
||||
<span class="nd">@pass_function_check</span><span class="p">(</span>
|
||||
<span class="n">check_if_number</span><span class="p">,</span>
|
||||
<span class="n">predefined_args</span><span class="o">=</span><span class="p">{</span><span class="s1">'value'</span><span class="p">:</span> <span class="mi">10</span><span class="p">},</span>
|
||||
<span class="n">fail_endpoint</span><span class="o">=</span><span class="s1">'www.index'</span><span class="p">,</span>
|
||||
<span class="n">message</span><span class="o">=</span><span class="s2">"Failed message"</span>
|
||||
<span class="p">)</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">admin_page_overwrite</span><span class="p">():</span>
|
||||
<span class="o">...</span>
|
||||
</pre></div>
|
||||
<p><strong>Advanced use case:</strong></p>
|
||||
<p>Here's an example of accessing quart.session from within the passed in function. including the
|
||||
<code>with_app_context</code> parameter, the function will be called with <code>app_context()</code>.</p>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart</span> <span class="kn">import</span> <span class="n">current_app</span>
|
||||
<span class="kn">from</span> <span class="nn">quart</span> <span class="kn">import</span> <span class="n">session</span>
|
||||
|
||||
<span class="o">...</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">check_if_number</span><span class="p">(</span><span class="n">number</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">session_</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="n">session_</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">session_</span><span class="p">)</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="nb">int</span><span class="p">(</span><span class="n">number</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="kc">True</span>
|
||||
<span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="kc">False</span>
|
||||
|
||||
<span class="nd">@bp</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/pass-func-check-with-url-var/<number>"</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"GET"</span><span class="p">])</span>
|
||||
<span class="nd">@pass_function_check</span><span class="p">(</span>
|
||||
<span class="n">check_if_number</span><span class="p">,</span>
|
||||
<span class="n">predefined_args</span><span class="o">=</span><span class="p">{</span><span class="s1">'number'</span><span class="p">:</span> <span class="mi">10</span><span class="p">,</span> <span class="s1">'session_'</span><span class="p">:</span> <span class="n">session</span><span class="p">},</span>
|
||||
<span class="n">fail_endpoint</span><span class="o">=</span><span class="s2">"www.index"</span><span class="p">,</span>
|
||||
<span class="n">with_app_context</span><span class="o">=</span><span class="kc">True</span>
|
||||
<span class="p">)</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">admin_page_overwrite_with_session</span><span class="p">():</span>
|
||||
<span class="o">...</span>
|
||||
</pre></div>
|
||||
<p>If you pass in a predefined arg that has the same key name as a session variable that exists, the value
|
||||
of that predefined arg will be replaced with the session variable value.</p>
|
||||
<div class="highlight"><pre><span></span><span class="n">session</span><span class="p">[</span><span class="s1">'car'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'Toyota'</span>
|
||||
<span class="o">...</span>
|
||||
<span class="k">def</span> <span class="nf">check_function</span><span class="p">(</span><span class="n">car</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="n">car</span> <span class="o">==</span> <span class="s1">'Toyota'</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="kc">True</span>
|
||||
<span class="k">return</span> <span class="kc">False</span>
|
||||
<span class="o">...</span>
|
||||
<span class="nd">@bp</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/pass-func-check-with-url-var/<number>"</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"GET"</span><span class="p">])</span>
|
||||
<span class="nd">@pass_function_check</span><span class="p">(</span>
|
||||
<span class="n">check_function</span><span class="p">,</span>
|
||||
<span class="n">predefined_args</span><span class="o">=</span><span class="p">{</span><span class="s1">'car'</span><span class="p">:</span> <span class="n">session</span><span class="p">},</span>
|
||||
<span class="o">...</span>
|
||||
</pre></div>
|
||||
<p>This will pass, as pass_function_check will replace the value of the predefined arg 'car' with the value
|
||||
of the session variable 'car'.</p>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
271
docs/v1/quart_imp_security-permission_check.html
Normal file
@@ -0,0 +1,271 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Permission_check - Quart_imp.security | Quart-Imp</title>
|
||||
<link rel="stylesheet" href="static/water.css">
|
||||
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
|
||||
<link rel="manifest" href="static/site.webmanifest">
|
||||
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<aside>
|
||||
<img src="static/Flask-Imp-Medium.png" alt="Flask-Imp Logo" style="margin-top: 20px; width: 50%">
|
||||
<h1>Quart-Imp</h1>
|
||||
<div><small>Version: 1.0.x</small></div>
|
||||
<div><small>Last Updated:</small></div>
|
||||
<div><small>Fri, 16 Aug 2024</small></div>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="index.html"><strong>Index</strong></a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><strong>CLI Commands</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>Imp</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="imp-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-init_session.html">init_session</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>ImpBlueprint</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="impblueprint-introduction.html">Introduction</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-init.html">__init__</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.config</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.security</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li><strong>quart_imp.auth</strong></li>
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
|
||||
|
||||
|
||||
|
||||
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
|
||||
</aside>
|
||||
|
||||
<section>
|
||||
<h1 style="font-size: 2.6rem; margin: 0;">permission_check - quart_imp.security</h1>
|
||||
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">quart_imp.security</span> <span class="kn">import</span> <span class="n">permission_check</span>
|
||||
</pre></div>
|
||||
<div class="highlight"><pre><span></span><span class="n">permission_check</span><span class="p">(</span>
|
||||
<span class="n">session_key</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
|
||||
<span class="n">values_allowed</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Union</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">int</span><span class="p">,</span> <span class="nb">bool</span><span class="p">]],</span> <span class="nb">str</span><span class="p">,</span> <span class="nb">int</span><span class="p">,</span> <span class="nb">bool</span><span class="p">],</span>
|
||||
<span class="n">fail_endpoint</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">endpoint_kwargs</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">int</span><span class="p">]]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">message</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">message_category</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"message"</span>
|
||||
<span class="p">)</span>
|
||||
</pre></div>
|
||||
<p><code>@permission_check(...)</code></p>
|
||||
<hr />
|
||||
<p>A decorator that checks if the specified session key exists and its value(s) match the specified value(s).</p>
|
||||
<p><code>session_key</code> The session key to check for.</p>
|
||||
<p><code>values_allowed</code> A list of or singular value(s) that the session key must contain.</p>
|
||||
<p><code>fail_endpoint</code> The endpoint to redirect to if the session key does not exist or does not contain the specified values.</p>
|
||||
<p><code>endpoint_kwargs</code> A dictionary of keyword arguments to pass to the redirect endpoint.</p>
|
||||
<p><code>message</code> If a message is specified, a flash message is shown.</p>
|
||||
<p><code>message_category</code> The category of the flash message.</p>
|
||||
<h5>Example:</h5>
|
||||
<div class="highlight"><pre><span></span><span class="nd">@bp</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/admin-page"</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"GET"</span><span class="p">])</span>
|
||||
<span class="nd">@login_check</span><span class="p">(</span>
|
||||
<span class="s1">'logged_in'</span><span class="p">,</span>
|
||||
<span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s1">'blueprint.login_page'</span>
|
||||
<span class="p">)</span> <span class="c1"># can be mixed with login_check</span>
|
||||
<span class="nd">@permission_check</span><span class="p">(</span>
|
||||
<span class="s1">'permissions'</span><span class="p">,</span>
|
||||
<span class="p">[</span><span class="s1">'admin'</span><span class="p">],</span>
|
||||
<span class="n">fail_endpoint</span><span class="o">=</span><span class="s1">'www.index'</span><span class="p">,</span>
|
||||
<span class="n">message</span><span class="o">=</span><span class="s2">"Failed message"</span>
|
||||
<span class="p">)</span>
|
||||
<span class="k">async</span> <span class="k">def</span> <span class="nf">admin_page</span><span class="p">():</span>
|
||||
<span class="o">...</span>
|
||||
</pre></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
BIN
docs/v1/static/Flask-Imp-Medium.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
docs/v1/static/android-chrome-192x192.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
docs/v1/static/android-chrome-256x256.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
docs/v1/static/android-chrome-96x96.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
docs/v1/static/apple-touch-icon.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
9
docs/v1/static/browserconfig.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<browserconfig>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square150x150logo src="/mstile-150x150.png"/>
|
||||
<TileColor>#da532c</TileColor>
|
||||
</tile>
|
||||
</msapplication>
|
||||
</browserconfig>
|
||||
BIN
docs/v1/static/favicon-16x16.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
docs/v1/static/favicon-32x32.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
docs/v1/static/favicon.ico
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
docs/v1/static/mstile-150x150.png
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
69
docs/v1/static/pygments.emacs-dull.css
Normal file
@@ -0,0 +1,69 @@
|
||||
.highlight .hll { background-color: #ffffcc }
|
||||
.highlight { background: #161f27; padding: 0.5rem 1rem; border-radius: 5px; }
|
||||
.highlight .c { color: #008800; font-style: italic } /* Comment */
|
||||
.highlight .err { border: 1px solid #FF0000 } /* Error */
|
||||
.highlight .k { color: rgba(170, 34, 255, 0.8); font-weight: bold } /* Keyword */
|
||||
.highlight .o { color: #666666 } /* Operator */
|
||||
.highlight .ch { color: #008800; font-style: italic } /* Comment.Hashbang */
|
||||
.highlight .cm { color: #008800; font-style: italic } /* Comment.Multiline */
|
||||
.highlight .cp { color: #008800 } /* Comment.Preproc */
|
||||
.highlight .cpf { color: #008800; font-style: italic } /* Comment.PreprocFile */
|
||||
.highlight .c1 { color: #008800; font-style: italic } /* Comment.Single */
|
||||
.highlight .cs { color: #008800; font-weight: bold } /* Comment.Special */
|
||||
.highlight .gd { color: #A00000 } /* Generic.Deleted */
|
||||
.highlight .ge { font-style: italic } /* Generic.Emph */
|
||||
.highlight .gr { color: #FF0000 } /* Generic.Error */
|
||||
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
||||
.highlight .gi { color: #00A000 } /* Generic.Inserted */
|
||||
.highlight .go { color: #888888 } /* Generic.Output */
|
||||
.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
|
||||
.highlight .gs { font-weight: bold } /* Generic.Strong */
|
||||
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
|
||||
.highlight .gt { color: #0044DD } /* Generic.Traceback */
|
||||
.highlight .kc { color: rgba(170, 34, 255, 0.8); font-weight: bold } /* Keyword.Constant */
|
||||
.highlight .kd { color: rgba(170, 34, 255, 0.8); font-weight: bold } /* Keyword.Declaration */
|
||||
.highlight .kn { color: rgba(170, 34, 255, 0.8); font-weight: bold } /* Keyword.Namespace */
|
||||
.highlight .kp { color: #AA22FF } /* Keyword.Pseudo */
|
||||
.highlight .kr { color: rgba(170, 34, 255, 0.8); font-weight: bold } /* Keyword.Reserved */
|
||||
.highlight .kt { color: #00BB00; font-weight: bold } /* Keyword.Type */
|
||||
.highlight .m { color: #666666 } /* Literal.Number */
|
||||
.highlight .s { color: #BB4444 } /* Literal.String */
|
||||
.highlight .na { color: #BB4444 } /* Name.Attribute */
|
||||
.highlight .nb { color: #AA22FF } /* Name.Builtin */
|
||||
.highlight .nc { color: rgba(142, 142, 255, 0.8)} /* Name.Class */
|
||||
.highlight .no { color: #880000 } /* Name.Constant */
|
||||
.highlight .nd { color: #AA22FF } /* Name.Decorator */
|
||||
.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
|
||||
.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
|
||||
.highlight .nf { color: #00A000 } /* Name.Function */
|
||||
.highlight .nl { color: #A0A000 } /* Name.Label */
|
||||
.highlight .nn { color: rgba(142, 142, 255, 0.8); font-weight: bold } /* Name.Namespace */
|
||||
.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
|
||||
.highlight .nv { color: #B8860B } /* Name.Variable */
|
||||
.highlight .ow { color: rgba(170, 34, 255, 0.8); font-weight: bold } /* Operator.Word */
|
||||
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
|
||||
.highlight .mb { color: #666666 } /* Literal.Number.Bin */
|
||||
.highlight .mf { color: #666666 } /* Literal.Number.Float */
|
||||
.highlight .mh { color: #666666 } /* Literal.Number.Hex */
|
||||
.highlight .mi { color: #666666 } /* Literal.Number.Integer */
|
||||
.highlight .mo { color: #666666 } /* Literal.Number.Oct */
|
||||
.highlight .sa { color: #BB4444 } /* Literal.String.Affix */
|
||||
.highlight .sb { color: #BB4444 } /* Literal.String.Backtick */
|
||||
.highlight .sc { color: #BB4444 } /* Literal.String.Char */
|
||||
.highlight .dl { color: #BB4444 } /* Literal.String.Delimiter */
|
||||
.highlight .sd { color: #BB4444; font-style: italic } /* Literal.String.Doc */
|
||||
.highlight .s2 { color: #BB4444 } /* Literal.String.Double */
|
||||
.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
|
||||
.highlight .sh { color: #BB4444 } /* Literal.String.Heredoc */
|
||||
.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
|
||||
.highlight .sx { color: #008000 } /* Literal.String.Other */
|
||||
.highlight .sr { color: #BB6688 } /* Literal.String.Regex */
|
||||
.highlight .s1 { color: #BB4444 } /* Literal.String.Single */
|
||||
.highlight .ss { color: #B8860B } /* Literal.String.Symbol */
|
||||
.highlight .bp { color: #AA22FF } /* Name.Builtin.Pseudo */
|
||||
.highlight .fm { color: #00A000 } /* Name.Function.Magic */
|
||||
.highlight .vc { color: #B8860B } /* Name.Variable.Class */
|
||||
.highlight .vg { color: #B8860B } /* Name.Variable.Global */
|
||||
.highlight .vi { color: #B8860B } /* Name.Variable.Instance */
|
||||
.highlight .vm { color: #B8860B } /* Name.Variable.Magic */
|
||||
.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
|
||||
17
docs/v1/static/safari-pinned-tab.svg
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
||||
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
||||
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
||||
width="118.000000pt" height="118.000000pt" viewBox="0 0 118.000000 118.000000"
|
||||
preserveAspectRatio="xMidYMid meet">
|
||||
<metadata>
|
||||
Created by potrace 1.14, written by Peter Selinger 2001-2017
|
||||
</metadata>
|
||||
<g transform="translate(0.000000,118.000000) scale(0.100000,-0.100000)"
|
||||
fill="#000000" stroke="none">
|
||||
<path d="M450 1164 c-205 -53 -375 -219 -431 -419 -15 -52 -19 -204 -7 -265
|
||||
21 -110 74 -207 163 -295 112 -113 229 -164 386 -171 114 -5 198 13 284 59 11
|
||||
6 33 17 48 25 48 24 144 120 185 185 112 179 119 400 19 592 -62 119 -208 237
|
||||
-344 281 -67 22 -234 26 -303 8z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 782 B |
19
docs/v1/static/site.webmanifest
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "",
|
||||
"short_name": "",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "/android-chrome-256x256.png",
|
||||
"sizes": "256x256",
|
||||
"type": "image/png"
|
||||
}
|
||||
],
|
||||
"theme_color": "#ffffff",
|
||||
"background_color": "#ffffff",
|
||||
"display": "standalone"
|
||||
}
|
||||
929
docs/v1/static/water.css
Normal file
@@ -0,0 +1,929 @@
|
||||
/**
|
||||
* Forced dark theme version
|
||||
*/
|
||||
|
||||
:root {
|
||||
--background-body: #202b38;
|
||||
--background: #161f27;
|
||||
--background-alt: #1a242f;
|
||||
--selection: #1c76c5;
|
||||
--text-main: #dbdbdb;
|
||||
--text-bright: #fff;
|
||||
--text-muted: #a9b1ba;
|
||||
--links: #41adff;
|
||||
--focus: #0096bfab;
|
||||
--border: #526980;
|
||||
--code: #ffbe85;
|
||||
--animation-duration: 0.1s;
|
||||
--button-base: #0c151c;
|
||||
--button-hover: #040a0f;
|
||||
--scrollbar-thumb: var(--button-hover);
|
||||
--scrollbar-thumb-hover: rgb(0, 0, 0);
|
||||
--form-placeholder: #a9a9a9;
|
||||
--form-text: #fff;
|
||||
--variable: #d941e2;
|
||||
--highlight: #efdb43;
|
||||
--select-arrow: url("data:image/svg+xml;charset=utf-8,%3C?xml version='1.0' encoding='utf-8'?%3E %3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' height='62.5' width='116.9' fill='%23efefef'%3E %3Cpath d='M115.3,1.6 C113.7,0 111.1,0 109.5,1.6 L58.5,52.7 L7.4,1.6 C5.8,0 3.2,0 1.6,1.6 C0,3.2 0,5.8 1.6,7.4 L55.5,61.3 C56.3,62.1 57.3,62.5 58.4,62.5 C59.4,62.5 60.5,62.1 61.3,61.3 L115.2,7.4 C116.9,5.8 116.9,3.2 115.3,1.6Z'/%3E %3C/svg%3E");
|
||||
}
|
||||
|
||||
html {
|
||||
scrollbar-color: #040a0f #202b38;
|
||||
scrollbar-color: var(--scrollbar-thumb) var(--background-body);
|
||||
scrollbar-width: thin;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
|
||||
line-height: 1.4;
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
padding: 0 10px;
|
||||
word-wrap: break-word;
|
||||
color: #dbdbdb;
|
||||
color: var(--text-main);
|
||||
background: #202b38;
|
||||
background: var(--background-body);
|
||||
text-rendering: optimizeLegibility;
|
||||
letter-spacing: 1px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
aside {
|
||||
width: 250px;
|
||||
border-right: 1px solid rgba(220, 220, 220, 0.5);
|
||||
padding-right: 10px;
|
||||
padding-bottom: 40px;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
aside ul {
|
||||
list-style: none;
|
||||
padding-left: 0;
|
||||
padding-bottom: 10px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
aside ul > ul {
|
||||
padding-top: 5px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
section {
|
||||
width: 750px;
|
||||
padding-left: 290px;
|
||||
padding-top: 30px;
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
|
||||
section > div:nth-child(2) {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
hr {
|
||||
margin: 40px 0;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
margin-bottom: 1rem;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
button {
|
||||
transition: background-color 0.1s linear,
|
||||
border-color 0.1s linear,
|
||||
color 0.1s linear,
|
||||
box-shadow 0.1s linear,
|
||||
transform 0.1s ease;
|
||||
transition: background-color var(--animation-duration) linear,
|
||||
border-color var(--animation-duration) linear,
|
||||
color var(--animation-duration) linear,
|
||||
box-shadow var(--animation-duration) linear,
|
||||
transform var(--animation-duration) ease;
|
||||
}
|
||||
|
||||
input {
|
||||
transition: background-color 0.1s linear,
|
||||
border-color 0.1s linear,
|
||||
color 0.1s linear,
|
||||
box-shadow 0.1s linear,
|
||||
transform 0.1s ease;
|
||||
transition: background-color var(--animation-duration) linear,
|
||||
border-color var(--animation-duration) linear,
|
||||
color var(--animation-duration) linear,
|
||||
box-shadow var(--animation-duration) linear,
|
||||
transform var(--animation-duration) ease;
|
||||
}
|
||||
|
||||
textarea {
|
||||
transition: background-color 0.1s linear,
|
||||
border-color 0.1s linear,
|
||||
color 0.1s linear,
|
||||
box-shadow 0.1s linear,
|
||||
transform 0.1s ease;
|
||||
transition: background-color var(--animation-duration) linear,
|
||||
border-color var(--animation-duration) linear,
|
||||
color var(--animation-duration) linear,
|
||||
box-shadow var(--animation-duration) linear,
|
||||
transform var(--animation-duration) ease;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2.2em;
|
||||
margin-top: 0;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
margin-bottom: 12px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #fff;
|
||||
color: var(--text-bright);
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #fff;
|
||||
color: var(--text-bright);
|
||||
}
|
||||
|
||||
h3 {
|
||||
color: #fff;
|
||||
color: var(--text-bright);
|
||||
}
|
||||
|
||||
h4 {
|
||||
color: #fff;
|
||||
color: var(--text-bright);
|
||||
}
|
||||
|
||||
h5 {
|
||||
color: #fff;
|
||||
color: var(--text-bright);
|
||||
}
|
||||
|
||||
h6 {
|
||||
color: #fff;
|
||||
color: var(--text-bright);
|
||||
}
|
||||
|
||||
strong {
|
||||
color: #fff;
|
||||
color: var(--text-bright);
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6,
|
||||
b,
|
||||
strong,
|
||||
th {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
q::before {
|
||||
content: none;
|
||||
}
|
||||
|
||||
q::after {
|
||||
content: none;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
border-left: 4px solid #0096bfab;
|
||||
border-left: 4px solid var(--focus);
|
||||
margin: 1.5em 0;
|
||||
padding: 0.5em 1em;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
q {
|
||||
border-left: 4px solid #0096bfab;
|
||||
border-left: 4px solid var(--focus);
|
||||
margin: 1.5em 0;
|
||||
padding: 0.5em 1em;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
blockquote > footer {
|
||||
font-style: normal;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
blockquote cite {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
address {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
a[href^='mailto\:']::before {
|
||||
content: '📧 ';
|
||||
}
|
||||
|
||||
a[href^='tel\:']::before {
|
||||
content: '📞 ';
|
||||
}
|
||||
|
||||
a[href^='sms\:']::before {
|
||||
content: '💬 ';
|
||||
}
|
||||
|
||||
mark {
|
||||
background-color: #efdb43;
|
||||
background-color: var(--highlight);
|
||||
border-radius: 2px;
|
||||
padding: 0 2px 0 2px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
a > code,
|
||||
a > strong {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
button,
|
||||
select,
|
||||
input[type='submit'],
|
||||
input[type='reset'],
|
||||
input[type='button'],
|
||||
input[type='checkbox'],
|
||||
input[type='range'],
|
||||
input[type='radio'] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
input,
|
||||
select {
|
||||
display: block;
|
||||
}
|
||||
|
||||
[type='checkbox'],
|
||||
[type='radio'] {
|
||||
display: initial;
|
||||
}
|
||||
|
||||
input {
|
||||
color: #fff;
|
||||
color: var(--form-text);
|
||||
background-color: #161f27;
|
||||
background-color: var(--background);
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
margin-right: 6px;
|
||||
margin-bottom: 6px;
|
||||
padding: 10px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
button {
|
||||
color: #fff;
|
||||
color: var(--form-text);
|
||||
background-color: #161f27;
|
||||
background-color: var(--background);
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
margin-right: 6px;
|
||||
margin-bottom: 6px;
|
||||
padding: 10px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
textarea {
|
||||
color: #fff;
|
||||
color: var(--form-text);
|
||||
background-color: #161f27;
|
||||
background-color: var(--background);
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
margin-right: 6px;
|
||||
margin-bottom: 6px;
|
||||
padding: 10px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
select {
|
||||
color: #fff;
|
||||
color: var(--form-text);
|
||||
background-color: #161f27;
|
||||
background-color: var(--background);
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
margin-right: 6px;
|
||||
margin-bottom: 6px;
|
||||
padding: 10px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
button {
|
||||
background-color: #0c151c;
|
||||
background-color: var(--button-base);
|
||||
padding-right: 30px;
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
input[type='submit'] {
|
||||
background-color: #0c151c;
|
||||
background-color: var(--button-base);
|
||||
padding-right: 30px;
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
input[type='reset'] {
|
||||
background-color: #0c151c;
|
||||
background-color: var(--button-base);
|
||||
padding-right: 30px;
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
input[type='button'] {
|
||||
background-color: #0c151c;
|
||||
background-color: var(--button-base);
|
||||
padding-right: 30px;
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background: #040a0f;
|
||||
background: var(--button-hover);
|
||||
}
|
||||
|
||||
input[type='submit']:hover {
|
||||
background: #040a0f;
|
||||
background: var(--button-hover);
|
||||
}
|
||||
|
||||
input[type='reset']:hover {
|
||||
background: #040a0f;
|
||||
background: var(--button-hover);
|
||||
}
|
||||
|
||||
input[type='button']:hover {
|
||||
background: #040a0f;
|
||||
background: var(--button-hover);
|
||||
}
|
||||
|
||||
input[type='color'] {
|
||||
min-height: 2rem;
|
||||
padding: 8px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
input[type='checkbox'],
|
||||
input[type='radio'] {
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
}
|
||||
|
||||
input[type='radio'] {
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
input {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
label {
|
||||
vertical-align: middle;
|
||||
margin-bottom: 4px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
input:not([type='checkbox']):not([type='radio']),
|
||||
input[type='range'],
|
||||
select,
|
||||
button,
|
||||
textarea {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
textarea {
|
||||
display: block;
|
||||
margin-right: 0;
|
||||
box-sizing: border-box;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
textarea:not([cols]) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
textarea:not([rows]) {
|
||||
min-height: 40px;
|
||||
height: 140px;
|
||||
}
|
||||
|
||||
select {
|
||||
background: #161f27 url("data:image/svg+xml;charset=utf-8,%3C?xml version='1.0' encoding='utf-8'?%3E %3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' height='62.5' width='116.9' fill='%23efefef'%3E %3Cpath d='M115.3,1.6 C113.7,0 111.1,0 109.5,1.6 L58.5,52.7 L7.4,1.6 C5.8,0 3.2,0 1.6,1.6 C0,3.2 0,5.8 1.6,7.4 L55.5,61.3 C56.3,62.1 57.3,62.5 58.4,62.5 C59.4,62.5 60.5,62.1 61.3,61.3 L115.2,7.4 C116.9,5.8 116.9,3.2 115.3,1.6Z'/%3E %3C/svg%3E") calc(100% - 12px) 50% / 12px no-repeat;
|
||||
background: var(--background) var(--select-arrow) calc(100% - 12px) 50% / 12px no-repeat;
|
||||
padding-right: 35px;
|
||||
}
|
||||
|
||||
select::-ms-expand {
|
||||
display: none;
|
||||
}
|
||||
|
||||
select[multiple] {
|
||||
padding-right: 10px;
|
||||
background-image: none;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
input:focus {
|
||||
box-shadow: 0 0 0 2px #0096bfab;
|
||||
box-shadow: 0 0 0 2px var(--focus);
|
||||
}
|
||||
|
||||
select:focus {
|
||||
box-shadow: 0 0 0 2px #0096bfab;
|
||||
box-shadow: 0 0 0 2px var(--focus);
|
||||
}
|
||||
|
||||
button:focus {
|
||||
box-shadow: 0 0 0 2px #0096bfab;
|
||||
box-shadow: 0 0 0 2px var(--focus);
|
||||
}
|
||||
|
||||
textarea:focus {
|
||||
box-shadow: 0 0 0 2px #0096bfab;
|
||||
box-shadow: 0 0 0 2px var(--focus);
|
||||
}
|
||||
|
||||
input[type='checkbox']:active,
|
||||
input[type='radio']:active,
|
||||
input[type='submit']:active,
|
||||
input[type='reset']:active,
|
||||
input[type='button']:active,
|
||||
input[type='range']:active,
|
||||
button:active {
|
||||
transform: translateY(2px);
|
||||
}
|
||||
|
||||
input:disabled,
|
||||
select:disabled,
|
||||
button:disabled,
|
||||
textarea:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
::-moz-placeholder {
|
||||
color: #a9a9a9;
|
||||
color: var(--form-placeholder);
|
||||
}
|
||||
|
||||
:-ms-input-placeholder {
|
||||
color: #a9a9a9;
|
||||
color: var(--form-placeholder);
|
||||
}
|
||||
|
||||
::-ms-input-placeholder {
|
||||
color: #a9a9a9;
|
||||
color: var(--form-placeholder);
|
||||
}
|
||||
|
||||
::placeholder {
|
||||
color: #a9a9a9;
|
||||
color: var(--form-placeholder);
|
||||
}
|
||||
|
||||
fieldset {
|
||||
border: 1px #0096bfab solid;
|
||||
border: 1px var(--focus) solid;
|
||||
border-radius: 6px;
|
||||
margin: 0;
|
||||
margin-bottom: 12px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
legend {
|
||||
font-size: 0.9em;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
input[type='range'] {
|
||||
margin: 10px 0;
|
||||
padding: 10px 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
input[type='range']:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
input[type='range']::-webkit-slider-runnable-track {
|
||||
width: 100%;
|
||||
height: 9.5px;
|
||||
-webkit-transition: 0.2s;
|
||||
transition: 0.2s;
|
||||
background: #161f27;
|
||||
background: var(--background);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
input[type='range']::-webkit-slider-thumb {
|
||||
box-shadow: 0 1px 1px #000, 0 0 1px #0d0d0d;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
border-radius: 50%;
|
||||
background: #526980;
|
||||
background: var(--border);
|
||||
-webkit-appearance: none;
|
||||
margin-top: -7px;
|
||||
}
|
||||
|
||||
input[type='range']:focus::-webkit-slider-runnable-track {
|
||||
background: #161f27;
|
||||
background: var(--background);
|
||||
}
|
||||
|
||||
input[type='range']::-moz-range-track {
|
||||
width: 100%;
|
||||
height: 9.5px;
|
||||
-moz-transition: 0.2s;
|
||||
transition: 0.2s;
|
||||
background: #161f27;
|
||||
background: var(--background);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
input[type='range']::-moz-range-thumb {
|
||||
box-shadow: 1px 1px 1px #000, 0 0 1px #0d0d0d;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
border-radius: 50%;
|
||||
background: #526980;
|
||||
background: var(--border);
|
||||
}
|
||||
|
||||
input[type='range']::-ms-track {
|
||||
width: 100%;
|
||||
height: 9.5px;
|
||||
background: transparent;
|
||||
border-color: transparent;
|
||||
border-width: 16px 0;
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
input[type='range']::-ms-fill-lower {
|
||||
background: #161f27;
|
||||
background: var(--background);
|
||||
border: 0.2px solid #010101;
|
||||
border-radius: 3px;
|
||||
box-shadow: 1px 1px 1px #000, 0 0 1px #0d0d0d;
|
||||
}
|
||||
|
||||
input[type='range']::-ms-fill-upper {
|
||||
background: #161f27;
|
||||
background: var(--background);
|
||||
border: 0.2px solid #010101;
|
||||
border-radius: 3px;
|
||||
box-shadow: 1px 1px 1px #000, 0 0 1px #0d0d0d;
|
||||
}
|
||||
|
||||
input[type='range']::-ms-thumb {
|
||||
box-shadow: 1px 1px 1px #000, 0 0 1px #0d0d0d;
|
||||
border: 1px solid #000;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
border-radius: 50%;
|
||||
background: #526980;
|
||||
background: var(--border);
|
||||
}
|
||||
|
||||
input[type='range']:focus::-ms-fill-lower {
|
||||
background: #161f27;
|
||||
background: var(--background);
|
||||
}
|
||||
|
||||
input[type='range']:focus::-ms-fill-upper {
|
||||
background: #161f27;
|
||||
background: var(--background);
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #41adff;
|
||||
color: var(--links);
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
code {
|
||||
background: #161f27;
|
||||
background: var(--background);
|
||||
color: #ffbe85;
|
||||
color: var(--code);
|
||||
padding: 2.5px 5px;
|
||||
border-radius: 6px;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
samp {
|
||||
background: #161f27;
|
||||
background: var(--background);
|
||||
color: #ffbe85;
|
||||
color: var(--code);
|
||||
padding: 2.5px 5px;
|
||||
border-radius: 6px;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
time {
|
||||
background: #161f27;
|
||||
background: var(--background);
|
||||
color: #ffbe85;
|
||||
color: var(--code);
|
||||
padding: 2.5px 5px;
|
||||
border-radius: 6px;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
pre {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
pre > code {
|
||||
padding: 10px;
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
var {
|
||||
color: #d941e2;
|
||||
color: var(--variable);
|
||||
font-style: normal;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
kbd {
|
||||
background: #161f27;
|
||||
background: var(--background);
|
||||
border: 1px solid #526980;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 2px;
|
||||
color: #dbdbdb;
|
||||
color: var(--text-main);
|
||||
padding: 2px 4px 2px 4px;
|
||||
}
|
||||
|
||||
img,
|
||||
video {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
hr {
|
||||
border: none;
|
||||
border-top: 1px solid #526980;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 10px;
|
||||
width: 100%;
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
table caption {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
td,
|
||||
th {
|
||||
padding: 6px;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
thead {
|
||||
border-bottom: 1px solid #526980;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
tfoot {
|
||||
border-top: 1px solid #526980;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
tbody tr:nth-child(even) {
|
||||
background-color: #161f27;
|
||||
background-color: var(--background);
|
||||
}
|
||||
|
||||
tbody tr:nth-child(even) button {
|
||||
background-color: #1a242f;
|
||||
background-color: var(--background-alt);
|
||||
}
|
||||
|
||||
tbody tr:nth-child(even) button:hover {
|
||||
background-color: #202b38;
|
||||
background-color: var(--background-body);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: #161f27;
|
||||
background: var(--background);
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #040a0f;
|
||||
background: var(--scrollbar-thumb);
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: rgb(0, 0, 0);
|
||||
background: var(--scrollbar-thumb-hover);
|
||||
}
|
||||
|
||||
::-moz-selection {
|
||||
background-color: #1c76c5;
|
||||
background-color: var(--selection);
|
||||
color: #fff;
|
||||
color: var(--text-bright);
|
||||
}
|
||||
|
||||
::selection {
|
||||
background-color: #1c76c5;
|
||||
background-color: var(--selection);
|
||||
color: #fff;
|
||||
color: var(--text-bright);
|
||||
}
|
||||
|
||||
details {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
background-color: #1a242f;
|
||||
background-color: var(--background-alt);
|
||||
padding: 10px 10px 0;
|
||||
margin: 1em 0;
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
details[open] {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
details > :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
details[open] summary {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
background-color: #161f27;
|
||||
background-color: var(--background);
|
||||
padding: 10px;
|
||||
margin: -10px -10px 0;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
summary:hover,
|
||||
summary:focus {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
details > :not(summary) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
summary::-webkit-details-marker {
|
||||
color: #dbdbdb;
|
||||
color: var(--text-main);
|
||||
}
|
||||
|
||||
dialog {
|
||||
background-color: #1a242f;
|
||||
background-color: var(--background-alt);
|
||||
color: #dbdbdb;
|
||||
color: var(--text-main);
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
border-color: #526980;
|
||||
border-color: var(--border);
|
||||
padding: 10px 30px;
|
||||
}
|
||||
|
||||
dialog > header:first-child {
|
||||
background-color: #161f27;
|
||||
background-color: var(--background);
|
||||
border-radius: 6px 6px 0 0;
|
||||
margin: -10px -30px 10px;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
dialog::-webkit-backdrop {
|
||||
background: #0000009c;
|
||||
-webkit-backdrop-filter: blur(4px);
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
|
||||
dialog::backdrop {
|
||||
background: #0000009c;
|
||||
-webkit-backdrop-filter: blur(4px);
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
|
||||
footer {
|
||||
border-top: 1px solid #526980;
|
||||
border-top: 1px solid var(--border);
|
||||
padding-top: 10px;
|
||||
color: #a9b1ba;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
body > footer {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
@media print {
|
||||
body,
|
||||
pre,
|
||||
code,
|
||||
summary,
|
||||
details,
|
||||
button,
|
||||
input,
|
||||
textarea {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
button,
|
||||
input,
|
||||
textarea {
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
body,
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6,
|
||||
pre,
|
||||
code,
|
||||
button,
|
||||
input,
|
||||
textarea,
|
||||
footer,
|
||||
summary,
|
||||
strong {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
summary::marker {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
summary::-webkit-details-marker {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
tbody tr:nth-child(even) {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #00f;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||