Drop the full products scope the Console does not accept

The Console's product APIs accept user, user:read and products:read only
(decision 21 names products:read). A token with just "products" was
refused everywhere despite its consent text.
This commit is contained in:
Maurice Preuß committed 2026-11-05 00:11:35 +01:00
1 parent d99512a359
commit e8432df997
5 files changed
+16 -11

No files matched your search

+6 -1
View File
@@ -11,7 +11,6 @@ class ScopeTest extends TestCase
public static function newScopes(): array
{
return [
'products' => [Scope::PRODUCTS, 'products'],
'products:read' => [Scope::PRODUCTS_READ, 'products:read'],
'reseller-customers' => [Scope::RESELLER_CUSTOMERS, 'reseller-customers'],
'reseller-customers:read' => [Scope::RESELLER_CUSTOMERS_READ, 'reseller-customers:read'],
@@ -26,6 +25,12 @@ class ScopeTest extends TestCase
$this->assertSame($expected, $constant);
}
public function test_there_is_no_full_products_scope_the_console_would_not_accept(): void
{
// the Console's product APIs accept `user`, `user:read` and `products:read` only
$this->assertNotContains('products', (new ReflectionClass(Scope::class))->getConstants());
}
public function test_every_scope_follows_the_resource_and_level_schema(): void
{
$scopes = array_values((new ReflectionClass(Scope::class))->getConstants());