podpac.authentication.RequestsSessionMixin

class podpac.authentication.RequestsSessionMixin(*args, **kwargs)[source]

Bases: traitlets.traitlets.HasTraits

Methods

__init__(*args, **kwargs)

set_credentials([username, password])

Shortcut to podpac.authentication.set_crendentials() using class member self.hostname for the hostname

Attributes

auth_required

A boolean (True, False) trait.

hostname

A trait for unicode strings.

password

Returns password stored in settings for accessing self.hostname.

session

username

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 member self.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