Skip to content

Commit adcb8cc

Browse files
evansimsNyholmSteve Hobbs
authored
[SDK-2630] Merge 8.x development branch into default branch (#517)
* [SDK-2473] Adopt coding standards, use strict typing, type hinting, typed properties, standardize argument and method naming scheme, simplify field filtering and pagination interfaces. (#496) * tests: Remove obsolete phpcs-compat.xml.dist file. * tests: Define new PSR-12-based code standards * chores: Use PEST and PHPInsights * tests: Update CircleCI configuration * tests: Apply coding standards checks to test suite. * chore: Apply new PSR-12 coding standards to library. * feat: Add new interface for configuring field filtering and pagination on Management API requests. * Update config.yml * tests: Remove integration tests. * Update composer.json * Update composer.json * Update composer.json * feat: Ensure objects are encoded as objects and not arrays during json_encode() * chore: Add additional validation checks on required API2 params, ensure consistency in argument names matching API documentation. * docs: Updates to docblocks * chore: Ensure API2 method names are intuitive and are indicative of their related CRUD operations. * tests: Update tests with new method names. * chore: Identify nullable types * chore: Define CONST visibility * chore: Don't use underscores in variable names * chore: Superfluous elseif * chore: Optimizations to FilteredRequest array handling * chore: Optimizations * chore: Implement typed properties * chore: Test empty string using strlen() * Revert "chore: Test empty string using strlen()" This reverts commit d279f49. * docs: Remove @ package from docblocks, is automatically inferred from namespace * chore: Indicate nullable types on login() * [SDK-2472] Replace JWT dependency (#501) * [SDK-2471] Replace Guzzle dependency w/ PSR-18 + PSR-17 interfaces. (#504) * chore: Replace Guzzle dependency w/ PSR-17 and PSR-18 interfaces. Add new development dependencies. * tests: Update tests * feat: Simplify telemetry headers class * feat: Replace Guzzle w/ PSR-17 and PSR-18 interfaces. * feat: Remove EmptyStore; no longer necessary * feat: Introduce new shared SDK configuration structure. * feat: Introduce new exception classes for more specific error handling. * tests: Remove deprecated sniff under PHP 8.0 * tests: Remove additional sniff deprecated under PHP 8.0 * chore: Standards pass * docs: Docblock improvements * docs: Docblock updates * [SDK-2584] Implement new field filtering and pagination helper (#505) * [SDK-2587] Autopagination for Management SDK (#506) * feat: Introduce auto-pagination functionality for Management SDK. * tests: Address deprecation warning in PHP 7.4 tests * chore: Coding standards pass * chore: Cleanup unused variables * feat: Always pass SdkConfiguration by reference. * feat: Pass SdkConfiguration as first variable during Token class initialization. * chore: Standards pass * feat: Add additional pagination exception messages * feat: Add support for checkpoint-based pagination * Implement feedback from @adamjmcgrath * [SDK-2594] Add helper function for silently retrieving session state without invoking authentication flow (#508) * [SDK-2596] Enhance test suite with additional static code analysis and mutation testing (#509) * [8.x] Make SdkException an interface (#511) * Use PSR-6 cache from Symfony instead of PSR-16 (#512) * [8.x] Remove redirecrUri from "required" config (#514) * Remove redirecrUri from "required" config * Fix tests and address cases where RedirectUri is required Co-authored-by: Evan Sims <[email protected]> * [SDK-2597] Update README.md and UPGRADE.md for 8.x (#510) * feat: Introduce auto-pagination functionality for Management SDK. * tests: Address deprecation warning in PHP 7.4 tests * chore: Coding standards pass * chore: Cleanup unused variables * feat: Always pass SdkConfiguration by reference. * feat: Pass SdkConfiguration as first variable during Token class initialization. * chore: Standards pass * feat: Add additional pagination exception messages * feat: Add support for checkpoint-based pagination * Implement feedback from @adamjmcgrath * feat: Add a getState() helper for determining session state without throwing errors or initiating an auth flow * tests: Add phpstan, psalm and infection to test suite. * tests: Tweak CircleCI config * tests: Tweak CircleCI config * tests: Tweak CircleCI config * tests: Tweak CircleCI config * tests: Tweak CircleCI config * tests: Tweak CircleCI config * feat: Expand array filtering helper to other areas of SDK. * tests: Type hinting and test improvements * tests: Install posix and pcntl extensions on CircleCI builds * tests: Fix min code coverage allowance w/ Pest * tests: Increase test coverage * tests: Fix PHPStan warning on null states * docs: Fix docblock spacing * docs: Update UPGRADE.md with new 8.x details * docs: Updates to UPGRADE.md * docs: Updates to UPGRADE.md * docs: Updates to UPGRADE.md * docs: Updates to UPGRADE.md * docs: Updates to UPGRADE.md * docs: Updates to UPGRADE.md * docs: Updates to UPGRADE.md * docs: Updates to UPGRADE.md * tests: Fix test * Delete UPGRADING.md * docs: Updates to UPGRADE.md * tests: Fix test class names for PSR-4 autoloading * docs: Updates to UPGRADE.md * docs: Updates to UPGRADE.md * docs: Updates to UPGRADE.md * docs: Updates to UPGRADE.md * feat: Add Auth0::signup() convenience method for NULE users. * docs: Updates to UPGRADE.md * docs: Updates to UPGRADE.md * docs: Grammar improvements * docs: Update README.md * docs: Updates to README.md * docs: Updates to README.md * docs: Updates to README.md * docs: Updates to README.md * docs: Updates to README.md * docs: Updates to README.md * docs: Updates to README.md * docs: Updates to README.md * docs: Updates to README.md * docs: Updates to README.md * docs: Updates to README.md * docs: Updates to README.md * docs: Updates to README.md * docs: Updates to README.md * docs: Updates to README.md * docs: Updates to README.md * feat: Addressing minor bugs brought up during security review * Update README.md Co-authored-by: Steve Hobbs <[email protected]> * Update README.md Co-authored-by: Steve Hobbs <[email protected]> * Update UPGRADE.md Co-authored-by: Steve Hobbs <[email protected]> * Implement feedback from @stevehobbsdev and fix test errors * Test fixes * Test fixes * docs: Update UPGRADE.md with feedback from @stevehobbsdev * Remove debug code * docs: Update README.md and UPGRADE.md * Accommodate changes in newly merged PRs * Improvements to cookie handling, validations, cookies now default session handler * tests: Fix phpstan test under php 7.4 * tests: Fix phpstan warning for 8.0 * docs: Updates to README and UPGRADE Co-authored-by: Steve Hobbs <[email protected]> * HTTP verbs should always be upper case (#515) * chore: Update PHPInsights to ^2.0 from ^1.14 || dev-master (PHP 8.0 compatibility) * fix: redirect_uri should be passable via params argument. (Thanks @Nyholm) * tests: Fix for process timeouts due to Mutation testing * tests: Improvements to tests * chore: Remove unnecessary dependencies * fix: Fixes for removal of getRedirectUri config requirement. * feat: Add pushVariable() magic method for pushing to array config variables. * feat: Store access token scopes in session for convenience. * feat: Add PSR-14 event handling for http calls (to allow manipulating headers, etc.) * fix: Ensure accessTokenScope is cleared when session is cleared. * Ensure httpplug is included as a dependency * Ensure fluent interface is applied across Auth0 base class * Documment magic methods pushScope, pushAudience and pushOrganization * Allow state to be overwritten * Add deleteAll() convenience method for session storage classes * Move 'composer run tests' into docker * fix: Cookie deletion * Tweak docblock * docs: Update Docblock * ext-hash is always enabled in PHP 7.4+ * Remove CyclomaticComplexityIsHigh from warnings * feat: Decouple transient storage from Token and Authentication classes to ensure statelessness * feat: Ensure a nonce is generated from login() method * fix: Don't allow empty changes to be pushed to array values in SdkConfiguration * feat: Add $redirectUrl argument to login() and signup() methods to simplify params. * fix: Fix for azp mismatch error when multiple audiences are configured * docs: Updates to README and UPGRADE * chore: Update composer.json * tests: Fix phpstan warning for in_array() parameters * tests: CircleCI fix? Co-authored-by: Tobias Nyholm <[email protected]> Co-authored-by: Steve Hobbs <[email protected]>
1 parent 7a58886 commit adcb8cc

File tree

183 files changed

+15357
-16995
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+15357
-16995
lines changed

.circleci/config.yml

Lines changed: 67 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,27 @@ commands:
44
prepare:
55
steps:
66
- checkout
7-
- run: sudo composer self-update
7+
- run:
8+
name: Perform composer self-update
9+
command: sudo composer self-update
810
- restore_cache:
911
keys:
1012
- composer-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "composer.json" }}
1113
- composer-v1-{{ .Environment.CIRCLE_JOB }}
12-
- run: composer install -n --prefer-dist
13-
- run: composer update --prefer-dist --no-interaction
14+
- run:
15+
name: Enable code coverage
16+
command: |
17+
sudo pecl install pcov
18+
sudo docker-php-ext-enable pcov
19+
sudo rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
20+
sudo docker-php-ext-install posix
21+
sudo docker-php-ext-install pcntl
22+
- run:
23+
name: Install composer dependencies
24+
command: composer install -n --prefer-dist
25+
- run:
26+
name: Update composer dependencies
27+
command: composer update --prefer-dist --no-interaction
1428
- persist_to_workspace:
1529
root: .
1630
paths:
@@ -20,48 +34,66 @@ commands:
2034
key: composer-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "composer.json" }}
2135
paths:
2236
- vendor
23-
run-static-analysis:
37+
38+
run-phpinsights:
2439
steps:
25-
- run: composer static-analysis
26-
run-unit-tests:
40+
- run:
41+
name: Run PHP Insights code quality analysis
42+
command: php ./vendor/bin/phpinsights -v --no-interaction --min-quality=90 --min-complexity=50 --min-architecture=90 --min-style=90
43+
44+
run-phpstan:
2745
steps:
28-
- run: composer test-unit-ci
29-
- store_artifacts:
30-
path: build/coverage.xml
31-
run-integration-tests:
46+
- run:
47+
name: Run PHPStan static code analysis
48+
command: php ./vendor/bin/phpstan analyse --ansi --memory-limit 512M
49+
50+
run-psalm:
3251
steps:
33-
- run: composer test-integration-ci
34-
- store_artifacts:
35-
path: build/coverage.xml
52+
- run:
53+
name: Run Psalm static code analysis
54+
command: php ./vendor/bin/psalm --threads=4
3655

