config->
OpenSim.ini:
[HoloNonce]
LocalValkeyHost = 127.0.0.1
LocalValkeyPort = 6379
TTLSeconds = 600
// Nonce Test Script
// Touch and it will request a nonce and display it to the owner.
default
{
state_entry()
{
llSetText("Touch to test osGetNonce()", , 1.0);
}
touch_start(integer total_number)
{
key toucher = llDetectedKey(0);
if (toucher != llGetOwner())
{
llRegionSayTo(toucher, 0, "Owner only.");
return;
}
string nonce = osGetNonce("test", "touch");
if (nonce == "")
{
llOwnerSay("Failed to obtain nonce.");
return;
}
llOwnerSay("Nonce: " + nonce);
}
}
Then using redis-cli or valkeys-cli:
127.0.0.1:6379> KEYS holo:nonce:*
1) "holo:nonce:46a31f41c34c26736f5ed3d2919facc347ac128fd5cc5f4f5b50eb2382aeeae3"
127.0.0.1:6379> GET holo:nonce:46a31f41c34c26736f5ed3d2919facc347ac128fd5cc5f4f5b50eb2382aeeae3
"{\"service\":\"test\",\"action\":\"touch\",\"owner_uuid\":\"69696969-6969-4666-9666-696969696969\",\"object_uuid\":\"449e4c28-ec95-4401-8d6a-5b9668000ac2\",\"object_name\":\"test nonce\",\"region_uuid\":\"a9d4fe06-6c73-46ab-a3e5-58a9a53f710c\",\"region_name\":\"Holoneon Welcome\",\"created_at\":1782241365}"
note the nonce is short-lived if you get [null] result try again quicker next time!
like(0)