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

Implement fetching consumer_secret from Salesforce connection #45954

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
715b9ef
Update salesforce.py
kanagaraj-dhanapal-89 Jan 23, 2025
0ce0be1
Salesforce: Implement fetching consumer_secret from Airflow Connections
kanagaraj-dhanapal-89 Jan 23, 2025
cf36ea6
Merge remote-tracking branch 'origin/kanagaraj-dhanapal-89-patch-1' i…
Jan 23, 2025
dc38c47
Salesforce: Implement fetching consumer_secret from Airflow Connectio…
Jan 23, 2025
86f2352
Salesforce: Implement fetching consumer_secret from Airflow Connectio…
Jan 23, 2025
11459c3
Salesforce: Implement fetching consumer_secret from Airflow Connectio…
Jan 23, 2025
f2bfbb5
Merge branch 'main' into kanagaraj-dhanapal-89-patch-1
kanagaraj-dhanapal-89 Jan 23, 2025
e520c54
Salesforce: Implement fetching consumer_secret from Airflow Connectio…
Jan 24, 2025
6d0c94f
Merge branch 'main' into kanagaraj-dhanapal-89-patch-1
kanagaraj-dhanapal-89 Jan 24, 2025
65ffac7
Salesforce: Implement fetching consumer_secret from Airflow Connectio…
Jan 24, 2025
d2af818
Merge remote-tracking branch 'origin/kanagaraj-dhanapal-89-patch-1' i…
Jan 24, 2025
15e616e
Merge branch 'main' into kanagaraj-dhanapal-89-patch-1
kanagaraj-dhanapal-89 Jan 24, 2025
3e2b9b1
Merge branch 'main' into kanagaraj-dhanapal-89-patch-1
kanagaraj-dhanapal-89 Jan 24, 2025
a6c6b01
Merge branch 'main' into kanagaraj-dhanapal-89-patch-1
kanagaraj-dhanapal-89 Jan 24, 2025
4ca487f
Merge branch 'main' into kanagaraj-dhanapal-89-patch-1
kanagaraj-dhanapal-89 Jan 25, 2025
19c36f7
Merge branch 'main' into kanagaraj-dhanapal-89-patch-1
kanagaraj-dhanapal-89 Jan 26, 2025
70536ce
Salesforce: Implement fetching consumer_secret from Airflow Connectio…
Jan 26, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ Consumer Key (optional)

Use for OAuth 2.0 JWT authentication.

Consumer Secret (optional)
the consumer secret generated for the user.

Use for OAuth 2.0 JWT authentication.

Private Key (optional)
The private key to use for signing the JWT. Provide this or a Private Key File Path (both are not necessary).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ def get_connection_form_widgets(cls) -> dict[str, Any]:
"security_token": PasswordField(lazy_gettext("Security Token"), widget=BS3PasswordFieldWidget()),
"domain": StringField(lazy_gettext("Domain"), widget=BS3TextFieldWidget()),
"consumer_key": StringField(lazy_gettext("Consumer Key"), widget=BS3TextFieldWidget()),
"consumer_secret": PasswordField(
lazy_gettext("Consumer Secret"), widget=BS3PasswordFieldWidget()
),
"private_key_file_path": PasswordField(
lazy_gettext("Private Key File Path"), widget=BS3PasswordFieldWidget()
),
Expand Down Expand Up @@ -151,6 +154,7 @@ def conn(self) -> api.Salesforce:
session=self.session,
client_id=self._get_field(extras, "client_id") or None,
consumer_key=self._get_field(extras, "consumer_key") or None,
consumer_secret=self._get_field(extras, "consumer_secret") or None,
privatekey_file=self._get_field(extras, "private_key_file_path") or None,
privatekey=self._get_field(extras, "private_key") or None,
)
Expand Down
9 changes: 9 additions & 0 deletions providers/tests/salesforce/hooks/test_salesforce.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def test_get_conn_password_auth(self, mock_salesforce):
session=None,
client_id=extras["client_id"],
consumer_key=None,
consumer_secret=None,
privatekey_file=None,
privatekey=None,
)
Expand Down Expand Up @@ -146,6 +147,7 @@ def test_get_conn_direct_session_access(self, mock_salesforce):
session=self.salesforce_hook.session,
client_id=extras["client_id"],
consumer_key=None,
consumer_secret=None,
privatekey_file=None,
privatekey=None,
)
Expand All @@ -169,6 +171,7 @@ def test_get_conn_jwt_auth(self, mock_salesforce):
{
"client_id": "my_client3",
"consumer_key": "consumer_key",
"consumer_secret": "consumer_secret",
"domain": "login",
"private_key": "private_key",
"version": "34.0"
Expand All @@ -195,6 +198,7 @@ def test_get_conn_jwt_auth(self, mock_salesforce):
session=None,
client_id=extras["client_id"],
consumer_key=extras["consumer_key"],
consumer_secret=extras["consumer_secret"],
privatekey_file=None,
privatekey=extras["private_key"],
)
Expand Down Expand Up @@ -240,6 +244,7 @@ def test_get_conn_ip_filtering_auth(self, mock_salesforce):
session=None,
client_id=None,
consumer_key=None,
consumer_secret=None,
privatekey_file=None,
privatekey=None,
)
Expand All @@ -261,6 +266,7 @@ def test_get_conn_default_to_none(self, mock_salesforce):
{
"client_id": "",
"consumer_key": "",
"consumer_secret": "",
"domain": "",
"instance": "",
"instance_url": "",
Expand Down Expand Up @@ -291,6 +297,7 @@ def test_get_conn_default_to_none(self, mock_salesforce):
session=None,
client_id=None,
consumer_key=None,
consumer_secret=None,
privatekey_file=None,
privatekey=None,
)
Expand Down Expand Up @@ -480,6 +487,7 @@ def test_backcompat_prefix_works(self, mock_client, uri):
mock_client.assert_called_with(
client_id=None,
consumer_key=None,
consumer_secret=None,
domain="domain",
instance=None,
instance_url=None,
Expand Down Expand Up @@ -509,6 +517,7 @@ def test_backcompat_prefix_both_prefers_short(self, mock_client):
mock_client.assert_called_with(
client_id=None,
consumer_key=None,
consumer_secret=None,
domain=None,
instance=None,
instance_url=None,
Expand Down