Easy SuiteSpot authentication.
Project description
SuiteSpot Authentication
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
- In your Python program, import the authenticator class:
from suitespotauth import SuiteSpotAuth
- 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"
)
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for suitespotauth-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6141e3acfe1ee7b51710dbf4471f0449675d8a6afd0ba8254fa1a48e8299dfa4 |
|
MD5 | e4a63d7f126922a11fb9ac3e646c65ba |
|
BLAKE2b-256 | 433a6134cca72d3eff02a6c89eeff7ea7f585eb1b57c6d0661de48252b45c6e1 |