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.
Release files for hotglue-singer-sdk 1.0.47
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hotglue_singer_sdk-1.0.47.tar.gz | 113.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hotglue_singer_sdk-1.0.47-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 253.6 kB
Release files / hotglue_singer_sdk-1.0.47.tar.gz
| Download URL | hotglue_singer_sdk-1.0.47.tar.gz |
|---|---|
| Size | 113.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32e641f5d5c6fffc919f5753454615a886a8a7d04c7301c5f3b6878cc65eeed2
|
|
BLAKE2b-256 checksum How to use checksums |
79b95687bcc243ba351427853177277c4df0a119ac58358206424ab8ceb4b603
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / hotglue_singer_sdk-1.0.47-py3-none-any.whl
| Download URL | hotglue_singer_sdk-1.0.47-py3-none-any.whl |
|---|---|
| Size | 140.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
76dbec7331c4a0720f877a27d2f3bcdbab4f12dde2c4845eafb29a38af4e2486
|
|
BLAKE2b-256 checksum How to use checksums |
08867ee0460bec02149aad8bc9c0bd082fe32cb8b928954dc6c868f50a359a9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|