37-
jobs:
38-
php_7_3:
39-
docker:
40-
- image: circleci/php:7.3
56+
run-pest:
4157
steps:
42-
- prepare
43-
- run-static-analysis
44-
- run-unit-tests
58+
- run:
59+
name: Run Pest unit tests
60+
command: php ./vendor/bin/pest --stop-on-failure --min=80 --coverage-xml=build/coverage/coverage-xml --log-junit=build/coverage/junit.xml
61+
- persist_to_workspace:
62+
root: .
63+
paths:
64+
- build
65+
66+
run-infection:
67+
steps:
68+
- attach_workspace:
69+
at: .
70+
- run:
71+
name: Run Infection mutation tests
72+
command: php ./vendor/bin/infection --skip-initial-tests --threads=4 --test-framework=pest --coverage=build/coverage --no-progress --min-msi=48 --min-covered-msi=70
73+
74+
jobs:
4575
php_7_4:
4676
docker:
4777
- image: circleci/php:7.4
4878
steps:
4979
- prepare
50-
- run-static-analysis
51-
- run-unit-tests
80+
- run-phpinsights
81+
- run-phpstan
82+
- run-psalm
83+
- run-pest
84+
- run-infection
85+
5286
php_8_0:
5387
docker:
5488
- image: circleci/php:8.0
5589
steps:
5690
- prepare
57-
- run-static-analysis
58-
- run-unit-tests
59-
php_7_integration_tests:
60-
docker:
61-
- image: circleci/php:7.3
62-
steps:
63-
- prepare
64-
- run-integration-tests
91+
- run-phpinsights
92+
- run-phpstan
93+
- run-psalm
94+
- run-pest
95+
- run-infection
96+
6597
snyk:
6698
docker:
6799
- image: snyk/snyk-cli:composer
@@ -78,23 +110,19 @@ jobs:
78110
when: always
79111

80112
workflows:
81-
build-and-test:
113+
test-php-versions:
82114
jobs:
83-
- php_7_3
84115
- php_7_4
85116
- php_8_0
86-
integration-tests:
117+
118+
vulnerability-check:
87119
jobs:
88-
- php_7_integration_tests:
89-
filters:
90-
branches:
91-
only:
92-
- master
120+
- php_7_4
93121
- snyk:
94122
filters:
95123
branches:
96124
only:
97125
- master
98126
context: snyk-env
99127
requires:
100-
- php_7_integration_tests
128+
- php_7_4

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
9+
# We use 4 space indentation for PHP
10+
[*.php]
11+
indent_style = space
12+
indent_size = 4

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ vendor
99
.phpcs.xml
1010
phpcs.xml
1111
.phpunit.result.cache
12+
.DS_Store
13+
infection.log
14+
infection.mutators.md

.phpcs-compat.xml.dist

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)