Skip to main content

Easy SuiteSpot authentication.

Project description

SuiteSpot Authentication

PyPI Downloads License

Introduction

This package is a light wrapper for the SuiteSpot authentication API to provide easy creation of an access token. This token is required as part of Bearer Authorization in all calls to SuiteSpot's analytics API.

Installation

$ pip install suitespotauth

or

$ python -m pip install suitespotauth

Configuration

This package relies on your SuiteSpot username and password, since SuiteSpot's authentication API uses them in creating Basic Authorization for the initial authentication flow request. The username and password can be securely stored either on your computer or in a cloud provider.

Local environment

If you are running the package locally, you can store your SuiteSpot credentials on your computer (macOS Keychain or Windows Credential Locker). This is built on top of keyring.

Run the following command to set your local SuiteSpot credentials:

$ suitespotauth-configure

Cloud environment

You can also store your SuiteSpot credentials in a cloud provider secret manager. This helps for cloud environments (e.g., Lambda) where you can't use local secret storage. (Of course, you may choose to store your SuiteSpot credentials in a cloud provider even if you are running locally.)

See the Cloud configuration section for the syntax used for cloud credential storage.

Usage

from suitespotauth import SuiteSpotAuth
from suitespotauth import LocalCredentialStorage  # Or a cloud option

my_credentials = LocalCredentialStorage()

auth = SuiteSpotAuth(
    credential_storage=my_credentials,
    api_token_name="Custom SuiteSpot API token name"  # Optional
)

access_token = auth.access_token

headers = {
    "Authorization": f"Bearer {access_token}"
}

Cloud configuration

AWS

suitespotauth supports using AWS Parameter Store (SSM) to retrieve SuiteSpot credentials. You must have IAM permissions for your runtime (e.g., Lambda) to access the parameters. Instructions for IAM permissions are beyond the scope of this readme.

Set two SSM parameters, username and password, named anything you want. Choose SecureString type when creating the parameters. Then, provide the paths to these parameters when creating the AWSCredentialStorage object.

Install the AWS dependencies:

$ pip install 'suitespotauth[aws]'
from suitespotauth import AWSCredentialStorage

my_credentials = AWSCredentialStorage(
    username_path="/path/to/suitespot/username/in/ssm",
    password_path="/path/to/suitespot/password/in/ssm"
)

GCP

suitespotauth supports using GCP Secret Manager to retrieve SuiteSpot credentials. Set two secrets, username and password, named anything you want. Then, provide the Project ID and the paths to these two secrets when creating the GCPCredentialStorage object.

Install the GCP dependencies:

$ pip install 'suitespotauth[gcp]'
from suitespotauth import GCPCredentialStorage

my_credentials = GCPCredentialStorage(
    project_id="my-gcp-project-id",
    username_secret_id="suitespot-username-secret-id",
    password_secret_id="suitespot-password-secret-id"
)

Azure

suitespotauth supports using Azure Key Vault to retrieve SuiteSpot credentials. Set two secrets, username and password, named anything you want. Then, provide the Vault URL and the names of these two secrets when creating the AzureCredentialStorage object.

Install the Azure dependencies:

$ pip install 'suitespotauth[azure]'
from suitespotauth import AzureCredentialStorage

my_credentials = AzureCredentialStorage(
    vault_url="https://my.azure.keyvault.url",
    username_secret_name="suitespot-username-secret-name",
    password_secret_name="suitespot-password-secret-name"
)

Disclaimer

  • This is an unofficial package and is not affiliated with SuiteSpot. The official SuiteSpot authentication API docs can be found at: https://auth.suitespot.io/api
  • The SuiteSpot authentication API may change at any time, which can cause breaking changes to this package. Please open an issue on GitHub if you notice such problems

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

suitespotauth-0.3.5.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

suitespotauth-0.3.5-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file suitespotauth-0.3.5.tar.gz.

File metadata

  • Download URL: suitespotauth-0.3.5.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for suitespotauth-0.3.5.tar.gz
Algorithm Hash digest
SHA256 efe8cbba30e04d70783ff8b3c17bd56a3849b133e29f03bbeb5b4607f64c7765
MD5 eb6607fa378704856fbddc8e28eb08e8
BLAKE2b-256 860b12830df914a1c85f41f17455f118a659c3ee3989412133e26a36ff21ac80

See more details on using hashes here.

File details

Details for the file suitespotauth-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: suitespotauth-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for suitespotauth-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2cad17811f7e29d725df2f2cc8a2ee1ae4e9c104955613619be5c31fbb86a867
MD5 8c2fe8179153628d6c912d1a3abed2bd
BLAKE2b-256 e312bf6a4d938f49c0cbda8211af18aacdb50f3960db995b46624b8c7202a8de

See more details on using hashes here.

Supported by

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