# gatekeeper-sdk/tests/test_sdk.py
from stanley_shield import Gatekeeper
import time
import os

def test_integration():
    os.environ["STANLEY_CLIENT_ID"] = "FLUTTERWAVE"
    secret = "fw_secret_88d23491bc90412" 
    os.environ["STANLEY_HMAC_SECRET"] = secret 

    shield = Gatekeeper(bunker_url="https://bunker-engine.onrender.com")
    
    print("🚀 Sending Flutterwave log to Bunker...")
    # This call is correct!
    shield.log(
        actor_id="python_prod@stanley.com",
        action="BVN_VERIFICATION",
        resource="customer_bvn",
        residency="NG_LOCAL",
        metadata={"info": "testing the python sdk integration with flutterwave logs" }
    )
    
    time.sleep(1)
    print("✅ Check your Node.js Bunker console!")
    print(f"DEBUG: SDK Secret ends in: ...{secret[-4:]}")
    print(f"DEBUG: Current Python Time -> {int(time.time())}")

if __name__ == "__main__":
    test_integration()