mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-07-08 09:33:43 +00:00

Solution to issue https://github.com/Unstructured-IO/unstructured/issues/2321. simple_salesforce API allows for passing private key path or value. This PR introduces this support for Ingest connector. Salesforce parameter "private-key-file" has been renamed to "private-key". It can contain one of following: - path to PEM encoded key file (as string) - key contents (PEM encoded string) If the provided value cannot be parsed as PEM encoded private key, then the file existence is checked. This way private key contents are not exposed to unnecessary underlying function calls.
29 lines
1022 B
Bash
Executable File
29 lines
1022 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Processes multiple files in a nested folder structure from Salesforce
|
|
# through Unstructured's library in 2 processes.
|
|
|
|
# Available categories are: Account, Case, Campaign, EmailMessage, Lead
|
|
|
|
# Structured outputs are stored in salesforce-output/
|
|
|
|
# Using JWT authorization
|
|
# https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_key_and_cert.htm
|
|
# https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_connected_app.htm
|
|
|
|
# private-key is the path to the key file or key contents
|
|
|
|
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
|
cd "$SCRIPT_DIR"/../../.. || exit 1
|
|
|
|
PYTHONPATH=. ./unstructured/ingest/main.py \
|
|
salesforce \
|
|
--username "$SALESFORCE_USERNAME" \
|
|
--consumer-key "$SALESFORCE_CONSUMER_KEY" \
|
|
--private-key "$SALESFORCE_PRIVATE_KEY_PATH" \
|
|
--categories "EmailMessage,Account,Lead,Case,Campaign" \
|
|
--output-dir salesforce-output \
|
|
--preserve-downloads \
|
|
--reprocess \
|
|
--verbose
|