StoreAccessTokenProvider¶
- class borneo.kv.StoreAccessTokenProvider(user_name=None, password=None)[source]¶
Bases:
AuthorizationProvider
On-premise only.
StoreAccessTokenProvider is an
borneo.AuthorizationProvider
that performs the following functions:Initial (bootstrap) login to store, using credentials provided.
Storage of bootstrap login token for re-use.
Optionally renews the login token before it expires.
Logs out of the store when closed.
If accessing an insecure instance of Oracle NoSQL Database the default constructor is used, with no arguments.
If accessing a secure instance of Oracle NoSQL Database a user name and password must be provided. That user must already exist in the NoSQL Database and have sufficient permission to perform table operations. That user’s identity is used to authorize all database operations.
To access to a store without security enabled, no parameter need to be set to the constructor.
To access to a secure store, the constructor requires a valid user name and password to access the target store. The user must exist and have sufficient permission to perform table operations required by the application. The user identity is used to authorize all operations performed by the application.
- Parameters:
user_name (str) – the user name to use for the store. This user must exist in the NoSQL Database and is the identity that is used for authorizing all database operations.
password (str) – the password for the user.
- Raises:
IllegalArgumentException – raises the exception if one or more of the parameters is malformed or a required parameter is missing.
Methods Summary
close
()Close the provider, releasing resources such as a stored login token.
Returns the logger of this provider if set, None if not.
Returns whether the login token is to be automatically renewed.
Returns whether the provider is accessing a secured store.
set_auto_renew
(auto_renew)Sets the auto-renew state.
set_logger
(logger)Sets a logger instance for this provider.
Methods Documentation
- __init__(user_name=None, password=None)[source]¶
Creates a StoreAccessTokenProvider
- Parameters:
user_name (str) – the user name to use for the store. This user must exist in the NoSQL Database and is the identity that is used for authorizing all database operations.
password (str) – the password for the user.
- Raises:
IllegalArgumentException – raises the exception if one or more of the parameters is malformed or a required parameter is missing.
- get_logger()[source]¶
Returns the logger of this provider if set, None if not.
- Returns:
the logger.
- Return type:
Logger or None
- is_auto_renew()[source]¶
Returns whether the login token is to be automatically renewed.
- Returns:
True if auto-renew is set, otherwise False.
- Return type:
bool
- is_secure()[source]¶
Returns whether the provider is accessing a secured store.
- Returns:
True if accessing a secure store, otherwise False.
- Return type:
bool
- set_auto_renew(auto_renew)[source]¶
Sets the auto-renew state. If True, automatic renewal of the login token is enabled.
- Parameters:
auto_renew (bool) – set to True to enable auto-renew.
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if auto_renew is not True or False.
- set_logger(logger)[source]¶
Sets a logger instance for this provider. If not set, the logger associated with the driver is used.
- Parameters:
logger (Logger) – the logger to use.
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if logger is not an instance of Logger.