Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new connector: Source-Salesforce #1367

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- "source-gladly/**"
- "source-google-sheets-native/**"
- "source-hubspot-native/**"
- "source-salesforce/**"
pull_request:
branches: [main]
paths:
Expand All @@ -17,6 +18,7 @@ on:
- "source-gladly/**"
- "source-google-sheets-native/**"
- "source-hubspot-native/**"
- "source-salesforce/**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -48,6 +50,10 @@ jobs:
type: capture
version: v1
usage_rate: "0.0"
- name: source-salesforce
type: capture
version: v2
usage_rate: "1.0"

steps:
- uses: actions/checkout@v4
Expand Down
Empty file added source-salesforce/__init__.py
Empty file.
26 changes: 26 additions & 0 deletions source-salesforce/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import urllib
from flow_sdk import shim_airbyte_cdk
from .source_salesforce import SourceSalesforce




shim_airbyte_cdk.CaptureShim(
delegate=SourceSalesforce(),
oauth2={
"provider": "salesforce",
"authUrlTemplate": (
r"https://{{#config.is_sandbox}}test{{/config.is_sandbox}}{{^config.is_sandbox}}login{{/config.is_sandbox}}.salesforce.com/services/oauth2/authorize?client_id={{#urlencode}}{{{ client_id }}}{{/urlencode}}&redirect_uri={{#urlencode}}{{{ redirect_uri }}}{{/urlencode}}&response_type=code&state={{#urlencode}}{{{ state }}}{{/urlencode}}"
),
"accessTokenUrlTemplate": r"https://{{#config.is_sandbox}}test{{/config.is_sandbox}}{{^config.is_sandbox}}login{{/config.is_sandbox}}.salesforce.com/services/oauth2/token",
"accessTokenBody": (
"grant_type=authorization_code"
r"&client_id={{#urlencode}}{{{ client_id }}}{{/urlencode}}"
r"&client_secret={{#urlencode}}{{{ client_secret }}}{{/urlencode}}"
r"&redirect_uri={{#urlencode}}{{{ redirect_uri }}}{{/urlencode}}&code={{#urlencode}}{{{ code }}}{{/urlencode}}"
),
"accessTokenHeaders": {"content-type": "application/x-www-form-urlencoded"},
"accessTokenResponseMap": {"refresh_token": "/refresh_token"}
},
usesSchemaInference=False,
).main()
21 changes: 21 additions & 0 deletions source-salesforce/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
credentials:
auth_type: Client
client_id_sops: ENC[AES256_GCM,data:w+QlOJj6HMkY8LXI+rhkU+WGzrC/pz70nnZMpqrYbLcLBBnd4MAvPOJrY9GCa1CazfzavL6ATXZtMO2et7IT8PH5i4OkhHmXrcRpYvoQFYqVPOsXMw==,iv:lto0AF8YNlhb9FIntaqVRcyxaEZSxhefzCcDx/2yQFw=,tag:BAIe1Yezo1mnaxz/uPfbaQ==,type:str]
client_secret_sops: ENC[AES256_GCM,data:MTa+Cv+YH7v8gy/LTsviFW9oocCDWp86g7aB5OVnO6OJLPChbNAuC7qtAzNKiZu2DVKof9tmrjqQcWxhdVEMJA==,iv:oZg6cFFx9Oq3AZCGsGRtusXEZKyMVMKbG6SCANxjwWg=,tag:iyHdLX2mUFKQfo3oJRCneg==,type:str]
refresh_token_sops: ENC[AES256_GCM,data:/TaTSN6bLz+eZxZhWPYj3ESFZrjQa7XWbzosSNc64Y3Y320n2il9OW2PUzt03rA4FcciEeFAN5IZAm3G+0VnO6ORFo4Bb2OuO7ZkEq9W1NlCen6ulRmb,iv:iWxXdwyum8STeLupLNiFDMcqOsCe/0LUMp6sUkydXHU=,tag:w4n604HbGtpo2JjbUPbIUg==,type:str]
is_sandbox: false
start_date: "2020-01-01"
sops:
kms: []
gcp_kms:
- resource_id: projects/estuary-theatre/locations/us-central1/keyRings/connector-keyring/cryptoKeys/connector-repository
created_at: "2024-03-08T05:31:16Z"
enc: CiQAdmEdwvWWci8hmYfDEI3t5/hMDMNae/7Pq6THGr3n3y+b8CwSSQCVvC1zN8IPDTYZdbVo11k7xVAeJSNRRAIOPpU+ARe73YpQtoMP92xJs0VasYa6gxjB53wWKIHiGxYJr5rYtJfvE6evYRQFkDY=
azure_kv: []
hc_vault: []
age: []
lastmodified: "2024-03-11T10:03:34Z"
mac: ENC[AES256_GCM,data:hbOhtVqgpp3Qjb2J5v0O16tZR7OOaRXhrx989jOWaPg/GRnmT2Wy7DIcT0OKtIR/Xz39xW7AUqYbig6uleMKMpqPKawvd6sPhox+0FfOZzcJDiNsn6P//mJ0/armwS9KnZk+tybhTjJMzHtaI4llp9IBdWJvLncvtZ2PLhA3oqE=,iv:nexmF7WR7PlN9aPVsx+VybCpfE6OY/yWaIPY/0wmbnU=,tag:3Oc35qCorGulnYggINzdPQ==,type:str]
pgp: []
encrypted_suffix: _sops
version: 3.8.1
1,603 changes: 1,603 additions & 0 deletions source-salesforce/poetry.lock

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions source-salesforce/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[tool.poetry]
name = "source-salesforce"
version = "0.1.0"
description = ""
authors = ["Luishfs <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.11,<3.12"
estuary-cdk = {path="../estuary-cdk", develop = true}
airbyte-cdk = "0.51.14"
backoff = "^1.11"
pendulum = "^3.0.0"
pandas = "^2.2.1"
vcrpy = "4.1.1"

[tool.poetry.group.dev.dependencies]
pytest = "^7.4.3"
pytest-insta = "^0.2.0"
mock = "^5.1.0"
pytest-mock = "^3.12.0"
requests-mock = "^1.11.0"
debugpy = "^1.8.0"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Loading