arkouda.security

Attributes

Functions

generate_token(→ str)

Uses the secrets.token_hex() method to generate a

generate_username_token_json(→ str)

Generates a JSON object encapsulating the user's username

get_arkouda_client_directory(→ pathlib.Path)

A platform-independent means of finding path to

get_home_directory(→ str)

A platform-independent means of finding path to

get_username(→ str)

A platform-independent means of retrieving the current

Module Contents

arkouda.security.generate_token(length: int = 32) str[source]

Uses the secrets.token_hex() method to generate a a hexidecimal token

Parameters:

length (int) – The desired length of token

Returns:

The hexidecimal string generated by Python

Return type:

str

Notes

This method uses the Python secrets.token_hex method

arkouda.security.generate_username_token_json(token: str) str[source]

Generates a JSON object encapsulating the user’s username and token for connecting to an arkouda server with basic authentication enabled

Parameters:

token (string) – The token to be used to access arkouda server

Returns:

The JSON-formatted string encapsulating username and token

Return type:

str

arkouda.security.get_arkouda_client_directory() pathlib.Path[source]

A platform-independent means of finding path to the current user’s .arkouda directory where artifacts such as server access tokens are stored.

Returns:

Path corresponding to the user’s .arkouda directory path

Return type:

Path

Notes

The default implementation is to place the .arkouda directory in the current user’s home directory. The default can be overridden by setting the ARKOUDA_CLIENT_DIRECTORY environment variable. It is important this is not the same location as the server’s token directory as the file format is different.

arkouda.security.get_home_directory() str[source]

A platform-independent means of finding path to the current user’s home directory

Returns:

The user’s home directory path

Return type:

str

Notes

This method uses the Python os.path.expanduser method to retrieve the user’s home directory

arkouda.security.get_username() str[source]

A platform-independent means of retrieving the current user’s username for the host system.

Returns:

The username in the form of string

Return type:

str

Raises:

EnvironmentError – Raised if the host OS is unsupported

Notes

The currently supported operating systems are Windows, Linux, and MacOS AKA Darwin

arkouda.security.username_tokenizer