Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
pip install dynamics-client
Documentation: https://mrthearman.github.io/dynamics-client/
Source Code: https://github.com/MrThearMan/dynamics-client/
Contributing: https://github.com/MrThearMan/dynamics-client/blob/main/CONTRIBUTING.md
Client for making Web API request from a Microsoft Dynamics 365 Database.
You should also read the Dynamics Web API Reference Docs:
from dynamics import DynamicsClient, ftr
# Init the client:
client = DynamicsClient(...)
### Example GET request:
client.table = "accounts"
# Get only these columns for the account.
client.select = ["accountid", "name"]
# Filter to only the accounts that have been created on or after the
# given ISO date string, AND that have 200 or more employees.
client.filter = [
ftr.on_or_after("createdon", "2020-01-01T00:00:00Z"),
ftr.ge("numberofemployees", 200),
]
# Expand to the contacts (collection-values navigation property)
# on the account that have 'gmail.com' in their email address 1 OR 2.
# Get only the 'firstname', 'lastname' and 'mobilephone' columns for these contacts.
# Also expand the primary contact (single-valued navigation property).
# Get only the 'emailaddress1' column for the primary contact.
client.expand = {
"contact_customer_accounts": {
"select": ["firstname", "lastname", "mobilephone"],
"filter": {
ftr.contains("emailaddress1", "gmail.com"),
ftr.contains("emailaddress2", "gmail.com"),
}
},
"primarycontactid": {
"select": ["emailaddress1"],
},
}
result = client.get()
print(result.data)
# [
# {
# "accountid": ...,
# "name": ...,
# "contact_customer_accounts": [
# {
# "contactid": ..., # id field is always given
# "firstname": ...,
# "lastname": ...,
# "mobilephone": ...
# },
# ...
# ],
# "primarycontactid": {
# "contactid": ...,
# "emailaddress1": ...
# }
# },
# ...
# ]
### Example POST request
# IMPORTANT!!!
client.reset_query()
client.table = "contacts"
# Get only these columns from the created contact
client.select = ["firstname", "lastname", "emailaddress1"]
# The data to create the contact with. '@odata.bind' is used to link
# the contact to the given navigation property.
accountid = ...
data = {
"firstname": ...,
"lastname": ...,
"emailaddress1": ...,
"parentcustomerid_account@odata.bind": f"/accounts({accountid})"
}
result = client.post(data=data)
print(result.data)
# {
# "contactid": ...,
# "firstname": ...,
# "lastname": ...,
# "emailaddress1": ...
# }
### Example PATCH request
client.reset_query()
client.table = "contacts"
client.row_id = result["contactid"]
data = {
"firstname": ...,
"lastname": ...,
}
result = client.patch(data=data)
print(result.data)
# Return all rows on the updated contact,
# since no select statement was given
#
# {
# ...
# "contactid": ...,
# "firstname": ...,
# "lastname": ...,
# ...
# }
### Example DELETE request
client.reset_query()
client.table = "contacts"
client.row_id = result["contactid"]
client.delete()
FAQs
Client for making Web API request from a Microsoft Dynamics 365 Database.
We found that dynamics-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.