:py:mod:`astronomer.providers.snowflake.hooks.sql_api_generate_jwt` =================================================================== .. py:module:: astronomer.providers.snowflake.hooks.sql_api_generate_jwt Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: astronomer.providers.snowflake.hooks.sql_api_generate_jwt.JWTGenerator Attributes ~~~~~~~~~~ .. autoapisummary:: astronomer.providers.snowflake.hooks.sql_api_generate_jwt.logger astronomer.providers.snowflake.hooks.sql_api_generate_jwt.ISSUER astronomer.providers.snowflake.hooks.sql_api_generate_jwt.EXPIRE_TIME astronomer.providers.snowflake.hooks.sql_api_generate_jwt.ISSUE_TIME astronomer.providers.snowflake.hooks.sql_api_generate_jwt.SUBJECT .. py:data:: logger .. py:data:: ISSUER :value: 'iss' .. py:data:: EXPIRE_TIME :value: 'exp' .. py:data:: ISSUE_TIME :value: 'iat' .. py:data:: SUBJECT :value: 'sub' .. py:class:: JWTGenerator(account, user, private_key, lifetime = LIFETIME, renewal_delay = RENEWAL_DELTA) Creates and signs a JWT with the specified private key file, username, and account identifier. The JWTGenerator keeps the generated token and only regenerates the token if a specified period of time has passed. Creates an object that generates JWTs for the specified user, account identifier, and private key :param account: Your Snowflake account identifier. See https://docs.snowflake.com/en/user-guide/admin-account-identifier.html. Note that if you are using the account locator, exclude any region information from the account locator. :param user: The Snowflake username. :param private_key: Private key from the file path for signing the JWTs. :param lifetime: The number of minutes (as a timedelta) during which the key will be valid. :param renewal_delay: The number of minutes (as a timedelta) from now after which the JWT generator should renew the JWT. .. py:attribute:: LIFETIME .. py:attribute:: RENEWAL_DELTA .. py:attribute:: ALGORITHM :value: 'RS256' .. py:method:: prepare_account_name_for_jwt(raw_account) Prepare the account identifier for use in the JWT. For the JWT, the account identifier must not include the subdomain or any region or cloud provider information. :param raw_account: The specified account identifier. .. py:method:: get_token() Generates a new JWT. If a JWT has been already been generated earlier, return the previously generated token unless the specified renewal time has passed. .. py:method:: calculate_public_key_fingerprint(private_key) Given a private key in PEM format, return the public key fingerprint. :param private_key: private key