Skip to content

TigerGraphConnectionConfig

TigerGraphConnectionConfig

Bases: BaseConfig

Configuration for connecting to a TigerGraph instance.

This class supports:

  1. User/password authentication
  2. Secret-based authentication
  3. Token-based authentication

model_config = SettingsConfigDict(populate_by_name=True) class-attribute instance-attribute

host = Field(default=HttpUrl('http://127.0.0.1'), validation_alias='TG_HOST', description='The host URL for the TigerGraph connection.') class-attribute instance-attribute

restpp_port = Field(default='14240', validation_alias='TG_RESTPP_PORT', description='The port for REST++ API.') class-attribute instance-attribute

gsql_port = Field(default='14240', validation_alias='TG_GSQL_PORT', description='The port for GSQL.') class-attribute instance-attribute

username = Field(default=None, validation_alias='TG_USERNAME', description='The username for TigerGraph authentication. Use only for user/password authentication.') class-attribute instance-attribute

password = Field(default=None, validation_alias='TG_PASSWORD', description='The password for TigerGraph authentication. Use only for user/password authentication.') class-attribute instance-attribute

secret = Field(default=None, validation_alias='TG_SECRET', description='The secret for TigerGraph authentication. Use only for secret-based authentication.') class-attribute instance-attribute

token = Field(default=None, validation_alias='TG_TOKEN', description='The API token for TigerGraph authentication. Use only for token-based authentication.') class-attribute instance-attribute

check_exclusive_authentication(values)

Ensure that exactly one authentication method is provided:

  • username/password together, or
  • secret, or
  • token. If all fields are empty, username/password will default.

Parameters:

  • values (Dict[str, Any]) –

    The input values for validation.

Returns:

  • Dict[str, Any]

    The validated values.

Raises:

  • ValueError

    If more than one authentication method is provided.

create(**kwargs) classmethod

Allows initialization using both field names and aliases.