403Webshell
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/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/saltstack/salt/lib/python3.10/site-packages/salt/auth/keystone.py
"""
Provide authentication using OpenStack Keystone

:depends:   - keystoneclient Python module
"""

try:
    from keystoneclient.exceptions import AuthorizationFailure, Unauthorized
    from keystoneclient.v2_0 import client
except ImportError:
    pass


def get_auth_url():
    """
    Try and get the URL from the config, else return localhost
    """
    try:
        return __opts__["keystone.auth_url"]
    except KeyError:
        return "http://localhost:35357/v2.0"


def auth(username, password):
    """
    Try and authenticate
    """
    try:
        keystone = client.Client(
            username=username, password=password, auth_url=get_auth_url()
        )
        return keystone.authenticate()
    except (AuthorizationFailure, Unauthorized):
        return False


if __name__ == "__main__":
    __opts__ = {}
    if auth("test", "test"):
        print("Authenticated")
    else:
        print("Failed to authenticate")

Youez - 2016 - github.com/yon3zu
LinuXploit