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.
The ofb-python-sdk
provides a Python interface for interacting with Microsoft's OneDrive. It simplifies the process of authenticating, uploading, downloading, and managing files on OneDrive through a simple and intuitive API. This SDK is particularly useful for developers who need to integrate OneDrive functionalities within their Python applications efficiently.
Install ofb-python-sdk
using pip:
pip install sy-ofb-python-sdk
To start using the SDK, you'll first need to import the Client
class from the package.
from ofb_python_sdk import Client
Initialize the client with your application credentials:
client = Client(
client_id="your_client_id",
client_secret="your_client_secret",
refresh_token="your_refresh_token",
redirect_uri="your_redirect_uri",
)
file_path = "/path/to/your/file"
file_data = open(file_path, "rb").read()
remote_path = "/path/to/onedrive/destination/file.txt"
try:
response = client.upload_file(file_data, remote_path)
print("Upload successful:", response.status_code)
except Exception as e:
print("Upload failed:", e)
remote_path = "/path/to/onedrive/file.txt"
try:
file_data = client.download_file(remote_path)
with open("downloaded_file.txt", "wb") as file:
file.write(file_data)
print("Download successful")
except Exception as e:
print("Download failed:", e)
folder_path = "/new/folder"
try:
response = client.create_folder(folder_path)
print("Folder creation successful:", response.status_code)
except Exception as e:
print("Folder creation failed:", e)
remote_path = "/path/to/delete/file.txt"
try:
response = client.delete_file(remote_path)
print("Deletion successful:", response.status_code)
except Exception as e:
print("Deletion failed:", e)
keyword = "sometext"
try:
result: list = client.search_files(keyword)
print("Search successful:", result)
except Exception as e:
print("Search failed:", e)
Contributions are welcome! Please read the CONTRIBUTING.md for guidelines on how to contribute to this project.
This project is licensed under the MIT License - see the LICENSE file for details.
If you need assistance or encounter any bugs, please open an issue on the project's GitHub issues page.
FAQs
A Python interface for interacting with Microsoft's OneDrive.
We found that sy-ofb-python-sdk 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.
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.