Multi-Tenant Cryptographic Audit Logger with Regional Data Residency
Project description
🛡️ Stanley Shield Python SDK
The official 2026 Python Gatekeeper for the Stanley Shield Bunker. This SDK provides cryptographic audit logging with native support for Regional Data Residency.
Install the pre-built wheel:
pip install stanley_shield-1.0.0-py3-none-any.whl
🔐 Onboarding & Setup
To use the Shield, you must authenticate your server using the Infisical Machine Identity credentials provided by your Stanley Shield administrator.
1. Requirements
-
Install the Infisical CLI:
bash brew install infisical/get-cli/infisical[MacOS] or follow the official guide. -
Obtain your Credentials Pack:
-
INFISICAL_MACHINE_ID
-
INFISICAL_MACHINE_SECRET
-
INFISICAL_PROJECT_ID
-
STANLEY_BUNKER_URL
-
2. Authentication & Execution
Run these commands in your terminal to link your environment to the Bunker. This ensures your STANLEY_HMAC_SECRET is injected directly into memory and never stored on disk.
Step A: Authenticate your session
export INFISICAL_TOKEN=$(infisical login --method=universal-auth \
--client-id=YOUR_MACHINE_ID \
--client-secret=YOUR_MACHINE_SECRET \
--silent --plain)
Step B: Run your app with injected secrets
infisical run --path=/apps/fintech-api --env=prod --projectId=YOUR_PROJECT_ID -- python3 main.py
Basic Usage
Basic Initialization
Once the app is running via the infisical run command, the SDK will automatically detect your configuration.
Python code
from stanley_shield import Gatekeeper
# Automatically pulls STANLEY_HMAC_SECRET and STANLEY_CLIENT_ID from Infisical
gk = Gatekeeper(bunker_url="https://bunker.yourdomain.com")
# Log an event
gk.log(
actor_id="user_99",
action="CREDIT_CARD_LINKED",
resource="card_8822",
residency="NG_LOCAL", # Routes to Nigerian infrastructure
metadata={"bank": "GTBank", "currency": "NGN"}
)
Security Features
-
HMAC-SHA256 Signing: Every request is signed. The Bunker rejects any payload that has been tampered with in transit.
-
Non-Blocking Transporter: Logging happens in a background daemon thread. Your application's performance is never affected by network latency.
-
Replay Protection: Includes a 60-second window timestamp to prevent old requests from being re-sent.
Data Residency Support
-
GLOBAL: Default storage in the Global Vault.
-
NG_LOCAL: Routes logs to the localized Nigerian infrastructure.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 stanley_shield-1.0.0.tar.gz.
File metadata
- Download URL: stanley_shield-1.0.0.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bcf362366a97e0a119d66d46ecf528cdb3a6ded203c3687b5aa1d69ac9a5251
|
|
| MD5 |
e5598d9136019088d47e41ecdee632d6
|
|
| BLAKE2b-256 |
bbacad13567695db954209dd7724315e363aba12e7ca3d9f29d14d2ee3658e51
|
File details
Details for the file stanley_shield-1.0.0-py3-none-any.whl.
File metadata
- Download URL: stanley_shield-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
016cf63254e83d536fc24b845959278abfd2e3fb381b2ecf053e4c2ec3dd9d5a
|
|
| MD5 |
6ec47c735e448b2627088850bec24941
|
|
| BLAKE2b-256 |
417424a6a611f08c9970166d9f43ea5c765a8edb2b6c08d9af80938d665e77ea
|