- The
auth
component uses the Auth
class from lib/auth.py
.
- This class defines abstract methods such as
authenticate
, is_authenticated
and check_password
.
- The
BasicAuth
class inherits from Auth
and defines a basic authentication scheme using the user
and password
stored in the auth_basic
setting.
- The
NoAuth
class inherits from Auth
and disables authentication.
- The
settings
component uses the settings
object from anthias_app/views.py
to store authentication backend configuration.
- The
settings_page
view uses the auth_backends
variable to display available authentication backends in the settings.html
template.
- The
settings_page
view handles updating the settings with POST request data.
- The
authenticate_if_needed
method in Auth
checks if the user is authenticated and initiates authentication if needed.
- The
BasicAuth
class checks the Authorization header for a Basic authentication scheme and compares the username and password with the stored settings.
- The
BasicAuth
class uses the hashlib.sha256
function to hash passwords.
- The
NoAuth
class returns True
for is_authenticated
and does not require authentication.
- The
settings.html
template displays the available authentication backends and the setting form.
## Top-Level Directory Explanations
<a class='local-link directory-link' data-ref=".github/" href="#.github/">.github/</a> - This directory contains GitHub-specific configuration files and workflows for the project.
<a class='local-link directory-link' data-ref=".github/workflows/" href="#.github/workflows/">.github/workflows/</a> - This directory contains YAML files defining continuous integration and deployment workflows for GitHub Actions.
<a class='local-link directory-link' data-ref="ansible/" href="#ansible/">ansible/</a> - Ansible is an open-source configuration management and automation tool. This directory contains Ansible playbooks and roles for managing and configuring the project.
<a class='local-link directory-link' data-ref="ansible/roles/" href="#ansible/roles/">ansible/roles/</a> - This directory contains Ansible roles, which are reusable collections of tasks and configurations for managing specific aspects of a system.
<a class='local-link directory-link' data-ref="ansible/roles/network/" href="#ansible/roles/network/">ansible/roles/network/</a> - This role manages network configurations.
<a class='local-link directory-link' data-ref="ansible/roles/screenly/" href="#ansible/roles/screenly/">ansible/roles/screenly/</a> - This role is specific to the Screenly project and likely contains configurations and tasks related to it.
<a class='local-link directory-link' data-ref="ansible/roles/splashscreen/" href="#ansible/roles/splashscreen/">ansible/roles/splashscreen/</a> - This role manages the configuration of a splash screen.
<a class='local-link directory-link' data-ref="ansible/roles/system/" href="#ansible/roles/system/">ansible/roles/system/</a> - This role manages system-level configurations.
<a class='local-link directory-link' data-ref="anthias_app/" href="#anthias_app/">anthias_app/</a> - This directory contains the main application codebase for the project, likely written in Django.
<a class='local-link directory-link' data-ref="anthias_app/migrations/" href="#anthias_app/migrations/">anthias_app/migrations/</a> - This directory contains database migration files for the Django application.
<a class='local-link directory-link' data-ref="anthias_django/" href="#anthias_django/">anthias_django/</a> - This directory may contain additional Django-specific configuration files and code.
<a class='local-link directory-link' data-ref="api/" href="#api/">api/</a> - This directory contains the API codebase for the project.
<a class='local-link directory-link' data-ref="api/views/" href="#api/views/">api/views/</a> - This directory contains Django views for handling HTTP requests and rendering responses.
<a class='local-link directory-link' data-ref="bin/" href="#bin/">bin/</a> - This directory contains executable scripts for the project.
<a class='local-link directory-link' data-ref="lib/" href="#lib/">lib/</a> - This directory contains reusable Python modules and libraries for the project.
<a class='local-link directory-link' data-ref="static/" href="#static/">static/</a> - This directory contains static files, such as images, CSS, and JavaScript, that are served directly to the user by the web server.
<a class='local-link directory-link' data-ref="static/css/" href="#static/css/">static/css/</a> - This directory contains CSS files.
<a class='local-link directory-link' data-ref="static/fontawesome/" href="#static/fontawesome/">static/fontawesome/</a> - This directory contains Font Awesome icons and styles.
<a class='local-link directory-link' data-ref="static/fontawesome/css/" href="#static/fontawesome/css/">static/fontawesome/css/</a> - This directory contains Font Awesome CSS files.
<a class='local-link directory-link' data-ref="static/js/" href="#static/js/">static/js/</a> - This directory contains JavaScript files.
<a class='local-link directory-link' data-ref="static/spec/" href="#static/spec/">static/spec/</a> - This directory contains test files for the static files.
<a class='local-link directory-link' data-ref="static/spec/jasmine/" href="#static/spec/jasmine/">static/spec/jasmine/</a> - This directory contains Jasmine test files.
<a class='local-link directory-link' data-ref="templates/" href="#templates/">templates/</a> - This directory contains HTML templates used to render dynamic content.
<a class='local-link directory-link' data-ref="tests/" href="#tests/">tests/</a> - This directory contains test files for the project.
<a class='local-link directory-link' data-ref="tools/" href="#tools/">tools/</a> - This directory contains tools and scripts used to develop and maintain the project.
<a class='local-link directory-link' data-ref="website/" href="#website/">website/</a> - This directory contains the website codebase.
<a class='local-link directory-link' data-ref="website/assets/" href="#website/assets/">website/assets/</a> - This directory contains website assets, such as images, CSS, and JavaScript.
<a class='local-link directory-link' data-ref="website/assets/styles/" href="#website/assets/styles/">website/assets/styles/</a> - This directory contains website styles.
<a class='local-link directory-link' data-ref="webview/" href="#webview/">webview/</a> - This directory likely contains configuration files and code for a webview component.
<a class='local-link directory-link' data-ref="webview/res/" href="#webview/res/">webview/res/</a> - This directory contains webview resources, such as images and XML files.
<a class='local-link directory-link' data-ref="webview/src/" href="#webview/src/">webview/src/</a> - This directory contains webview source code.