Skip to main content

Easy SuiteSpot authentication.

Project description

SuiteSpot Authentication

PyPI License

Introduction

This package is a light wrapper for the SuiteSpot authentication API to provide easy generation of an access token to be used in SuiteSpot data API calls.

Suitespot data API requests require Bearer Authorization including an access token. This package provides an abstraction layer to easily generate an access token.

Installation

$ 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 some requests. The username and password can be securely stored either on your computer or in a cloud environment.

Local environment

If you are running the package locally, your SuiteSpot credentials are securely stored on your computer using keyring. Run the following command to set your SuiteSpot credentials:

$ suitespotauth-configure

Cloud environment

AWS

If you are running the package in an AWS environment, suitespotauth can retrieve your SuiteSpot credentials from AWS Parameter Store (SSM). Please see the Cloud configuration section below before continuing.

Usage

  1. In your Python program, import the authenticator class:
from suitespotauth import SuiteSpotAuth
  1. Create a class instance:
auth = SuiteSpotAuth()

# Optionally, provide a name which gets stored in the SuiteSpot API token object
auth = SuiteSpotAuth(api_token_name="Custom API token name")

# If using AWS SSM to store SuiteSpot credentials, provide the SSM paths to your username and password parameters
auth = SuiteSpotAuth(
    api_token_name="Custom API token name",  # Optional
    ssm_username_path="/path/to/suitespot/username/parameter/in/ssm",
    ssm_password_path="/path/to/suitespot/password/parameter/in/ssm"
)
  1. Use the access_token attribute in your data API request header:
"Authorization": f"Bearer {auth.access_token}"

Official SuiteSpot data API docs should be retrieved directly from your SuiteSpot representative.

Cloud configuration

AWS Parameter Store (SSM)

To retrieve SuiteSpot credentials from SSM, you must have an AWS account, as well as IAM permissions for your runtime (e.g., Lambda) to access the parameters. Instructions for IAM permissions are beyond the scope of this readme.

You must set two SSM parameters, username and password, and they can be named anything you want. Choose SecureString type when creating the parameters. Then, you must provide the paths to these parameters when instantiating the SuiteSpotAuth object. See the Usage section above.

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.2.0.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

suitespotauth-0.2.0-py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 3

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