Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/astrosat/dat-utils

utilities for working with Data Access Tokens
https://github.com/astrosat/dat-utils

Last synced: about 1 month ago
JSON representation

utilities for working with Data Access Tokens

Awesome Lists containing this project

README

        

Data Access Token Utils
=======================

Modules:

* `dat_utils.dat`: Functions for verifying a data access token
* `dat_utils.jwt`: Function helpers for JWTs
* `dat_utils.sourcid`: Functions for manipulating Source IDs

Example usage:

```python3
# Validate the token with the secret key, issue time and expiration, and check scope permission

is_valid, payload = verify_token_for_request(
token=token,
secret_key=SECRET_KEY,
source_id='astrosat/forestry/canopy-change/2019-12-07',
verb='read'
)

if is_valid:
print("Token valid", payload)

else:
err_message = payload
print("Token not valid", err_message)

```