Data Feed Variable Overrides

Using variable overrides in data feeds for dynamic configuration and secure API integration

Variable overrides provide a powerful mechanism for dynamically configuring oracle jobs without hardcoding sensitive information like API keys or frequently changing parameters. This feature enables secure, flexible data feed configuration for both testing and production environments.

What are Variable Overrides?

Variable overrides allow you to inject values into oracle job definitions at runtime using the ${VARIABLE_NAME} syntax.

⚠️ Security Warning: Variables Are Not Verifiable

IMPORTANT: Variable overrides are not part of the cryptographic verification process. The oracle signatures only verify the job structure, not the variable values injected at runtime. This means:

  • Variables can be manipulated by whoever controls the execution environment

  • Feed consumers cannot verify what variable values were used

  • Use variables ONLY for authentication - API keys and authentication tokens

  • Never use variables for anything else - URLs, paths, parameters, calculations, or data selection logic

Safe Uses βœ…

  • API keys: ${API_KEY}

  • Authentication tokens: ${AUTH_TOKEN}

Dangerous Uses ❌

  • Base URLs: ${BASE_URL} (changes data source)

  • API versions: ${API_VERSION} (could return different data formats)

  • Price multipliers: ${MULTIPLIER} (affects calculations)

  • JSON paths: ${JSON_PATH} (changes what data is extracted)

  • Any parameter that affects data traversal, extraction, or calculation

Primary Use Case: Secure Credential Management

The main purpose of variable overrides is to keep sensitive credentials out of job definitions while maintaining feed verifiability:

  • Secure API Key Management: Keep sensitive credentials out of job definitions

  • Environment-Specific Authentication: Use different tokens for testing vs production

Basic Syntax

Variables in oracle jobs use the template syntax ${VARIABLE_NAME} and are replaced at execution time:

Common Use Cases

1. API Authentication

Secure API integration using environment variables:

The safest and recommended approach - only use variables for API keys:

3. Multiple API Authentication Headers

When you need multiple authentication parameters:

4. Simple Value Substitution

For testing or static value injection:

Variable Override Patterns

⚠️ CRITICAL: Only use variables for API keys and authentication tokens. Everything else should be hardcoded to ensure feed verifiability.

POST Request Bodies (Auth Only)

Testing and Development Workflow

1. Local Development Script

Create a testing script similar to the example:

2. Running Tests

3. Environment File Approach

Security Best Practices

1. Never Hardcode Secrets

❌ Don't do this:

βœ… Do this instead:

2. Validate Required Variables

3. Use Different Keys for Different Environments

Error Handling and Debugging

Common Issues

1. Missing Variables

Solution: Ensure all referenced variables are defined:

2. Incorrect Variable Names

Variables are case-sensitive and must match exactly:

3. JSON Path Issues

When using variables in JSON paths, ensure the resulting path is valid:

Debugging Tips

  1. Log Variable Overrides

  1. Test API Endpoints Manually

  1. Validate JSON Paths

Real-World Examples

Example 1: Polygon.io Stock Prices

Get stock prices from Polygon.io API with secure API key management:

Example 2: ESPN Sports Scores

Get NFL final scores from ESPN API:

Example 3: Twitter Follower Count

Get follower count for a specific Twitter account:

Key Principles in These Examples

  1. Hardcoded Data Sources: URLs specify exact endpoints and parameters

  2. Hardcoded Data Paths: JSON paths are fixed, ensuring consistent data extraction

  3. Authentication Only Variables: Only API keys and tokens use variable substitution

  4. Verifiable Logic: Feed consumers can verify exactly what data is being fetched and how

Environment Setup for Examples

Integration with Production Systems

Oracle Quotes Integration

When using variable overrides with Oracle Quotes:

Production Considerations

  1. Secret Management: Use secure secret management systems

  2. Variable Validation: Implement runtime validation

  3. Fallback Values: Provide sensible defaults where appropriate

  4. Monitoring: Log variable usage for debugging (without exposing secrets)

  5. Documentation: Clearly document required variables for each job

Last updated