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 (macOS Keychain or Windows Credential Locker). Run the following command to set your SuiteSpot credentials:
$ suitespotauth-configure
Cloud environment
If you are running the package in a cloud environment, suitespotauth
can retrieve your SuiteSpot credentials from the cloud provider. Please see the Cloud configuration section below before continuing.
Usage
- Import the authenticator class:
from suitespotauth.auth import SuiteSpotAuth
- Import your chosen credential storage class:
# Import at least one
from suitespotauth.credentials import (
LocalCredentialStorage, # For local environments using `suitespot-configure`
AWSCredentiaStorage,
GCPCredentialStorage,
AzureCredentialStorage
)
- Create a credential storage instance:
# Local storage after running `suitespot-configure`
credential_storage = LocalCredentialStorage()
# AWS storage
credential_storage = AWSCredentialStorage(
username_path="/path/to/suitespot/username/in/ssm",
password_path="/path/to/suitespot/password/in/ssm"
)
# GCP storage
credential_storage = GCPCredentialStorage(
project_id="my-gcp-project-id",
username_secret_id="suitespot-username-secret-id",
password_secret_id="suitespot-password-secret-id"
)
# Azure storage
credential_storage = AzureCredentialStorage(
vault_url="https://my.azure.keyvault.url",
username_secret_name="suitespot-username-secret-name",
password_secret_name="suitespot-password-secret-name"
)
- Create an authenticator instance and provide your credential storage instance
auth = SuiteSpotAuth(
credential_storage=credential_storage,
api_token_name="Custom SuiteSpot API token name"
)
- Use the
access_token
attribute in your data API request header:
access_token = auth.access_token
"Authorization": f"Bearer {access_token}"
Official SuiteSpot data API docs should be retrieved directly from your SuiteSpot representative.
Cloud configuration
AWS
suitespotauth
supports using AWS Systems Manager 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. See the Usage section above.
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. See the Usage section above.
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. 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.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1831b89be3eb0b5f0eeac85bb7af23854809c600e954b7b9a355db53ad8da409 |
|
MD5 | d76b1e4364d842184aef5fba1f7b71ea |
|
BLAKE2b-256 | 1ac8ae4f6dd36629f50b256842a00f1a19d44e4348774f24327cdfbda025cec0 |