mirror of
https://github.com/anikeen-com/id.git
synced 2026-11-05 07:09:33 +00:00
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:
5 files changed
+16
-11
No files matched your search
@@ -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());
|
||||
|
||||
Reference in new issue
Block a user