podpac.authentication.RequestsSessionMixin
- class podpac.authentication.RequestsSessionMixin(**kwargs: Any)[source]
Bases:
HasTraits
Methods
__init__
(*args, **kwargs)set_credentials
([username, password])Shortcut to
podpac.authentication.set_crendentials()
using class memberself.hostname
for the hostnametrait_defaults
(*names, **metadata)Return a trait's default value or a dictionary of them
trait_has_value
(name)Returns True if the specified trait has a value.
trait_values
(**metadata)A
dict
of trait names and their values.Attributes
A boolean (True, False) trait.
A trait for unicode strings.
Returns password stored in settings for accessing self.hostname.
Returns username stored in settings for accessing self.hostname.
- Members:
- __init__(*args, **kwargs)
- auth_required
A boolean (True, False) trait.
- hostname
A trait for unicode strings.
- property password
Returns password stored in settings for accessing self.hostname. The password is stored under key password@<hostname>
- Returns:
password stored in settings for accessing self.hostname
- Return type:
str
- Raises:
ValueError – Raises a ValueError if not password is stored in settings for self.hostname
- property session
- set_credentials(username=None, password=None)[source]
Shortcut to
podpac.authentication.set_crendentials()
using class memberself.hostname
for the hostname- Parameters:
username (str, optional) – Username to store in settings for self.hostname. If no username is provided and the username does not already exist in the settings, the user will be prompted to enter one.
password (str, optional) – Password to store in settings for self.hostname If no password is provided and the password does not already exist in the settings, the user will be prompted to enter one.
- property username
Returns username stored in settings for accessing self.hostname. The username is stored under key username@<hostname>
- Returns:
username stored in settings for accessing self.hostname
- Return type:
str
- Raises:
ValueError – Raises a ValueError if not username is stored in settings for self.hostname