| Server IP : 198.38.94.13 / Your IP : 216.73.217.33 Web Server : Apache System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : revivere ( 1140) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /opt/saltstack/salt/lib/python3.10/site-packages/salt/auth/__pycache__/ |
Upload File : |
o
;j� �
@ s� d Z ddlZddlZddlZzddlZddlmZ dZW n ey0 Z zdZW Y dZ [ ndZ [ ww da
e�e�Z
dZdd� Zd d
� Zdd� Zd
d� Zdd� ZdS )a�
Provide authentication using Django Web Framework
:depends: - Django Web Framework
Django authentication depends on the presence of the django framework in the
``PYTHONPATH``, the Django project's ``settings.py`` file being in the
``PYTHONPATH`` and accessible via the ``DJANGO_SETTINGS_MODULE`` environment
variable.
Django auth can be defined like any other eauth module:
.. code-block:: yaml
external_auth:
django:
fred:
- .*
- '@runner'
This will authenticate Fred via Django and allow him to run any execution
module and all runners.
The authorization details can optionally be located inside the Django database.
The relevant entry in the ``models.py`` file would look like this:
.. code-block:: python
class SaltExternalAuthModel(models.Model):
user_fk = models.ForeignKey(User, on_delete=models.CASCADE)
minion_or_fn_matcher = models.CharField(max_length=255)
minion_fn = models.CharField(max_length=255)
The :conf_master:`external_auth` clause in the master config would then look
like this:
.. code-block:: yaml
external_auth:
django:
^model: <fully-qualified reference to model class>
When a user attempts to authenticate via Django, Salt will import the package
indicated via the keyword ``^model``. That model must have the fields
indicated above, though the model DOES NOT have to be named
'SaltExternalAuthModel'.
� N)�
connectionTF�djangoc C s t rtS dS )NF)�
HAS_DJANGO�__virtualname__� r r �D/opt/saltstack/salt/lib/python3.10/site-packages/salt/auth/django.py�__virtual__I s r c C s&