From 8073b9a85c827915a227e9f5ac6493f28eaa39be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 02:51:07 +0000 Subject: [PATCH 1/2] Bump symfony/var-dumper from 6.3.3 to 6.4.15 Bumps [symfony/var-dumper](https://github.com/symfony/var-dumper) from 6.3.3 to 6.4.15. - [Release notes](https://github.com/symfony/var-dumper/releases) - [Changelog](https://github.com/symfony/var-dumper/blob/7.2/CHANGELOG.md) - [Commits](https://github.com/symfony/var-dumper/compare/v6.3.3...v6.4.15) --- updated-dependencies: - dependency-name: symfony/var-dumper dependency-type: indirect ... Signed-off-by: dependabot[bot] --- composer.lock | 98 +++++++++++++++++++++------------------------------ 1 file changed, 41 insertions(+), 57 deletions(-) diff --git a/composer.lock b/composer.lock index 7257c7c..dfb04c3 100644 --- a/composer.lock +++ b/composer.lock @@ -2565,16 +2565,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.3.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { @@ -2583,7 +2583,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.4-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -2612,7 +2612,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -2628,7 +2628,7 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/error-handler", @@ -3614,20 +3614,20 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -3637,9 +3637,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3677,7 +3674,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -3693,43 +3690,32 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97" + "reference": "fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/869329b1e9894268a8a61dabb69153029b7a8c97", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce", + "reference": "fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, - "type": "library", + "type": "metapackage", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" } }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - } - }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" @@ -3753,7 +3739,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.31.0" }, "funding": [ { @@ -3769,30 +3755,27 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3836,7 +3819,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" }, "funding": [ { @@ -3852,7 +3835,7 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php83", @@ -4574,16 +4557,16 @@ }, { "name": "symfony/var-dumper", - "version": "v6.3.3", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "77fb4f2927f6991a9843633925d111147449ee7a" + "reference": "38254d5a5ac2e61f2b52f9caf54e7aa3c9d36b80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/77fb4f2927f6991a9843633925d111147449ee7a", - "reference": "77fb4f2927f6991a9843633925d111147449ee7a", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/38254d5a5ac2e61f2b52f9caf54e7aa3c9d36b80", + "reference": "38254d5a5ac2e61f2b52f9caf54e7aa3c9d36b80", "shasum": "" }, "require": { @@ -4596,10 +4579,11 @@ }, "require-dev": { "ext-iconv": "*", - "symfony/console": "^5.4|^6.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/uid": "^5.4|^6.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/error-handler": "^6.3|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/uid": "^5.4|^6.0|^7.0", "twig/twig": "^2.13|^3.0.4" }, "bin": [ @@ -4638,7 +4622,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.3.3" + "source": "https://github.com/symfony/var-dumper/tree/v6.4.15" }, "funding": [ { @@ -4654,7 +4638,7 @@ "type": "tidelift" } ], - "time": "2023-07-31T07:08:24+00:00" + "time": "2024-11-08T15:28:48+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -7904,5 +7888,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } From f6388c912ecc3fed1167936784072776c16ebfb7 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Tue, 3 Dec 2024 02:51:25 +0000 Subject: [PATCH 2/2] Apply fixes from StyleCI --- config/asseco-authorization.php | 18 +++++++-------- src/App/Models/AuthorizationRule.php | 4 ++-- .../Factories/AuthorizableModelFactory.php | 2 +- .../Factories/AuthorizableSetTypeFactory.php | 6 ++--- .../Factories/AuthorizationRuleFactory.php | 10 ++++----- .../Seeders/AuthorizableSetTypeSeeder.php | 8 +++---- .../Seeders/AuthorizationRuleSeeder.php | 6 ++--- tests/TestUser.php | 2 +- .../AuthorizableSetCollectionTest.php | 16 +++++++------- .../Unit/App/Models/AuthorizationRuleTest.php | 22 +++++++++---------- .../Authorization/UserAuthorizableSetTest.php | 20 ++++++++--------- 11 files changed, 57 insertions(+), 57 deletions(-) diff --git a/config/asseco-authorization.php b/config/asseco-authorization.php index 599c067..c6eb9ce 100644 --- a/config/asseco-authorization.php +++ b/config/asseco-authorization.php @@ -12,17 +12,17 @@ * Model bindings. */ 'models' => [ - 'authorizable_model' => AuthorizableModel::class, + 'authorizable_model' => AuthorizableModel::class, 'authorizable_set_type' => AuthorizableSetType::class, - 'authorization_rule' => AuthorizationRule::class, + 'authorization_rule' => AuthorizationRule::class, ], - 'migrations' => [ + 'migrations' => [ /** * UUIDs as primary keys. */ - 'uuid' => false, + 'uuid' => false, /** * Timestamp types. @@ -35,7 +35,7 @@ * Should the package run the migrations. Set to false if you're publishing * and changing default migrations. */ - 'run' => true, + 'run' => true, ], /** @@ -44,20 +44,20 @@ * This does not recurse in folders, so you need to specify * an array of paths if non-standard models are to be used */ - 'models_path' => [ + 'models_path' => [ app_path('Models') => 'App\\Models\\', ], /** * Namespace to Authorizable trait. */ - 'trait_path' => Authorizable::class, + 'trait_path' => Authorizable::class, /** * List of roles/groups/etc which have absolute admin/root rights. * Key must resemble names from authorization_manage_types table. */ - 'absolute_rights' => [ + 'absolute_rights' => [ // 'roles' => [ // 'asseco-voice-admin' // ], @@ -76,5 +76,5 @@ * your auth service (or whoever is responsible for providing user roles). Check readme * for more details. */ - 'virtual_role' => env('VIRTUAL_ROLE', 'voice-all-mighty'), + 'virtual_role' => env('VIRTUAL_ROLE', 'voice-all-mighty'), ]; diff --git a/src/App/Models/AuthorizationRule.php b/src/App/Models/AuthorizationRule.php index f03b8f6..b4fe239 100644 --- a/src/App/Models/AuthorizationRule.php +++ b/src/App/Models/AuthorizationRule.php @@ -198,8 +198,8 @@ public static function format($authorizableSetTypeId, string $authorizableSetVal { return [ self::SET_TYPE_ID => $authorizableSetTypeId, - self::SET_VALUE => $authorizableSetValue, - self::RULES => $rules, + self::SET_VALUE => $authorizableSetValue, + self::RULES => $rules, ]; } } diff --git a/src/Database/Factories/AuthorizableModelFactory.php b/src/Database/Factories/AuthorizableModelFactory.php index 18dc014..307a2c0 100644 --- a/src/Database/Factories/AuthorizableModelFactory.php +++ b/src/Database/Factories/AuthorizableModelFactory.php @@ -21,7 +21,7 @@ public function modelName() public function definition() { return [ - 'name' => $this->faker->word, + 'name' => $this->faker->word, 'created_at' => now(), 'updated_at' => now(), ]; diff --git a/src/Database/Factories/AuthorizableSetTypeFactory.php b/src/Database/Factories/AuthorizableSetTypeFactory.php index 15e1358..66502aa 100644 --- a/src/Database/Factories/AuthorizableSetTypeFactory.php +++ b/src/Database/Factories/AuthorizableSetTypeFactory.php @@ -21,10 +21,10 @@ public function modelName() public function definition() { return [ - 'name' => $this->faker->word, + 'name' => $this->faker->word, 'description' => $this->faker->sentence, - 'created_at' => now(), - 'updated_at' => now(), + 'created_at' => now(), + 'updated_at' => now(), ]; } } diff --git a/src/Database/Factories/AuthorizationRuleFactory.php b/src/Database/Factories/AuthorizationRuleFactory.php index 75fa92c..c9cd1cb 100644 --- a/src/Database/Factories/AuthorizationRuleFactory.php +++ b/src/Database/Factories/AuthorizationRuleFactory.php @@ -22,11 +22,11 @@ public function definition() { return [ 'authorizable_set_type_id' => $this->faker->randomNumber(), - 'authorizable_set_value' => $this->faker->word, - 'authorizable_model_id' => $this->faker->randomNumber(), - 'rules' => json_encode($this->faker->words(10)), - 'created_at' => now(), - 'updated_at' => now(), + 'authorizable_set_value' => $this->faker->word, + 'authorizable_model_id' => $this->faker->randomNumber(), + 'rules' => json_encode($this->faker->words(10)), + 'created_at' => now(), + 'updated_at' => now(), ]; } } diff --git a/src/Database/Seeders/AuthorizableSetTypeSeeder.php b/src/Database/Seeders/AuthorizableSetTypeSeeder.php index f07670f..b752698 100644 --- a/src/Database/Seeders/AuthorizableSetTypeSeeder.php +++ b/src/Database/Seeders/AuthorizableSetTypeSeeder.php @@ -18,19 +18,19 @@ public function run(): void $basicTypes = [ [ - 'name' => AuthorizableSetCollection::VIRTUAL_SET_TYPE, + 'name' => AuthorizableSetCollection::VIRTUAL_SET_TYPE, 'description' => 'Virtual set type attached automatically to every user.', ], [ - 'name' => 'roles', + 'name' => 'roles', 'description' => 'Authentication service roles', ], [ - 'name' => 'groups', + 'name' => 'groups', 'description' => 'Authentication service groups', ], [ - 'name' => 'id', + 'name' => 'id', 'description' => 'Authentication service ID', ], ]; diff --git a/src/Database/Seeders/AuthorizationRuleSeeder.php b/src/Database/Seeders/AuthorizationRuleSeeder.php index 547e9db..9ea8fed 100644 --- a/src/Database/Seeders/AuthorizationRuleSeeder.php +++ b/src/Database/Seeders/AuthorizationRuleSeeder.php @@ -26,9 +26,9 @@ public function run(): void $authorizationRule::query()->create([ 'authorizable_set_type_id' => 1, - 'authorizable_set_value' => $role, - 'authorizable_model_id' => $authorizableModel->id, - 'rules' => json_encode($rules, JSON_THROW_ON_ERROR), + 'authorizable_set_value' => $role, + 'authorizable_model_id' => $authorizableModel->id, + 'rules' => json_encode($rules, JSON_THROW_ON_ERROR), ]); } } diff --git a/tests/TestUser.php b/tests/TestUser.php index 491a197..f5fa9b7 100644 --- a/tests/TestUser.php +++ b/tests/TestUser.php @@ -13,7 +13,7 @@ class TestUser extends Authenticatable implements AuthorizationInterface public function getAuthorizableSets(): array { return [ - 'roles' => [ + 'roles' => [ 'role1', 'role2', ], diff --git a/tests/Unit/App/Collections/AuthorizableSetCollectionTest.php b/tests/Unit/App/Collections/AuthorizableSetCollectionTest.php index bbc5ab6..42046f7 100644 --- a/tests/Unit/App/Collections/AuthorizableSetCollectionTest.php +++ b/tests/Unit/App/Collections/AuthorizableSetCollectionTest.php @@ -97,23 +97,23 @@ public function transforms_output_to_authorization_rule_format() $expected = [ [ 'authorizable_set_type_id' => $roleType->id, - 'authorizable_set_value' => 'role1', - 'rules' => [], + 'authorizable_set_value' => 'role1', + 'rules' => [], ], [ 'authorizable_set_type_id' => $roleType->id, - 'authorizable_set_value' => 'role2', - 'rules' => [], + 'authorizable_set_value' => 'role2', + 'rules' => [], ], [ 'authorizable_set_type_id' => $groupType->id, - 'authorizable_set_value' => 'group1', - 'rules' => [], + 'authorizable_set_value' => 'group1', + 'rules' => [], ], [ 'authorizable_set_type_id' => $groupType->id, - 'authorizable_set_value' => 'group2', - 'rules' => [], + 'authorizable_set_value' => 'group2', + 'rules' => [], ], ]; diff --git a/tests/Unit/App/Models/AuthorizationRuleTest.php b/tests/Unit/App/Models/AuthorizationRuleTest.php index 7f1f4bc..1697de1 100644 --- a/tests/Unit/App/Models/AuthorizationRuleTest.php +++ b/tests/Unit/App/Models/AuthorizationRuleTest.php @@ -74,9 +74,9 @@ public function resolves_existing_rule_if_it_matches_user_defined_roles() $this->authorizationRule::factory()->create([ 'authorizable_set_type_id' => $roleType->id, - 'authorizable_set_value' => 'role1', - 'authorizable_model_id' => $model->id, - 'rules' => json_encode([ + 'authorizable_set_value' => 'role1', + 'authorizable_model_id' => $model->id, + 'rules' => json_encode([ 'read' => '*', ]), ]); @@ -101,18 +101,18 @@ public function resolves_multiple_existing_rules_if_it_matches_user_defined_role $this->authorizationRule::factory()->create([ 'authorizable_set_type_id' => $roleType->id, - 'authorizable_set_value' => 'role1', - 'authorizable_model_id' => $model->id, - 'rules' => json_encode([ + 'authorizable_set_value' => 'role1', + 'authorizable_model_id' => $model->id, + 'rules' => json_encode([ 'read' => '*', ]), ]); $this->authorizationRule::factory()->create([ 'authorizable_set_type_id' => $roleType->id, - 'authorizable_set_value' => 'role2', - 'authorizable_model_id' => $model->id, - 'rules' => json_encode([ + 'authorizable_set_value' => 'role2', + 'authorizable_model_id' => $model->id, + 'rules' => json_encode([ 'write' => '*', ]), ]); @@ -131,8 +131,8 @@ public function formats_data_for_writing_to_cache() { $expected = [ 'authorizable_set_type_id' => 1, - 'authorizable_set_value' => 'role1', - 'rules' => [ + 'authorizable_set_value' => 'role1', + 'rules' => [ 'test' => 'test', ], ]; diff --git a/tests/Unit/Authorization/UserAuthorizableSetTest.php b/tests/Unit/Authorization/UserAuthorizableSetTest.php index f22cd61..f9f2d43 100644 --- a/tests/Unit/Authorization/UserAuthorizableSetTest.php +++ b/tests/Unit/Authorization/UserAuthorizableSetTest.php @@ -49,28 +49,28 @@ public function returns_prepared_rules() $expected = [ [ 'authorizable_set_type_id' => $roleType->id, - 'authorizable_set_value' => 'role1', - 'rules' => [], + 'authorizable_set_value' => 'role1', + 'rules' => [], ], [ 'authorizable_set_type_id' => $roleType->id, - 'authorizable_set_value' => 'role2', - 'rules' => [], + 'authorizable_set_value' => 'role2', + 'rules' => [], ], [ 'authorizable_set_type_id' => $groupType->id, - 'authorizable_set_value' => 'group1', - 'rules' => [], + 'authorizable_set_value' => 'group1', + 'rules' => [], ], [ 'authorizable_set_type_id' => $groupType->id, - 'authorizable_set_value' => 'group2', - 'rules' => [], + 'authorizable_set_value' => 'group2', + 'rules' => [], ], [ 'authorizable_set_type_id' => 3, - 'authorizable_set_value' => 'voice-all-mighty', - 'rules' => [], + 'authorizable_set_value' => 'voice-all-mighty', + 'rules' => [], ], ];