Skip to main content

Python Auth Library that exposes utility functions to authenticate SmoothCode requests

Project description

SmoothCode Auth Python

Tests

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 from SmoothCode
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 from SmoothCode
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)

Uploaded Source

Built Distribution

smoothcode_auth-0.0.4-py2.py3-none-any.whl (3.4 kB view details)

Uploaded Python 2 Python 3

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

Hashes for smoothcode_auth-0.0.4.tar.gz
Algorithm Hash digest
SHA256 19a2ddff9362ff24445da3767d078a623c856696437a28732a063f79b08b6723
MD5 d57f647f85fecd3bae5b826014aa0ed9
BLAKE2b-256 5360f9d502e1f8a413f072bc6d3ca7a60e37d6df8cf827d5953e930e3d4a8662

See more details on using hashes here.

File details

Details for the file smoothcode_auth-0.0.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for smoothcode_auth-0.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 03031c56fb56e5779872aa37fb1bb67f89a49cac195dfd7778af84d05e014a62
MD5 d92e2d46de27cc497a02d2ae37aa4e37
BLAKE2b-256 bd01ce467e2260c778aa5aa942a1100326e09f1e2591c65636b80f9fda797356

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page