Python Auth Library that exposes utility functions to authenticate SmoothCode requests
Project description
SmoothCode Auth Python
Introduction
Python Auth Library that exposes utility functions to authenticate SmoothCode requests
Installation
- Supported python versions
>= python3
- Install using
pip install smoothcode_auth
Usage
This library exposes 2 methods
is_dashboard_request(shop)- This method verifies if the request for accessing the dashboard is coming fromSmoothCode
from smoothcode_auth import SmoothCodeAuth
# SmoothCode sends query parameters to the URL
# shop -> Shopify Shop in the form: `test.myshopify.com`
# hmac -> HMAC of the shop signed by your App Client Secret (can be obtained from SmoothCode Dashboard in App Settings)
SmoothCodeAuth(request_hmac, client_secret).is_dashboard_request(shop) # returns True if the request is valid
is_webhook_request(webhook_data)- This method verifies if the webhook request is coming fromSmoothCode
from smoothcode_auth import SmoothCodeAuth
# SmoothCode sends hmac in the Authorization Header of the request
# It is hmac of the webhook id signed by your App Client Secret
SmoothCodeAuth(request_hmac, client_secret).is_webhook_request(webhook_data) # returns True if the request is valid
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
smoothcode_auth-0.0.4.tar.gz
(4.3 kB
view details)
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 smoothcode_auth-0.0.4.tar.gz.
File metadata
- Download URL: smoothcode_auth-0.0.4.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.22.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19a2ddff9362ff24445da3767d078a623c856696437a28732a063f79b08b6723
|
|
| MD5 |
d57f647f85fecd3bae5b826014aa0ed9
|
|
| BLAKE2b-256 |
5360f9d502e1f8a413f072bc6d3ca7a60e37d6df8cf827d5953e930e3d4a8662
|
File details
Details for the file smoothcode_auth-0.0.4-py2.py3-none-any.whl.
File metadata
- Download URL: smoothcode_auth-0.0.4-py2.py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.22.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03031c56fb56e5779872aa37fb1bb67f89a49cac195dfd7778af84d05e014a62
|
|
| MD5 |
d92e2d46de27cc497a02d2ae37aa4e37
|
|
| BLAKE2b-256 |
bd01ce467e2260c778aa5aa942a1100326e09f1e2591c65636b80f9fda797356
|