Try this:
$allowed = (array) json_decode(file_get_contents("allowed.json"));
So instead of directly parsing the JSON as an array (by specifying second parameter of json_decode), first get the object that will preserve the key, then cast as an array.