From 1f2f2113950cb2d9e3d8ab4a11863fcc613fff4b Mon Sep 17 00:00:00 2001 From: AntonKhabiuk Date: Wed, 31 Jul 2024 17:09:53 +0300 Subject: [PATCH 1/7] CC-34100 Add Quicksight client adapter --- .editorconfig | 13 ++++ .gitattributes | 36 ++++++++++ .github/workflows/ci.yml | 52 ++++++++++++++ .gitignore | 36 ++++++++++ CHANGELOG.md | 3 + LICENSE | 40 +++++++++++ README.md | 15 ++++ codeception.yml | 14 ++++ composer.json | 39 ++++++++++ phpstan.neon | 2 + .../AmazonQuicksightConstants.php | 64 +++++++++++++++++ .../Transfer/amazon_quicksight.transfer.xml | 15 ++++ .../AmazonQuicksightConfig.php | 72 +++++++++++++++++++ .../AmazonQuicksightDependencyProvider.php | 52 ++++++++++++++ .../AmazonQuicksightBusinessFactory.php | 19 +++++ .../Business/AmazonQuicksightFacade.php | 19 +++++ .../AmazonQuicksightFacadeInterface.php | 12 ++++ .../AmazonQuicksightCommunicationFactory.php | 20 ++++++ ...QuicksightToAwsQuicksightClientAdapter.php | 47 ++++++++++++ ...icksightToAwsQuicksightClientInterface.php | 27 +++++++ .../AmazonQuicksightEntityManager.php | 17 +++++ ...AmazonQuicksightEntityManagerInterface.php | 12 ++++ .../AmazonQuicksightPersistenceFactory.php | 19 +++++ .../AmazonQuicksightRepository.php | 17 +++++ .../AmazonQuicksightRepositoryInterface.php | 12 ++++ .../Propel/AbstractSpyQuicksightUser.php | 14 ++++ .../Propel/AbstractSpyQuicksightUserQuery.php | 14 ++++ .../Schema/spy_amazon_quicksight.schema.xml | 28 ++++++++ .../Zed/AmazonQuicksight/codeception.yml | 12 ++++ tooling.yml | 4 ++ 30 files changed, 746 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 CHANGELOG.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 codeception.yml create mode 100644 composer.json create mode 100644 phpstan.neon create mode 100644 src/SprykerEco/Shared/AmazonQuicksight/AmazonQuicksightConstants.php create mode 100644 src/SprykerEco/Shared/AmazonQuicksight/Transfer/amazon_quicksight.transfer.xml create mode 100644 src/SprykerEco/Zed/AmazonQuicksight/AmazonQuicksightConfig.php create mode 100644 src/SprykerEco/Zed/AmazonQuicksight/AmazonQuicksightDependencyProvider.php create mode 100644 src/SprykerEco/Zed/AmazonQuicksight/Business/AmazonQuicksightBusinessFactory.php create mode 100644 src/SprykerEco/Zed/AmazonQuicksight/Business/AmazonQuicksightFacade.php create mode 100644 src/SprykerEco/Zed/AmazonQuicksight/Business/AmazonQuicksightFacadeInterface.php create mode 100644 src/SprykerEco/Zed/AmazonQuicksight/Communication/AmazonQuicksightCommunicationFactory.php create mode 100644 src/SprykerEco/Zed/AmazonQuicksight/Dependency/External/AmazonQuicksightToAwsQuicksightClientAdapter.php create mode 100644 src/SprykerEco/Zed/AmazonQuicksight/Dependency/External/AmazonQuicksightToAwsQuicksightClientInterface.php create mode 100644 src/SprykerEco/Zed/AmazonQuicksight/Persistence/AmazonQuicksightEntityManager.php create mode 100644 src/SprykerEco/Zed/AmazonQuicksight/Persistence/AmazonQuicksightEntityManagerInterface.php create mode 100644 src/SprykerEco/Zed/AmazonQuicksight/Persistence/AmazonQuicksightPersistenceFactory.php create mode 100644 src/SprykerEco/Zed/AmazonQuicksight/Persistence/AmazonQuicksightRepository.php create mode 100644 src/SprykerEco/Zed/AmazonQuicksight/Persistence/AmazonQuicksightRepositoryInterface.php create mode 100644 src/SprykerEco/Zed/AmazonQuicksight/Persistence/Propel/AbstractSpyQuicksightUser.php create mode 100644 src/SprykerEco/Zed/AmazonQuicksight/Persistence/Propel/AbstractSpyQuicksightUserQuery.php create mode 100644 src/SprykerEco/Zed/AmazonQuicksight/Persistence/Propel/Schema/spy_amazon_quicksight.schema.xml create mode 100644 tests/SprykerEcoTest/Zed/AmazonQuicksight/codeception.yml create mode 100644 tooling.yml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a11af76 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +; This file is for unifying the coding style for different editors and IDEs. +; More information at https://editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.bat] +end_of_line = crlf diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..51f3ea4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,36 @@ +# Define the line ending behavior of the different file extensions +# Set the default behavior, in case people don't have core.autocrlf set. +* text text=auto eol=lf + +*.php diff=php + +# Denote all files that are truly binary and should not be modified. +*.png binary +*.jpg binary +*.gif binary +*.jpeg binary +*.zip binary +*.phar binary +*.ttf binary +*.woff binary +*.woff2 binary +*.eot binary +*.ico binary +*.mo binary +*.pdf binary +*.xsd binary +*.exe binary + +# Remove files for archives generated using `git archive` +dependency.json export-ignore +phpstan.json export-ignore +phpstan.neon export-ignore +psalm-report.json export-ignore linguist-generated=true +tooling.yml export-ignore +.coveralls.yml export-ignore +.travis.yml export-ignore +.editorconfig export-ignore +.gitattributes export-ignore +.gitignore export-ignore +.github/ export-ignore +architecture-baseline.json export-ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e851193 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +name: CI + +on: + push: + branches: + - 'master' + pull_request: + workflow_dispatch: + +jobs: + validation: + name: Validation + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + extensions: mbstring, intl, bcmath + coverage: none + + - name: Composer Install + run: composer install --prefer-dist --no-interaction --profile + + - name: Run validation + run: composer validate + + - name: Syntax check + run: find ./src -path src -prune -o -type f -name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" ) + + lowest: + name: Prefer Lowest + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + extensions: mbstring, intl, bcmath + coverage: none + + - name: Composer Install + run: composer install --prefer-dist --no-interaction --profile + + - name: Composer Update + run: composer update --prefer-lowest --prefer-dist --no-interaction --profile -vvv diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..58b3e11 --- /dev/null +++ b/.gitignore @@ -0,0 +1,36 @@ +# IDE +.idea/ +.project/ +nbproject/ +.buildpath/ +.settings/ +*.sublime-* + +# OS +.DS_Store +*.AppleDouble +*.AppleDB +*.AppleDesktop + +# grunt stuff +.grunt +.sass-cache +/node_modules/ + +# tooling +vendor/ +composer.lock +.phpunit.result.cache + +# built client resources +src/*/Zed/*/Static/Public +src/*/Zed/*/Static/Assets/sprite + +# Propel classes +src/*/Zed/*/Persistence/Propel/Base/* +src/*/Zed/*/Persistence/Propel/Map/* + +# tests +tests/**/_generated/ +tests/_output/* +!tests/_output/.gitkeep diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..740e64b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +# AmazonQuicksight Changelog + +[Release Changelog](https://github.com/spryker-eco/amazon-quicksight/releases) diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d376fd6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,40 @@ +SPRYKER SYSTEMS GMBH EVALUATION LICENSE AGREEMENT + +SPRYKER SYSTEMS GMBH, REGISTERED WITH THE COMMERCIAL REGISTER OF THE LOWER COURT OF HAMBURG UNDER HRB 134310 +(“WE” OR ”SPRYKER”)GRANTS YOU (THE “LICENSEE”) THE RIGHT TO USE THE SOFTWARE (AS DEFINED BELOW) +UNDER THE PROVISIONS OF THIS EVALUATION LICENSE AGREEMENT (THE “AGREEMENT”). + +The “Software” includes any software owned and distributed by Spryker under this Agreement. The Software +contains elements of open source components, to which different license terms apply respectively. +These open source components are needed to be installed separately. + +Spryker grants to Licensee, during the 45-calendar-day period (the “Evaluation Period”) following the download of the Software, +the nontransferable, nonexclusive limited, free of charge license to permit Licensee’s employees to internally use the Software +to test and evaluate the Software in connection with potentially purchasing non-evaluation licenses to the Software. + +Licensee shall not (i) use the Software to set up a productive live system, for development purposes or any other purposes apart +from evaluating the Software; (ii) copy any part of the Software except to make one copy for back-up purposes; (iii) distribute, +disclose, market, rent, lease, or transfer the Software or act as a service bureau with respect to the Software; (iv) export the +Software or install it in multiple locations; (v) disclose any confidential information provided by Spryker; (vi) modify or make +derivative works of the Software; or (vii) allow others to make or obtain copies of the Software. + +THE SOFTWARE IS PROVIDED “AS-IS” AND WITHOUT WARRANTY OF ANY KIND. SPRYKER DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, TITLE, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. SPRYKER WILL NOT +BE LIABLE FOR ANY DAMAGES ASSOCIATED WITH THE SOFTWARE, INCLUDING WITHOUT LIMITATION ORDINARY, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL +DAMAGES OF ANY KIND, INCLUDING BUT NOT LIMITED TO DAMAGES RELATING TO LOST DATA OR LOST PROFITS, EVEN IF SPRYKER HAS BEEN ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES. + +Licensee's license to use the Software shall terminate on the earlier of (i) the expiration of the Evaluation Period, or (ii) the date +both parties enter into a definitive agreement for the provision by Spryker to Licensee of a non-evaluation license to the Software. +Upon termination of the license as provided above, Licensee shall promptly destroy the Software and any back-up copy of the Software +made during the Evaluation Period if Spryker and the Licensee have not agreed a non-evaluation license to the Software. + +This Agreement shall be governed by the laws of Germany to the exclusion of IPR (International Law) and the United Nations Convention +on Contracts for the International Sale of Goods (CISG). The parties consent to the jurisdiction of the courts in Berlin (Germany). + +This Agreement is not assignable or transferable by Licensee and any attempt to do so is null and void. + +This Agreement constitutes the entire agreement between the parties concerning Licensee’s use of the Software. This Agreement supersedes +any prior verbal understanding between the parties and any Licensee purchase order or other ordering document, regardless of whether such +document is received by Spryker before or after execution of this Agreement. This Agreement may be amended only in a writing signed by +an authorized officer of Spryker. diff --git a/README.md b/README.md new file mode 100644 index 0000000..7d6d933 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# AmazonQuicksight Module +[![Latest Stable Version](https://poser.pugx.org/spryker-eco/amazon-quicksight/v/stable.svg)](https://packagist.org/packages/spryker-eco/amazon-quicksight) +[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.1-8892BF.svg)](https://php.net/) + +AmazonQuicksight module allows the Spryker project to connect to the Amazon QuickSight service. + +## Installation + +``` +composer require spryker-eco/amazon-quicksight +``` + +## Documentation + +[Spryker Documentation](https://docs.spryker.com) diff --git a/codeception.yml b/codeception.yml new file mode 100644 index 0000000..3b8fdfc --- /dev/null +++ b/codeception.yml @@ -0,0 +1,14 @@ +namespace: AmazonQuicksight +include: + - tests/SprykerEcoTest/Zed/AmazonQuicksight +paths: + tests: tests/ + output: tests/_output/ + data: tests/_data/ + support: tests/_support/ + envs: tests/_envs/ +settings: + suite_class: \PHPUnit\Framework\TestSuite + colors: true + memory_limit: 1024M + log: true diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..c9ad966 --- /dev/null +++ b/composer.json @@ -0,0 +1,39 @@ +{ + "name": "spryker-eco/amazon-quicksight", + "type": "library", + "description": "AmazonQuicksight module", + "license": "proprietary", + "require": { + "aws/aws-sdk-php": "^3.90.0", + "php": ">=8.1", + "spryker/kernel": "^3.30.0" + }, + "require-dev": { + "spryker/code-sniffer": "*", + "spryker/testify": "*" + }, + "autoload": { + "psr-4": { + "SprykerEco\\": "src/SprykerEco/" + } + }, + "autoload-dev": { + "psr-4": { + "SprykerEcoTest\\": "tests/SprykerEcoTest/" + } + }, + "minimum-stability": "dev", + "prefer-stable": true, + "scripts": { + "cs-check": "../../bin/phpcs -p -s --standard=vendor/spryker/code-sniffer/SprykerStrict/ruleset.xml src/ tests/", + "cs-fix": "../../bin/phpcbf -p --standard=vendor/spryker/code-sniffer/SprykerStrict/ruleset.xml src/ tests/" + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "config": { + "sort-packages": true + } +} diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..b5f0745 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,2 @@ +parameters: + level: 8 diff --git a/src/SprykerEco/Shared/AmazonQuicksight/AmazonQuicksightConstants.php b/src/SprykerEco/Shared/AmazonQuicksight/AmazonQuicksightConstants.php new file mode 100644 index 0000000..2b60d88 --- /dev/null +++ b/src/SprykerEco/Shared/AmazonQuicksight/AmazonQuicksightConstants.php @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + diff --git a/src/SprykerEco/Zed/AmazonQuicksight/AmazonQuicksightConfig.php b/src/SprykerEco/Zed/AmazonQuicksight/AmazonQuicksightConfig.php new file mode 100644 index 0000000..e6a3b05 --- /dev/null +++ b/src/SprykerEco/Zed/AmazonQuicksight/AmazonQuicksightConfig.php @@ -0,0 +1,72 @@ +get(AmazonQuicksightConstants::AWS_ACCOUNT_ID); + } + + /** + * Specification: + * - Returns the namespace for the Quicksight user registration. + * + * @api + * + * @return string + */ + public function getQuicksightUserRegisterNamespace(): string + { + return 'default'; + } + + /** + * Specification: + * - Provides configuration for the Quicksight client. + * + * @link https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-Aws.AwsClient.html#method___construct + * + * @api + * + * @return array + */ + public function getQuicksightClientConfiguration(): array + { + $quicksightClientConfiguration = [ + 'region' => $this->get(AmazonQuicksightConstants::AWS_REGION), + ]; + + $awsCredentialsKey = $this->get(AmazonQuicksightConstants::AWS_CREDENTIALS_KEY); + $awsCredentialsSecret = $this->get(AmazonQuicksightConstants::AWS_CREDENTIALS_SECRET); + $awsCredentialsToken = $this->get(AmazonQuicksightConstants::AWS_CREDENTIALS_TOKEN); + + if ($awsCredentialsKey && $awsCredentialsSecret && $awsCredentialsToken) { + $quicksightClientConfiguration['credentials'] = new Credentials( + $awsCredentialsKey, + $awsCredentialsSecret, + $awsCredentialsToken, + ); + } + + return $quicksightClientConfiguration; + } +} diff --git a/src/SprykerEco/Zed/AmazonQuicksight/AmazonQuicksightDependencyProvider.php b/src/SprykerEco/Zed/AmazonQuicksight/AmazonQuicksightDependencyProvider.php new file mode 100644 index 0000000..1f042bc --- /dev/null +++ b/src/SprykerEco/Zed/AmazonQuicksight/AmazonQuicksightDependencyProvider.php @@ -0,0 +1,52 @@ +addAwsQuicksightClient($container); + + return $container; + } + + /** + * @param \Spryker\Zed\Kernel\Container $container + * + * @return \Spryker\Zed\Kernel\Container + */ + protected function addAwsQuicksightClient(Container $container): Container + { + $container->set(static::AWS_QUICKSIGHT_CLIENT, function () { + return new AmazonQuicksightToAwsQuicksightClientAdapter( + $this->getConfig()->getQuicksightClientConfiguration(), + ); + }); + + return $container; + } +} diff --git a/src/SprykerEco/Zed/AmazonQuicksight/Business/AmazonQuicksightBusinessFactory.php b/src/SprykerEco/Zed/AmazonQuicksight/Business/AmazonQuicksightBusinessFactory.php new file mode 100644 index 0000000..7631358 --- /dev/null +++ b/src/SprykerEco/Zed/AmazonQuicksight/Business/AmazonQuicksightBusinessFactory.php @@ -0,0 +1,19 @@ + $args + */ + public function __construct(array $args) + { + $this->quicksightClient = new QuickSightClient($args); + } + + /** + * @param array $registerUserRequestData + * + * @return \Aws\ResultInterface + */ + public function registerUser(array $registerUserRequestData): ResultInterface + { + return $this->quicksightClient->registerUser($registerUserRequestData); + } + + /** + * @param array $generateEmbedUrlRequestData + * + * @return \Aws\ResultInterface + */ + public function generateEmbedUrlForRegisteredUser(array $generateEmbedUrlRequestData): ResultInterface + { + return $this->quicksightClient->generateEmbedUrlForRegisteredUser($generateEmbedUrlRequestData); + } +} diff --git a/src/SprykerEco/Zed/AmazonQuicksight/Dependency/External/AmazonQuicksightToAwsQuicksightClientInterface.php b/src/SprykerEco/Zed/AmazonQuicksight/Dependency/External/AmazonQuicksightToAwsQuicksightClientInterface.php new file mode 100644 index 0000000..9eb0dc5 --- /dev/null +++ b/src/SprykerEco/Zed/AmazonQuicksight/Dependency/External/AmazonQuicksightToAwsQuicksightClientInterface.php @@ -0,0 +1,27 @@ + $registerUserRequestData + * + * @return \Aws\ResultInterface + */ + public function registerUser(array $registerUserRequestData): ResultInterface; + + /** + * @param array $generateEmbedUrlRequestData + * + * @return \Aws\ResultInterface + */ + public function generateEmbedUrlForRegisteredUser(array $generateEmbedUrlRequestData): ResultInterface; +} diff --git a/src/SprykerEco/Zed/AmazonQuicksight/Persistence/AmazonQuicksightEntityManager.php b/src/SprykerEco/Zed/AmazonQuicksight/Persistence/AmazonQuicksightEntityManager.php new file mode 100644 index 0000000..ba5c187 --- /dev/null +++ b/src/SprykerEco/Zed/AmazonQuicksight/Persistence/AmazonQuicksightEntityManager.php @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
diff --git a/tests/SprykerEcoTest/Zed/AmazonQuicksight/codeception.yml b/tests/SprykerEcoTest/Zed/AmazonQuicksight/codeception.yml new file mode 100644 index 0000000..e3d070b --- /dev/null +++ b/tests/SprykerEcoTest/Zed/AmazonQuicksight/codeception.yml @@ -0,0 +1,12 @@ +namespace: SprykerEcoTest\Zed\AmazonQuicksight +paths: + tests: . + data: ../../../_data + support: _support + output: ../../../_output +coverage: + enabled: true + remote: false + whitelist: + include: + - '../../../../src/*' diff --git a/tooling.yml b/tooling.yml new file mode 100644 index 0000000..5849649 --- /dev/null +++ b/tooling.yml @@ -0,0 +1,4 @@ +architecture-sniffer: + priority: 2 +code-sniffer: + level: 2 From 0845e34215ab4d261abd4dea887085aada704bd7 Mon Sep 17 00:00:00 2001 From: AntonKhabiuk Date: Thu, 1 Aug 2024 10:42:52 +0300 Subject: [PATCH 2/7] CC-34100 Add allowed plugin --- composer.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c9ad966..eedb3cb 100644 --- a/composer.json +++ b/composer.json @@ -34,6 +34,9 @@ } }, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } } } From efddf3dcff192b46bbf78cdf0d903731be461f67 Mon Sep 17 00:00:00 2001 From: AntonKhabiuk Date: Thu, 1 Aug 2024 14:15:10 +0300 Subject: [PATCH 3/7] CC-34100 Fixes after CR --- .github/workflows/ci.yml | 9 +++++++++ .license | 4 ++++ architecture-baseline.json | 1 + composer.json | 4 +++- .../AmazonQuicksight/AmazonQuicksightConstants.php | 14 +++++++------- .../AmazonQuicksight/AmazonQuicksightConfig.php | 2 +- .../AmazonQuicksightDependencyProvider.php | 2 +- .../Business/AmazonQuicksightBusinessFactory.php | 2 +- .../Business/AmazonQuicksightFacade.php | 2 +- .../Business/AmazonQuicksightFacadeInterface.php | 2 +- .../AmazonQuicksightCommunicationFactory.php | 2 +- ...mazonQuicksightToAwsQuicksightClientAdapter.php | 2 +- ...zonQuicksightToAwsQuicksightClientInterface.php | 2 +- .../Persistence/AmazonQuicksightEntityManager.php | 2 +- .../AmazonQuicksightEntityManagerInterface.php | 2 +- .../AmazonQuicksightPersistenceFactory.php | 2 +- .../Persistence/AmazonQuicksightRepository.php | 2 +- .../AmazonQuicksightRepositoryInterface.php | 2 +- .../Propel/AbstractSpyQuicksightUser.php | 2 +- .../Propel/AbstractSpyQuicksightUserQuery.php | 2 +- 20 files changed, 39 insertions(+), 23 deletions(-) create mode 100644 .license create mode 100644 architecture-baseline.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e851193..99d049b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,15 @@ jobs: - name: Syntax check run: find ./src -path src -prune -o -type f -name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" ) + - name: Run CodeStyle checks + run: composer cs-check + + - name: PHPStan setup + run: composer stan-setup + + - name: Run PHPStan + run: composer stan + lowest: name: Prefer Lowest runs-on: ubuntu-latest diff --git a/.license b/.license new file mode 100644 index 0000000..cf29a25 --- /dev/null +++ b/.license @@ -0,0 +1,4 @@ +/** + * MIT License + * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. + */ diff --git a/architecture-baseline.json b/architecture-baseline.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/architecture-baseline.json @@ -0,0 +1 @@ +[] diff --git a/composer.json b/composer.json index eedb3cb..6e8b217 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,9 @@ "prefer-stable": true, "scripts": { "cs-check": "../../bin/phpcs -p -s --standard=vendor/spryker/code-sniffer/SprykerStrict/ruleset.xml src/ tests/", - "cs-fix": "../../bin/phpcbf -p --standard=vendor/spryker/code-sniffer/SprykerStrict/ruleset.xml src/ tests/" + "cs-fix": "../../bin/phpcbf -p --standard=vendor/spryker/code-sniffer/SprykerStrict/ruleset.xml src/ tests/", + "stan": "phpstan analyse -c phpstan.neon -l 6 src/", + "stan-setup": "cp composer.json composer.backup && COMPOSER_MEMORY_LIMIT=-1 composer require --dev phpstan/phpstan:^0.12 && mv composer.backup composer.json" }, "extra": { "branch-alias": { diff --git a/src/SprykerEco/Shared/AmazonQuicksight/AmazonQuicksightConstants.php b/src/SprykerEco/Shared/AmazonQuicksight/AmazonQuicksightConstants.php index 2b60d88..088f022 100644 --- a/src/SprykerEco/Shared/AmazonQuicksight/AmazonQuicksightConstants.php +++ b/src/SprykerEco/Shared/AmazonQuicksight/AmazonQuicksightConstants.php @@ -1,7 +1,7 @@ Date: Thu, 1 Aug 2024 15:25:11 +0300 Subject: [PATCH 4/7] CC-34100 Fix composer script --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 6e8b217..b26659a 100644 --- a/composer.json +++ b/composer.json @@ -25,8 +25,8 @@ "minimum-stability": "dev", "prefer-stable": true, "scripts": { - "cs-check": "../../bin/phpcs -p -s --standard=vendor/spryker/code-sniffer/SprykerStrict/ruleset.xml src/ tests/", - "cs-fix": "../../bin/phpcbf -p --standard=vendor/spryker/code-sniffer/SprykerStrict/ruleset.xml src/ tests/", + "cs-check": "phpcs -p -s --standard=vendor/spryker/code-sniffer/SprykerStrict/ruleset.xml src/ tests/", + "cs-fix": "phpcbf -p --standard=vendor/spryker/code-sniffer/SprykerStrict/ruleset.xml src/ tests/", "stan": "phpstan analyse -c phpstan.neon -l 6 src/", "stan-setup": "cp composer.json composer.backup && COMPOSER_MEMORY_LIMIT=-1 composer require --dev phpstan/phpstan:^0.12 && mv composer.backup composer.json" }, From 09587f9952275101239213a7355591579bae4f0a Mon Sep 17 00:00:00 2001 From: AntonKhabiuk Date: Thu, 1 Aug 2024 15:31:14 +0300 Subject: [PATCH 5/7] CC-34100 PHP Stan fixes --- phpstan.neon | 4 ++++ .../External/AmazonQuicksightToAwsQuicksightClientAdapter.php | 4 ++-- .../AmazonQuicksightToAwsQuicksightClientInterface.php | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index b5f0745..611b241 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,2 +1,6 @@ parameters: level: 8 + paths: + - src/ + ignoreErrors: + - '#Class Orm\\.+\\AmazonQuicksight\\.+ not found#' diff --git a/src/SprykerEco/Zed/AmazonQuicksight/Dependency/External/AmazonQuicksightToAwsQuicksightClientAdapter.php b/src/SprykerEco/Zed/AmazonQuicksight/Dependency/External/AmazonQuicksightToAwsQuicksightClientAdapter.php index a019f5c..767ee1b 100644 --- a/src/SprykerEco/Zed/AmazonQuicksight/Dependency/External/AmazonQuicksightToAwsQuicksightClientAdapter.php +++ b/src/SprykerEco/Zed/AmazonQuicksight/Dependency/External/AmazonQuicksightToAwsQuicksightClientAdapter.php @@ -28,7 +28,7 @@ public function __construct(array $args) /** * @param array $registerUserRequestData * - * @return \Aws\ResultInterface + * @return \Aws\ResultInterface */ public function registerUser(array $registerUserRequestData): ResultInterface { @@ -38,7 +38,7 @@ public function registerUser(array $registerUserRequestData): ResultInterface /** * @param array $generateEmbedUrlRequestData * - * @return \Aws\ResultInterface + * @return \Aws\ResultInterface */ public function generateEmbedUrlForRegisteredUser(array $generateEmbedUrlRequestData): ResultInterface { diff --git a/src/SprykerEco/Zed/AmazonQuicksight/Dependency/External/AmazonQuicksightToAwsQuicksightClientInterface.php b/src/SprykerEco/Zed/AmazonQuicksight/Dependency/External/AmazonQuicksightToAwsQuicksightClientInterface.php index 6bff65b..55d64b9 100644 --- a/src/SprykerEco/Zed/AmazonQuicksight/Dependency/External/AmazonQuicksightToAwsQuicksightClientInterface.php +++ b/src/SprykerEco/Zed/AmazonQuicksight/Dependency/External/AmazonQuicksightToAwsQuicksightClientInterface.php @@ -14,14 +14,14 @@ interface AmazonQuicksightToAwsQuicksightClientInterface /** * @param array $registerUserRequestData * - * @return \Aws\ResultInterface + * @return \Aws\ResultInterface */ public function registerUser(array $registerUserRequestData): ResultInterface; /** * @param array $generateEmbedUrlRequestData * - * @return \Aws\ResultInterface + * @return \Aws\ResultInterface */ public function generateEmbedUrlForRegisteredUser(array $generateEmbedUrlRequestData): ResultInterface; } From 629b49272f48f089d5ffb3add2a7bdf5225f9f4b Mon Sep 17 00:00:00 2001 From: AntonKhabiuk Date: Thu, 1 Aug 2024 15:33:06 +0300 Subject: [PATCH 6/7] CC-34100 PHP Stan fixes --- phpstan.neon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 611b241..3260382 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -2,5 +2,5 @@ parameters: level: 8 paths: - src/ - ignoreErrors: - - '#Class Orm\\.+\\AmazonQuicksight\\.+ not found#' + excludePaths: + - src/SprykerEco/Zed/AmazonQuicksight/Persistence/Propel/Abstract*.php From 4b816226022b8ec12f55f8cec2d030bbed029265 Mon Sep 17 00:00:00 2001 From: AntonKhabiuk Date: Thu, 1 Aug 2024 16:12:47 +0300 Subject: [PATCH 7/7] CC-34100 Fixes after CR --- composer.json | 3 ++- .../Zed/AmazonQuicksight/AmazonQuicksightConfig.php | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index b26659a..cd38031 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,8 @@ "require": { "aws/aws-sdk-php": "^3.90.0", "php": ">=8.1", - "spryker/kernel": "^3.30.0" + "spryker/kernel": "^3.30.0", + "spryker/user": "^3.0.0" }, "require-dev": { "spryker/code-sniffer": "*", diff --git a/src/SprykerEco/Zed/AmazonQuicksight/AmazonQuicksightConfig.php b/src/SprykerEco/Zed/AmazonQuicksight/AmazonQuicksightConfig.php index 78d7ab3..1e94c97 100644 --- a/src/SprykerEco/Zed/AmazonQuicksight/AmazonQuicksightConfig.php +++ b/src/SprykerEco/Zed/AmazonQuicksight/AmazonQuicksightConfig.php @@ -13,6 +13,11 @@ class AmazonQuicksightConfig extends AbstractBundleConfig { + /** + * @var string + */ + protected const QUICKSIGHT_USER_REGISTER_NAMESPACE = 'default'; + /** * Specification: * - Returns the ID for the AWS account that contains your Amazon QuickSight account. @@ -36,7 +41,7 @@ public function getAwsAccountId(): string */ public function getQuicksightUserRegisterNamespace(): string { - return 'default'; + return static::QUICKSIGHT_USER_REGISTER_NAMESPACE; } /**