Discovery
provide.foundation.config.discovery
¶
Configuration schema discovery system.
This module provides functionality to discover and introspect all configuration classes registered with the Foundation Hub. It enables programmatic access to configuration schemas, environment variable mappings, and metadata.
Classes¶
ConsolidatedSchema
¶
Consolidated schema containing all configuration schemas.
Attributes:
| Name | Type | Description |
|---|---|---|
schemas |
dict[str, ConfigSchema]
|
Mapping of config class names to their schemas |
metadata |
dict[str, dict[str, Any]]
|
Additional metadata about each config class |
Functions¶
get_all_env_vars
¶
Extract all environment variables from all schemas.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
show_sensitive
|
bool
|
Whether to include sensitive fields |
False
|
Returns:
| Type | Description |
|---|---|
list[EnvVarInfo]
|
List of environment variable information |
Source code in provide/foundation/config/discovery.py
get_by_category
¶
Filter schemas by category.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
category
|
str
|
Category to filter by (e.g., "logger", "transport") |
required |
Returns:
| Type | Description |
|---|---|
dict[str, ConfigSchema]
|
Filtered schemas matching the category |
Source code in provide/foundation/config/discovery.py
EnvVarInfo
¶
Information about an environment variable and its configuration field.
Attributes:
| Name | Type | Description |
|---|---|---|
config_class |
str
|
Name of the configuration class |
field_name |
str
|
Name of the field in the config class |
env_var |
str
|
Environment variable name |
field_type |
str
|
Type of the field |
default |
Any
|
Default value |
required |
bool
|
Whether the field is required |
description |
str | None
|
Field description |
sensitive |
bool
|
Whether the field contains sensitive data |
category |
str
|
Configuration category (e.g., "logger", "transport") |
Functions¶
discover_all_config_schemas
¶
Get all registered configuration schemas from the Hub.
This function retrieves all configuration classes that have been registered with the Foundation Hub under the CONFIG_SCHEMA dimension.
Returns:
| Type | Description |
|---|---|
dict[str, type[BaseConfig]]
|
Mapping of config class names to their types |
Source code in provide/foundation/config/discovery.py
get_config_metadata
¶
Get metadata for all registered config schemas.
Returns:
| Type | Description |
|---|---|
dict[str, dict[str, Any]]
|
Mapping of config class names to their metadata |
Source code in provide/foundation/config/discovery.py
get_consolidated_schema
¶
Get consolidated schema with all configuration options.
This function discovers all registered configuration classes, generates schemas for each, and consolidates them into a single schema object with full metadata.
Returns:
| Type | Description |
|---|---|
ConsolidatedSchema
|
Consolidated schema with all config options |