Hi all!
Quick one hopefully. Has something changed with authentication for packages such as Horizon (I also am seeing this for Pulse)? I am getting nothing but 401s trying to get to horizon. This has happened after a routine update that touched nothing related to any auth code anywhere.
However the build system will pull in updated dependencies.. In the working patch laravel framework and horizon were at 10.50.0 and 5.44.0 respectively. Now we are at 10.50.2 and 5.45.0.
We define in the boot method of our ServiceProvider
// Require the queue_manager role to view the dashboard
Horizon::auth(function () {
return Gate::allows('global.queue_manager');
});
I added a Gate::after function that just logs the results of each check
which returns the following.
{
"user": {
removed
}
},
"ability": "global.queue_manager",
"result": true,
"arguments": []
}
In order to test that the gate was working we have a test case
/**
* Test ACL global permissions as a super-admin.
*/
public function testGlobalPermissionsAsAdmin()
{
$permissions = array_keys(require __DIR__ . '/../../src/Config/Permissions/global.php');
$user = User::factory()->create([
'admin' => true,
]);
foreach ($permissions as $permission) {
Redis::flushdb();
$scope_permission = sprintf('global.%s', $permission);
$this->assertTrue($user->can($scope_permission));
}
}
Which is still passing...
Looking at the laravel updates I dont see anything that is relevant.
https://github.com/laravel/framework/compare/v10.50.0...10.50.2
Or in horizon.
https://github.com/laravel/horizon/compare/v5.44.0...v5.45.0
I am not sure exactly what else I should be looking at to debug this?
Also I understand that Laravel 10 is well EOL... We cannot easily update at this time, but will be looking to later in the year.