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.
Python client SDK for the PocketBase backend.
This is in early development, and at first is just a translation of the javascript lib using HTTPX.
Install PocketBase using PIP:
python3 -m pip install pocketbase
The rule of thumb here is just to use it as you would the javascript lib, but in a pythonic way of course!
from pocketbase import PocketBase # Client also works the same
from pocketbase.client import FileUpload
client = PocketBase('http://127.0.0.1:8090')
# authenticate as regular user
user_data = client.collection("users").auth_with_password(
"user@example.com", "0123456789")
# check if user token is valid
user_data.is_valid
# or as admin
admin_data = client.admins.auth_with_password("test@example.com", "0123456789")
# check if admin token is valid
admin_data.is_valid
# list and filter "example" collection records
result = client.collection("example").get_list(
1, 20, {"filter": 'status = true && created > "2022-08-01 10:00:00"'})
# create record and upload file to image field
result = client.collection("example").create(
{
"status": "true",
"image": FileUpload(("image.png", open("image.png", "rb"))),
})
# and much more...
More detailed API docs and copy-paste examples could be found in the API documentation for each service. Just remember to 'pythonize it' 🙃.
These are the requirements for local development:
You can install locally:
poetry install
Or can build and generate a package:
poetry build
But if you are using only PIP, use this command:
python3 -m pip install -e .
To execute the tests use this command:
poetry run pytest
A lot of real-world integration test against a sandboxed pocketbase instance will be included in the pytest when the sandbox is running (on 127.0.0.1:8090) to start the sandbox follow the following steps:
export TMP_EMAIL_DIR=`mktemp -d` # Export temp dir used for sendmail sandbox
bash ./tests/integration/pocketbase # Run the pocketbase sandbox (automatically downloads the latest pocketbase instance)
pytest # Run test including sandbox API integration tests
The PocketBase Python SDK is MIT licensed code.
FAQs
PocketBase SDK for python.
We found that pocketbase 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.