A framework for building Singer taps and targets
Project description
Hotglue SDK for Taps
This is a fork of Melanto's SingerSDK for special use in hotglue, an embedded integration platform for running Singer Taps and Targets.
Taps and targets built on the SDK are automatically compliant with the Singer Spec, the de-facto open source standard for extract and load pipelines.
OAuth Access Token Support
Taps can implement the --access-token CLI flag to refresh OAuth access tokens without running the tap directly.
Implementing Access Token Support
To enable this feature in your tap, override the access_token_support class method to return a tuple of (authenticator_class, auth_endpoint):
from hotglue_singer_sdk import Tap
from my_tap.auth import MyOAuthAuthenticator
class MyTap(Tap):
name = "tap-myservice"
@classmethod
def access_token_support(cls, connector=None):
"""Return the authenticator class and auth endpoint for token refresh.
Returns:
A tuple of (authenticator_class, auth_endpoint).
"""
default_url = "https://api.myservice.com/oauth/token"
# ommit if token url is not dynamic
dynamic_url = connector.config.get("auth_url")
url = dynamic_url or default_url
return (MyOAuthAuthenticator, url)
Authenticator Requirements
The authenticator class must implement the following methods:
is_token_valid()- ReturnsTrueif the current access token is still validupdate_access_token()- Refreshes the access token and updates the config file
The authenticator will be instantiated with these parameters:
stream- A dummy stream object withlogger,tap_name, andconfigattributesconfig_file- Path to the config file for writing updated tokensauth_endpoint- The OAuth token endpoint URL
Usage
Once implemented, users can refresh the access token using:
tap-myservice --config config.json --access-token
This will output the new access token as JSON:
{
"access_token": "new_token_value"
}
Note: The --access-token flag requires a config file path. It will not work with --config ENV or when omitting the config.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hotglue_singer_sdk-1.0.29.tar.gz.
File metadata
- Download URL: hotglue_singer_sdk-1.0.29.tar.gz
- Upload date:
- Size: 109.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b343223df444e569e1beb422a35a55bed3a3dddaf762085f0417628c733990f
|
|
| MD5 |
7286bdca792ff1e53ff7d6485e9f3087
|
|
| BLAKE2b-256 |
88706707c25f496793526406c69330247899cff76e440f73b32a6d273f18ddf4
|
File details
Details for the file hotglue_singer_sdk-1.0.29-py3-none-any.whl.
File metadata
- Download URL: hotglue_singer_sdk-1.0.29-py3-none-any.whl
- Upload date:
- Size: 136.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0a7b180ea2909c1aa4fdf40214ea7a063b9f5fd8040d98a9255cb494e9212fb
|
|
| MD5 |
28fde28bc9927572795c531afd44a6b8
|
|
| BLAKE2b-256 |
c77173a85ce2ae3dfb9e102b5ec01907e4bacfefc809b538014aa1bf478dee91
|