Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
✨✨ Twitter API Client by Typed Python ✨✨
pip install twitter_api_py
The simplest way to use the library is as follows:
from twitter_api import TwitterApiClient
response_body = (
TwitterApiClient.from_oauth2_app_env()
.request("https://api.twitter.com/2/tweets")
.get({
"ids": "1460323737035677698",
"expansions": ["referenced_tweets.id"]
})
)
As a characteristic feature of the library, it explicitly prompts the user to write the Endpoint URL, which makes it clear from the source code which Twitter API is being called.
A mock client is provided by the library to simplify the writing of test code.
This client has the same interface as TwitterApiClient
/TwitterApiAsyncClient
, and also provides methods (inject_*_response_body
) for injecting test data.
from twitter_api import TwitterApiClient, TwitterApiMockClient
def your_logic(twitter_client: TwitterApiClient):
...
def test_your_logic():
twitter_client = (
TwitterApiMockClient.from_oauth2_app_env()
.inject_post_response_body("https://api.twitter.com/2/tweets", post_response_body)
.inject_get_response_body("https://api.twitter.com/2/tweets/:id", get_response_body)
.inject_delete_response_body("https://api.twitter.com/2/tweets", delete_response_body)
)
assert your_logic(twitter_client) is True
FAQs
Twitter API Client by Typed Python.
We found that twitter-api-py demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.