ibmcloudant.couchdb_session_authenticator

Module for handling session authentication

Module Contents

Classes

CouchDbSessionAuthenticator

The CouchDbSessionAuthenticator utilizes a server url and a username and password pair to obtain a session token, and adds it to requests.

API

class ibmcloudant.couchdb_session_authenticator.CouchDbSessionAuthenticator(username: str, password: str, disable_ssl_verification: bool = False)

Bases: ibm_cloud_sdk_core.authenticators.Authenticator

The CouchDbSessionAuthenticator utilizes a server url and a username and password pair to obtain a session token, and adds it to requests.

Args: username: The CouchDB username password: The CouchDB password

Attributes: token_manager (ibmcloudantsdk.couchdb_session_token_manager.CouchDbSessionTokenManager): Retrieves and manages CouchDB session tokens.

Raises: ValueError: The supplied username, and/or password are not valid.

Initialization

AUTHTYPE_COUCHDB_SESSION = 'COUCHDB_SESSION'
authenticate(req: requests.Request)

Adds session authentication information to the request.

The session token will be added as an update to the BaseService cookie jar.

Args: req: Ignored. BaseService uses the cookie jar for every request

authentication_type() str

Returns this authenticator’s type (‘COUCHDB_SESSION’).

set_jar(jar)

Sets the cookie jar for the authenticator. This is an internal method called by BaseService. Not to be called directly.

validate()

Validates the username, and password for session token requests.

Ensure both the username and password are set.

Raises: ValueError: The supplied username, and/or password are not valid.