Skip to content

JWTAuth

relationalai.config.connections.snowflake

Configure Snowflake access using key-pair (JWT) authentication.

Use this authenticator when you sign in to Snowflake with a private key instead of a password. When loading from a config dict or file, set authenticator="jwt".

Instantiating this class is optional; you can also pass an equivalent dict to create_config.

  • account

    (str) - Snowflake account identifier.
  • warehouse

    (str) - Snowflake warehouse name.
  • user

    (str) - Snowflake username.
  • private_key_path

    (str) - Path to a PEM-encoded private key file.
  • private_key_passphrase

    (str or SecretStr) - Passphrase for the private key file, if encrypted.

Create a programmatic config using this authenticator class:

>>> from relationalai.config import Config, JWTAuth
>>> cfg = Config(connections={
... "sf": JWTAuth(
... account="my_account",
... warehouse="my_warehouse",
... user="my_user",
... private_key_path="/path/to/key.pem",
... )
... })

Create a programmatic config using a plain dict (no authenticator import):

>>> from relationalai.config import Config
>>> cfg = Config(connections={
... "sf": {
... "type": "snowflake",
... "authenticator": "jwt",
... "account": "my_account",
... "warehouse": "my_warehouse",
... "user": "my_user",
... "private_key_path": "/path/to/key.pem",
... }
... })

The private key file is read from private_key_path when creating the Snowpark session.

JWTAuthSnowflakeConnectionBaseBaseConnectionpydantic.BaseModelabc.ABC
RelationalAI Documentation
└──  Build With RelationalAI
    └──  Understand how PyRel works > Configure PyRel
        └──  Configure snowflake auth
            └──  Configure key-pair authentication