Project Introduction
Relevant source files
The following files were used as context for generating this wiki page:
flext-target-oracle-oic is a specialized Singer Target designed to facilitate data loading into Oracle Integration Cloud (OIC). It is part of the FLEXT ecosystem, utilizing a typed, modular architecture to handle OIC-specific resources such as connections, integrations, packages, and lookups. The project class is defined as an integration and is built on Python 3.13+.
Sources: README.md:5-10, pyproject.toml:25-30
System Architecture
The project follows the Singer SDK pattern, extending FlextMeltanoTargetAbstractions to provide a robust framework for processing incoming data streams. It maps specific Singer streams to dedicated Sink classes that handle the logic for various OIC artifacts.
Core Components
The architecture is divided into the Target entry point, Stream-specific Sinks, and Domain Models.
- FlextTargetOracleOic: The main entry point that manages the lifecycle of the target and routes streams to their respective sinks.
- Sinks: Specialized classes (
FlextTargetOracleOicConnectionsSink,FlextTargetOracleOicIntegrationsSink, etc.) that implement the logic for processing records into OIC. - Models: Pydantic-based domain models that ensure data integrity for OIC resources.
Sources: src/flext_target_oracle_oic/target.py:53-76, src/flext_target_oracle_oic/models.py:14-16
Component Relationship
The following diagram illustrates how the Target class coordinates different Sinks based on the stream name.
The diagram shows the relationship between the main target class, its specialized sinks, and the Pydantic models used for data validation.
Sources: src/flext_target_oracle_oic/target.py:53-65, src/flext_target_oracle_oic/models.py:17-65
Authentication and Security
The system implements an OAuth2 Client Credentials flow to interact with the Oracle Integration Cloud API. The Authenticator class within utilities.py manages token acquisition and header injection.
OAuth2 Flow
The authenticator requests a Bearer token from the oauth_token_url using the provided client credentials and scope.
This sequence diagram depicts the process of obtaining an OAuth2 token and utilizing it for subsequent API calls.
Sources: src/flext_target_oracle_oic/utilities.py:61-122
Data Models
The project defines several Pydantic models to represent OIC entities. These models provide runtime validation and structure for the incoming Singer records.
| Model | Field | Type | Description |
|---|---|---|---|
| OICConnection | id | NonEmptyStr | Unique connection identifier |
name | NonEmptyStr | Connection name | |
adapter_type | NonEmptyStr | Type of adapter (e.g., REST) | |
| OICIntegration | id | NonEmptyStr | Unique integration identifier |
version | str | Integration version (Default: 1.0) | |
| OICLookup | name | NonEmptyStr | Lookup name |
columns | tuple | Column definitions |
Sources: src/flext_target_oracle_oic/models.py:17-65
Configuration
The target is configured via a JSON file or environment variables. Key configuration parameters include OIC endpoint details and OAuth2 credentials.
| Parameter | Type | Default | Description |
|---|---|---|---|
base_url | string | N/A | The OIC instance URL |
oauth_client_id | string | N/A | OAuth2 Client ID |
oauth_token_url | string | N/A | URL to fetch the OAuth2 token |
import_mode | string | create_or_update | Strategy for handling existing records |
batch_size | integer | 10 | Records per batch |
Sources: config.json:1-17, src/flext_target_oracle_oic/utilities.py:34-40
Configuration Validation Logic
The project includes built-in validation to ensure required fields are present before execution starts.
# From src/flext_target_oracle_oic/utilities.py
@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)
Sources: src/flext_target_oracle_oic/utilities.py:34-41
Project Summary
flext-target-oracle-oic provides a structured, type-safe approach to loading data into Oracle Integration Cloud via the Singer protocol. By leveraging specialized sinks and Pydantic models, it ensures that data representing connections, integrations, and lookups conforms to OIC's requirements. The system's reliance on the flext-core and flext-meltano libraries allows it to inherit advanced features like lazy loading and standard observability while maintaining a focus on Oracle-specific integration logic.
Sources: README.md:1-20, src/flext_target_oracle_oic/target.py:1-20