grove.configs package

Provides Grove configuration storage using supported backends.

class grove.configs.BaseConfig[source]

Bases: ABC

abstract get(id: str) List[ConnectorConfig][source]

Gets and returns one or more connector configuration objects.

Multiple connector configurations may be returned by backends which provide a recursive option where a less specific identifier is provided. This is used to enable lookup of all configuration documents under a “path” inside of the given backend - such as Consul, or AWS SSM.

Parameters:

id – The identifier to use when querying for connector configuration.

Returns:

A list of ConnectorConfig objects.

Submodules

grove.configs.aws_ssm module

Grove AWS SSM parameter store configuration handler.

class grove.configs.aws_ssm.Configuration(_env_file: str | PathLike | List[str | PathLike] | Tuple[str | PathLike, ...] | None = '<object object>', _env_file_encoding: str | None = None, _env_nested_delimiter: str | None = None, _secrets_dir: str | PathLike | None = None, *, prefix: str | None = '/grove/connectors/', assume_role_arn: str | None = None, ssm_region: str | None = 'us-east-1')[source]

Bases: BaseSettings

Defines environment variables used to configure the AWS SSM handler.

This should also include any appropriate default values for fields which are not required.

class Config[source]

Bases: object

Allow environment variable override of configuration fields.

This also enforce a prefix for all environment variables for this handler. As an example the field assume_role_arn would be set using the environment variable GROVE_CONFIG_AWS_SSM_ASSUME_ROLE_ARN.

case_insensitive = True
env_prefix = 'GROVE_CONFIG_AWS_SSM_'
assume_role_arn: str | None
prefix: str | None
ssm_region: str | None
class grove.configs.aws_ssm.Handler[source]

Bases: BaseConfig

A configuration handler to read configuration documents from AWS SSM.

get(id: str = '/') List[ConnectorConfig][source]

Gets and returns one or more connector configuration objects from AWS SSM.

Configuration documents are enumerated by their path, allowing multiple connectors to be defined in the SSM parameter store under a common path.

Parameters:

id – The path of the parameter(s) to return. This is combined with the configured prefix, if set.

Raises:

AccessException – An issue occurred when querying the value from SSM.

Returns:

A list of connector configuration objects.

grove.configs.local_file module

Grove local file configuration handler.

class grove.configs.local_file.Configuration(_env_file: str | PathLike | List[str | PathLike] | Tuple[str | PathLike, ...] | None = '<object object>', _env_file_encoding: str | None = None, _env_nested_delimiter: str | None = None, _secrets_dir: str | PathLike | None = None, *, path: str)[source]

Bases: BaseSettings

Defines environment variables used to configure the local file handler.

This should also include any appropriate default values for fields which are not required.

class Config[source]

Bases: object

Allow environment variable override of configuration fields.

This also enforce a prefix for all environment variables for this handler. As an example the field path would be set using the environment variable GROVE_CONFIG_LOCAL_FILE_PATH.

case_insensitive = True
env_prefix = 'GROVE_CONFIG_LOCAL_FILE_'
path: str
class grove.configs.local_file.Handler[source]

Bases: BaseConfig

A configuration handler to read configuration documents from local files.

get(id: str = '') List[ConnectorConfig][source]

Get and return one or more connector configuration objects from local files.

Parameters:

id – Not used.

Returns:

A list of connector configuration documents (JSON) as strings.