Constants & System Settings
Relevant source files
The following files were used as context for generating this wiki page:
The flext-target-oracle-oic project utilizes a centralized approach to managing system configuration and constants. This architecture ensures consistency across the Singer target implementation for Oracle Integration Cloud (OIC). The system relies on Pydantic-based settings for runtime configuration and a hierarchical constant management system that inherits from flext-core and flext-meltano foundations.
Key components include the FlextTargetOracleOicSettings class for environment-driven configuration and the FlextTargetOracleOicConstants class for static domain values. These structures govern authentication flows, API interaction parameters, and supported data streams such as connections, integrations, packages, and lookups.
Sources: src/flext_target_oracle_oic/settings.py, src/flext_target_oracle_oic/constants.py, src/flext_target_oracle_oic/utilities.py
Configuration Management
The project uses FlextTargetOracleOicSettings to define the runtime configuration schema. This class inherits from FlextSettingsBase and uses an environment variable prefix FLEXT_TARGET_ORACLE_OIC_. Configuration is validated at runtime to ensure mandatory fields for OIC communication are present.
Runtime Settings Schema
The settings class manages sensitive credentials using SecretStr and provides helper methods to extract plaintext values for outgoing HTTP requests.
| Setting | Type | Default | Description |
|---|---|---|---|
oauth_client_id | str | Required | OAuth client identifier for OIC. |
oauth_client_secret | SecretStr | Required | OAuth client secret for OIC. |
oauth_token_url | str | Required | The Identity Cloud Service (IDCS) token endpoint. |
oauth_scope | str | oic_instance | OAuth scope for token requests. |
oauth_client_aud | str | None | Optional audience for the OAuth provider. |
timeout | int | 30 | HTTP request timeout in seconds. |
Sources: src/flext_target_oracle_oic/settings.py:20-53, src/flext_target_oracle_oic/constants.py:32
Configuration Data Flow
The following diagram illustrates how configuration is ingested from the environment and used to generate authentication headers for OIC API calls.
The FlextTargetOracleOicUtilities provides a validation method to ensure the configuration meets the minimum requirements before proceeding with OIC operations.
Sources: src/flext_target_oracle_oic/settings.py:22-25, src/flext_target_oracle_oic/utilities.py:27-34
System Constants
Constants are organized within the FlextTargetOracleOicConstants namespace. This includes stream identifiers, API paths, and default values for integration metadata.
API and Authentication Constants
These constants define the structure of requests sent to Oracle Integration Cloud and its identity provider.
| Constant | Value | Description |
|---|---|---|
AUTH_SCHEME_BEARER | "Bearer" | The authorization scheme for OIC requests. |
HEADER_CONTENT_TYPE | "Content-Type" | Standard HTTP header key. |
HEADER_CONTENT_TYPE_FORM | "application/x-www-form-urlencoded" | Used for OAuth token requests. |
HEADER_CONTENT_TYPE_JSON | "application/json" | Used for OIC REST API payloads. |
API_PATH_OAUTH_TOKEN | "/oauth2/v1/token" | Standard path for OAuth2 token generation. |
API_PATH_INTEGRATION | "/ic/api/integration/v1" | Base path for OIC Integration APIs. |
Sources: src/flext_target_oracle_oic/constants.py:16-27
Supported Data Streams
The target supports four primary entities within Oracle Integration Cloud, defined as stream constants:
STREAM_CONNECTIONS:"connections"STREAM_INTEGRATIONS:"integrations"STREAM_PACKAGES:"packages"STREAM_LOOKUPS:"lookups"
Sources: src/flext_target_oracle_oic/constants.py:11-14
Project Metadata and Versioning
System-level metadata is managed via FlextTargetOracleOicVersion, which derives from the flext-core versioning system. This ensures that package version, description, and author information are consistent with the project's pyproject.toml specification.
Metadata Summary
Derived from the build system and versioning module:
- Project Name:
flext-target-oracle-oic - Current Version:
0.12.0-dev - Python Compatibility:
>=3.13,<3.14 - License:
MIT
Sources: pyproject.toml:40-52, src/flext_target_oracle_oic/__version__.py:27-34
Implementation Details: Configuration Validation
The system enforces a strict validation routine for the settings before the target initializes.
# src/flext_target_oracle_oic/utilities.py:27-34
@staticmethod
def validate_config(settings: t.ConfigurationMapping) -> p.Result[bool]:
"""Validate required OIC target configuration keys."""
required = {"base_url", "oauth_client_id", "oauth_client_secret"}
missing = sorted(key for key in required if key not in settings)
if missing:
return r[bool].fail(f"Missing required settings fields: {missing}")
return r[bool].ok(value=True)
This ensures that the base_url, oauth_client_id, and oauth_client_secret are always present in the provided configuration mapping.