arcgis.auth.tools package

Submodules

arcgis.auth.tools.nbauth module

class arcgis.auth.tools.nbauth.AESCipher(password, iv)

Bases: object

decrypt(enc_str: str) str

decrypts the token from the nbauth file

encrypt(value_str: str) str

encrypts the token from the nbauth file

arcgis.auth.tools.nbauth.cipher(password: str, iv: str) Cipher

Creates the cipher to decrypt the NB token.

Parameter

Description

password

Required String. The key of the cipher

iv

Required String. The initialization vector for the cipher.

Returns:

Cipher

arcgis.auth.tools.nbauth.get_token(nb_auth_file_path: str, hostname: str | None = None) str

Returns the token provided by the notebook server for authentication

Returns:

str

arcgis.auth.tools.nbauth.read_hosted_nb_auth() tuple

If ‘home’ is specified as the ‘url’ argument, this func is called

Module contents

class arcgis.auth.tools.EsriTrustStoreAdapter(assert_hostname=None, verify=True, additional_certs=None, *args, **kwargs)

Bases: HTTPAdapter

An HTTP Adapter for Esri’s ArcGIS API for Python that leverages TrustStore

cert_verify(conn, url, verify, cert)

Verifies the certificate

configure_ssl_context(context)

Configures the SSL context

init_poolmanager(*args, **kwargs)

Initializes the pool manager

proxy_manager_for(*args, **kwargs)

Creates a proxy manager

send(request, stream=False, timeout=None, verify=True, cert=None, proxies=None)

Sends the request

class arcgis.auth.tools.LazyLoader(module_name: str, submod_name=None, strict=False)

Bases: ModuleType

Lazy load modules

np = LazyLoader(“numpy”) pd = LazyLoader(“pandas”) arcpy = LazyLoader(“arcpy”, strict=True) cf = LazyLoader(module_name=”concurrent.futures”)

static check_module_exists(name: str) bool

Checks if a module exists

arcgis.auth.tools.assemble_url(parsed: object) str

creates the URL from a parsed URL

arcgis.auth.tools.parse_url(url: str) object

Parses a URL string into it’s pieces.

Returns:

Named Tuple

arcgis.auth.tools.pfx_to_pem(pfx_path, pfx_password, folder=None, use_openssl=False)

Decrypts the .pfx file to be used with requests.

Parameter

Description

pfx_path

Required string. File pathname to .pfx file to parse.

pfx_password

Required string. Password to open .pfx file to extract key/cert.

folder

Optional String. The save location of the certificate files. The default is the tempfile.gettempdir() directory.

user_openssl

Optional Boolean. If True, OpenPySSL is used to convert the pfx to pem instead of cryptography.

Returns:

Tuple File path to key_file located in a tempfile location File path to cert_file located in a tempfile location

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.