23 lines
771 B
Python
23 lines
771 B
Python
"""Run inside aza-api container; prints only HTTP status / flags (no secrets)."""
|
|
import os
|
|
|
|
import requests
|
|
from requests.auth import HTTPBasicAuth
|
|
|
|
def main() -> None:
|
|
base = (os.environ.get("AZA_WOOCOMMERCE_URL") or "").strip().rstrip("/")
|
|
key = os.environ.get("AZA_WOOCOMMERCE_CONSUMER_KEY")
|
|
secret = os.environ.get("AZA_WOOCOMMERCE_CONSUMER_SECRET")
|
|
print("env_url_configured", bool(base))
|
|
print("env_key_configured", bool(key))
|
|
print("env_secret_configured", bool(secret))
|
|
if not (base and key and secret):
|
|
return
|
|
url = base + "/wp-json/wc/v3/subscriptions/1448"
|
|
r = requests.get(url, auth=HTTPBasicAuth(key, secret), timeout=(5, 25))
|
|
print("wc_sub_probe_http", r.status_code)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|