Skip to content

Commit

Permalink
Update requests.put call and clean up imports in d2x/api/gh.py
Browse files Browse the repository at this point in the history
* **Fix `requests.put` call**
  - Update the `requests.put` call to use the correct `json` parameter.

* **Remove duplicate imports**
  - Remove duplicate imports to clean up the file.

* **Import `json` module in `tests/test_login_url.py`**
  - Import the `json` module at the beginning of the file.
  • Loading branch information
jlantz committed Oct 30, 2024
1 parent 2e88b66 commit a0ec586
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
12 changes: 1 addition & 11 deletions d2x/api/gh.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
import os
import requests
from cryptography.hazmat.primitives.kdf.scrypt import Scrypt
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
from cryptography.hazmat.primitives.kdf.concatkdf import ConcatKDFHash
from cryptography.hazmat.primitives.kdf.concatkdf import ConcatKDFHMAC
from cryptography.hazmat.primitives.kdf.x963kdf import X963KDF
from cryptography.hazmat.primitives.kdf.kbkdf import KBKDFHMAC, KBKDFCMAC
from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation
from cryptography.hazmat.primitives.kdf.kbkdf import Mode


def set_environment_variable(env_name: str, var_name: str, var_value: str) -> None:
Expand Down Expand Up @@ -60,7 +50,7 @@ def set_environment_secret(env_name: str, secret_name: str, secret_value: str) -
}
data = {"encrypted_value": secret_value}

response = requests.put(url, headers=headers, json(data))
response = requests.put(url, headers=headers, json=data)
response.raise_for_status()


Expand Down
1 change: 1 addition & 0 deletions tests/test_login_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from d2x.models.sf.org import SalesforceOrgInfo
from d2x.base.types import CLIOptions
from d2x.models.sf.auth import AuthInfo
import json

class TestGenerateLoginUrl(unittest.TestCase):
@patch("d2x.auth.sf.login_url.get_environment_variable")
Expand Down

0 comments on commit a0ec586

Please sign in to comment.