Translators and Models
    • 24 Nov 2024
    • 2 Minutes to read
    • Dark
      Light
    • PDF

    Translators and Models

    • Dark
      Light
    • PDF

    Article summary

    General

    Translator properties are configurable key-value pairs that direct the PIP service’s behavior during Runtime. These properties enhance translator functionality by enabling additional configurations that can modify translator logic or support dynamic value injection, allowing for customized logic or data.

    Examples include the REST Translator Support Dynamic Filter Capability, which enables the translator to dynamically replace values before sending a REST request to a data source, and setting Headers for a REST request, which can incorporate various values, including static tokens.

    Details on native translator properties are available for JDBC and LDAP translators. Additional details on PlainID translator properties can be found on specific translator pages:

    Environment Variables for Translator Properties

    Environment variables can be used to set property values, providing flexibility and security by enabling environment-specific configurations.

    To reference environment variables within translator properties, use the syntax ${ENVIRONMENT_VARIABLE_NAME}. An ENV VAR can replace an entire property value or be embedded within a property value, such as within an array of REST headers, allowing for dynamic injection during translator operations.

    To enable environment variables, set the TRANSLATOR_PROPERTIES_ENRICHMENT_ENABLED environment key to True (default is False) in the PIP Operator configuration.

    For secure handling of injected values, the environment variable names used with ${ENVIRONMENT_VARIABLE_NAME} must start with a specified prefix. This prefix is set by the TRANSLATOR_PROPERTIES_ENRICHMENT_PREFIX environment key, with a default prefix of TRANSLATOR_.

    Environment Variable Example

    If you need to configure a translator property for REST headers that contains a sensitive value, such as a secret or token, using an environment variable allows you to manage different secrets or tokens across Environments securely.

    Define the translator property as follows:

    • Property key: headers
    • Property value: {"X-Auth-Token":["<token>"]}

    Refer to the REST Service Source article for further details on translator properties.

    To avoid hardcoding the token in the property value and instead use environment variables:

    1. Set the environment variable TRANSLATOR_PROPERTIES_ENRICHMENT_ENABLED to true in the PIP configuration.
    2. Set the environment variable TRANSLATOR_PROPERTIES_ENRICHMENT_PREFIX to PIPVARSPREFIX_ in the PIP configuration.
    3. Define an environment variable PIPVARSPREFIX_XAUTH_TOKEN with the token value in the PIP configuration.
    4. Update the translator property value to reference the environment variable: {"X-Auth-Token":["${PIPVARSPREFIX_XAUTH_TOKEN}"]}.

    PIP Logging

    If an environment variable is misconfigured for a translator property, the PIP log may display one of the following WARN messages:

    1. Missing Prefix: When a translator property value uses ${ENV_VAR} but the environment variable doesn’t follow the required prefix naming convention, the log displays: "Translator variable {} doesn't have the required prefix."

    2. Missing Environment Variable: If a referenced environment variable is not defined, the log displays: "Translator variable {} not found in the application environment."

    To learn more about Translator Properties and their corresponding Data Model Properties, check out our article on


    Was this article helpful?