Easy SuiteSpot authentication.
Project description
SuiteSpot Authentication
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.
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.
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.
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
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.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68c61f7e8ba6e69f6677d12aa47e2073259ef1ae1e9a3b68ebaea2619ba276a6 |
|
MD5 | 243288d970e8a5e083ac82ce6d7bbdac |
|
BLAKE2b-256 | 3d4008bdf8e949caae3f5f71370a40c1a2dc775c690cba4115b520f29e2ce026 |