Skip to main content

Pangea API SDK

Project description


Pangea Logo


documentation Slack


Pangea Python SDK

A Python SDK for integrating with Pangea Services. Click here to check out Pangea services.

Installation

pip3 install pangea-sdk
# or
poetry add pangea-sdk

Usage

For sample apps, look at the /examples folder in this repository. There you will find basic sample apps for each of the services supported on this SDK. Each service folder has a README.md with instructions to install, setup, and run the sample app.

Asyncio support

We have added support to the asyncio library using aiohttp in order to support async/await calls to all our services. Async services classes are inside pangea/asyncio folder, and examples about how to use them are in /examples/asyncio.

Secure Audit Service - Integrity Tools

The Python Pangea SDK also includes some extra features to validate Audit Service log's integrity. Here we explain how to run them.

Verify audit data

Verify that an event or a list of events has not been tampered with. Usage:

usage: python -m pangea.verify_audit [-h] [--file PATH]
or
usage: poetry run python -m pangea.verify_audit [-h] [--file PATH]

Pangea Audit Verifier

options:
  -h, --help            show this help message and exit
  --file PATH, -f PATH  Input file (default: standard input).

It accepts multiple file formats:

  • a Verification Artifact from the Pangea User Console
  • a search response from the REST API:
curl -H "Authorization: Bearer ${PANGEA_TOKEN}" -X POST -H 'Content-Type: application/json'  --data '{"verbose": true}' https://audit.aws.us.pangea.cloud/v1/search

Bulk Download Audit Data

Download all audit logs for a given time range. Start and end date should be provided, a variety of formats is supported, including ISO-8601. The result is stored in a json file (one json per line).

usage: python -m pangea.dump_audit [-h] [--token TOKEN] [--domain DOMAIN] [--output OUTPUT] start end
or
usage: poetry run python -m pangea.dump_audit [-h] [--token TOKEN] [--domain DOMAIN] [--output OUTPUT] start end

Pangea Audit Dump Tool

positional arguments:
  start                 Start timestamp. Supports a variety of formats, including ISO-8601. e.g.: 2023-06-05T18:05:15.030667Z
  end                   End timestamp. Supports a variety of formats, including ISO-8601. e.g.: 2023-06-05T18:05:15.030667Z

options:
  -h, --help            show this help message and exit
  --token TOKEN, -t TOKEN
                        Pangea token (default: env PANGEA_TOKEN)
  --domain DOMAIN, -d DOMAIN
                        Pangea base domain (default: env PANGEA_DOMAIN)
  --output OUTPUT, -o OUTPUT
                        Output file name. Default: dump-<timestamp>

Perform Exhaustive Verification of Audit Data

This script performs extensive verification on a range of events of the log stream. Apart from verifying the hash and the membership proof, it checks that there are no omissions in the stream, i.e. all the events are present and properly located.

usage: python -m pangea.deep_verify [-h] [--token TOKEN] [--domain DOMAIN] --file FILE
or
usage: poetry run python -m pangea.deep_verify [-h] [--token TOKEN] [--domain DOMAIN] --file FILE

Pangea Audit Event Deep Verifier

options:
  -h, --help            show this help message and exit
  --token TOKEN, -t TOKEN
                        Pangea token (default: env PANGEA_TOKEN)
  --domain DOMAIN, -d DOMAIN
                        Pangea base domain (default: env PANGEA_DOMAIN)
  --file FILE, -f FILE  Event input file. Must be a collection of JSON Objects separated by newlines

It accepts multiple file formats:

  • a Verification Artifact from the Pangea User Console
  • a file generated by the dump_audit command
  • a search response from the REST API (see verify_audit)

Reporting issues and new features

If you run into an issue using or testing this SDK or if you have a new feature request, feel free to open an issue by clicking here. We would need you to provide some basic information, such as what SDK version you are using, the stack trace if you got it, the framework used, and steps to reproduce the issue. Also, feel free to contact Pangea support by email or send us a message on Slack.

Contributing

Currently, the setup scripts only have support for Mac/ZSH environments. Future support is incoming.

To install our linters, simply run ./dev/setup_repo.sh These linters will run on every git commit operation.

Send a PR

If you would like to send a PR including a new feature or fixing a bug in the code or an error in documents, we really appreciate it and after review and approval, you will be included in our contributors list.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pangea_sdk-3.3.0.tar.gz (79.1 kB view details)

Uploaded Source

Built Distribution

pangea_sdk-3.3.0-py3-none-any.whl (96.0 kB view details)

Uploaded Python 3

File details

Details for the file pangea_sdk-3.3.0.tar.gz.

File metadata

  • Download URL: pangea_sdk-3.3.0.tar.gz
  • Upload date:
  • Size: 79.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.7.17 Linux/5.10.0-23-cloud-amd64

File hashes

Hashes for pangea_sdk-3.3.0.tar.gz
Algorithm Hash digest
SHA256 5c254ce5d7f7deae21bfb655325407b2bc1195e6f0b9d75b719f0c896313a8c8
MD5 db7bc9083922bd75f4841eb900ddd596
BLAKE2b-256 23019bc191998a533addb695f94a90a90d8452bd737950a0645cd2e0818930ee

See more details on using hashes here.

File details

Details for the file pangea_sdk-3.3.0-py3-none-any.whl.

File metadata

  • Download URL: pangea_sdk-3.3.0-py3-none-any.whl
  • Upload date:
  • Size: 96.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.7.17 Linux/5.10.0-23-cloud-amd64

File hashes

Hashes for pangea_sdk-3.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f90aa369e7a40f6034679876ea3ccd0187cf9e5a5746a80785badd6b28da7608
MD5 122716240450f2b9f88ee6e06c73e098
BLAKE2b-256 720bcce598e9e02e313466a3cccaabe77dc450069a6e3a4986409388d35638f3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page