OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python3
/
dist-packages
/
keyring
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/17/2025 09:32:20 AM
rwxr-xr-x
📄
__init__.py
489 bytes
01/07/2018 08:43:04 PM
rw-r--r--
📄
__main__.py
70 bytes
01/07/2018 08:43:04 PM
rw-r--r--
📁
__pycache__
-
05/09/2024 06:58:02 AM
rwxr-xr-x
📄
backend.py
5.29 KB
01/07/2018 08:43:04 PM
rw-r--r--
📁
backends
-
05/09/2024 06:58:01 AM
rwxr-xr-x
📄
cli.py
3.56 KB
01/07/2018 08:43:04 PM
rw-r--r--
📄
core.py
3.9 KB
01/07/2018 08:43:04 PM
rw-r--r--
📄
credentials.py
1.33 KB
01/07/2018 08:43:04 PM
rw-r--r--
📄
devpi_client.py
199 bytes
01/07/2018 08:43:04 PM
rw-r--r--
📄
errors.py
1.25 KB
01/07/2018 08:43:04 PM
rw-r--r--
📄
getpassbackend.py
312 bytes
01/07/2018 08:43:04 PM
rw-r--r--
📄
http.py
1.23 KB
01/07/2018 08:43:04 PM
rw-r--r--
📄
py27compat.py
1.04 KB
01/07/2018 08:43:04 PM
rw-r--r--
📄
py33compat.py
660 bytes
01/07/2018 08:43:04 PM
rw-r--r--
📁
tests
-
05/09/2024 06:58:01 AM
rwxr-xr-x
📁
util
-
05/09/2024 06:58:01 AM
rwxr-xr-x
Editing: http.py
Close
""" urllib2.HTTPPasswordMgr object using the keyring, for use with the urllib2.HTTPBasicAuthHandler. usage: import urllib2 handlers = [urllib2.HTTPBasicAuthHandler(PasswordMgr())] urllib2.install_opener(handlers) urllib2.urlopen(...) This will prompt for a password if one is required and isn't already in the keyring. Then, it adds it to the keyring for subsequent use. """ import getpass from . import get_password, delete_password, set_password class PasswordMgr(object): def get_username(self, realm, authuri): return getpass.getuser() def add_password(self, realm, authuri, password): user = self.get_username(realm, authuri) set_password(realm, user, password) def find_user_password(self, realm, authuri): user = self.get_username(realm, authuri) password = get_password(realm, user) if password is None: prompt = 'password for %(user)s@%(realm)s for '\ '%(authuri)s: ' % vars() password = getpass.getpass(prompt) set_password(realm, user, password) return user, password def clear_password(self, realm, authuri): user = self.get_username(realm, authuri) delete_password(realm, user)