Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/astrosat/dat-utils
- Owner: astrosat
- Created: 2020-02-10T16:19:01.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-26T12:38:13.000Z (over 3 years ago)
- Last Synced: 2023-03-02T16:05:52.669Z (almost 2 years ago)
- Language: Python
- Size: 10.7 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
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 IDsExample usage:
```python3
# Validate the token with the secret key, issue time and expiration, and check scope permissionis_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)```