📈 GH Trending Explorer 🎲 Surprise me

← all repos

AhmadHassan-BTed / ShopifyAutoAuth

git clone https://github.com/AhmadHassan-BTed/ShopifyAutoAuth.git v1.0.0 · 2mo ago

Enterprise-grade Shopify Admin API authentication adapter — OAuth 2.0 Client Credentials Grant with automatic token refresh.

+288
stars, 24h · #118
+~1.4k
stars, 7 days · #150
+~6.0k
stars, 30 days · #142
2.5k
★ total · +135% this week
0
forks · 3 open issues

Star history (as recorded here)

2026-10-20 · 1,848 ★ 2026-10-23 · 2,452 ★
LanguagePython
LicenseMIT
Created2026-08-20 (2mo ago)
Last push1mo ago
Watchers0
OwnerUser

GitHub topics

Links

README excerpt
ShopifyAutoAuth 
 Enterprise-Grade Shopify OAuth 2.0 Client Credentials Adapter 
 A zero-friction, production-hardened bridge connecting legacy Shopify applications to modern Client Credentials Grant authentication. 
 -8a2be2?style=for-the-badge)
---
## Overview
Following Shopify's mandatory authentication migration on **January 1, 2026**, static `shpat_xxx` custom app tokens were deprecated in favor of **OAuth 2.0 Client Credentials Grant** short-lived access tokens (RFC 6749 §4.4).
`shopify_auth_adapter` provides a transparent authentication proxy. Existing applications can preserve their variable assignment patterns while under the hood tokens are acquired, cached in volatile RAM, and refreshed prior to expiration without runtime interruption.
### Migration: Before vs After
 [code] 
---
## ⚡ Quick Start: 1 Line of Code
To upgrade any Python application to Shopify's modern OAuth 2.0 authentication, replace your deprecated `shpat_xxx` string with **`get_access_token()`**:
 [code] 
That's it! Everything else (OAuth 2.0 requests, RAM caching, automatic 24h refresh) happens automatically behind the scenes.
### Installation
 [code] 
### Setting Up Credentials
You can supply your Shopify Dev Dashboard credentials in **any of 3 ways**:
#### Option A: In a `.env` file (Recommended for Local Dev)
Create a `.env` file in your project root:
 [code] 
#### Option B: Environment Variables (Production / Docker / Cloud)
Set variables in your terminal or deployment environment:
 [code] 
#### Option C: Pass Directly in Python Code
 [code] 
---
### Testing Credentials
You can verify your Dev Dashboard credentials and store connection instantly by running the included tester script:
 [code] 
---
### Usage Examples
#### 1. Drop-In Token Helper
 [code] 
#### 2. High-Level Shopify Client
 [code] 
---
## Feature Matrix
| Domain | Capability | Architectural Mechanism |
| :--- | :--- | :--- |
| **Authentication** | OAuth 2.0 Client Credentials Grant | Automatic `POST /admin/oauth/access_token` exchange for Dev Dashboard apps. |
| **Concurrency** | Thundering Herd Protection | Re-entrant `threading.RLock` double-checked locking mechanism. |
| **Resilience** | Clock-Skew Mitigation | 300-second (5-minute) proactive expiration cutoff buffer. |
| **Header Integration**| Transparent `LiveToken` Proxy | Custom `str` subclass executing JIT encoding delegation during HTTP header resolution. |
| **Client Abstraction**| High-Level `ShopifyClient` | Integrated REST & GraphQL client with automatic 401 cache-invalidation and single retry. |
| **Security** | Zero Credential Leak Guarantee | String masking on `repr`, `str`, and tracebacks (`LiveToken( )`). |
---
## System Architecture & Domain Boundaries
The codebase follows domain-driven modularity principles with contract-based interfaces (`Protocol`) to guarantee zero coupling and total separation of concerns.
 [code] 
---
## Request Lifecycle & Token Resolution
The diagram below illustrates the exact sequence executed when an HTTP