Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACL Security Tests #93

Merged
merged 38 commits into from
Jul 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7624aa0
check for protobuf extension in tests first
prolic Jun 2, 2019
84a79fa
start implementing ACL security tests
prolic Jun 2, 2019
bb904f0
implemented ACL security tests
prolic Jun 2, 2019
efdefd2
finish tests all_stream_with_no_acl_security
prolic Jun 2, 2019
5dc6fe3
make AuthenticationTestCase abstract
prolic Jun 3, 2019
3070534
add tests/Security/authorized_default_credentials_security
prolic Jun 7, 2019
8573758
tests/Security/multiple_role_security
prolic Jun 7, 2019
dd05b31
reset acl after each test
prolic Jun 8, 2019
29c30c5
delete stream security tests
prolic Jun 16, 2019
dfb68b3
fix generator usage
prolic Jun 16, 2019
ef36c01
add doesNotPerformAssertions
prolic Jun 17, 2019
2943d38
finish tests/Security/delete_stream_security
prolic Jun 17, 2019
f27cff2
update to phpunit 8.2.2
prolic Jun 17, 2019
9cbf6b0
add missing return type
prolic Jun 17, 2019
8971cee
increase timeout to be able to work with slower travis builds
prolic Jun 17, 2019
90d5871
tests/Security/overriden_system_stream_security
prolic Jul 8, 2019
836a5df
update copyright
prolic Jul 8, 2019
244a3d9
use dev master of event store
prolic Jul 8, 2019
a5fda5a
php cs fixer
prolic Jul 8, 2019
4b4ceda
php cs fixer
prolic Jul 8, 2019
4d6d995
tests/Security/overriden_system_stream_security_for_all
prolic Jul 17, 2019
a7af742
tests/Security/overriden_user_stream_security
prolic Jul 17, 2019
053e90f
tests/Security/read_all_security
prolic Jul 17, 2019
8d1b1d7
tests/Security/read_stream_meta_security
prolic Jul 18, 2019
35383ec
tests/Security/read_stream_security
prolic Jul 18, 2019
20825a5
tests/Security/stream_security_inheritance
prolic Jul 18, 2019
4b44dbd
tests/Security/subscribe_to_all_security
prolic Jul 18, 2019
7a30b03
tests/Security/subscribe_to_stream_security
prolic Jul 18, 2019
23bc44a
use pcov, use evenstore 5.0.1
prolic Jul 19, 2019
4116731
use pcov, use evenstore 5.0.1 #2
prolic Jul 19, 2019
fa82ca2
back to xdebug
prolic Jul 19, 2019
0143e04
test ES 5.0.1
prolic Jul 19, 2019
fe256c1
test ES 5.0.1 #2
prolic Jul 19, 2019
c946a04
try pcov again
prolic Jul 19, 2019
bbc3478
tests/Security/system_stream_security
prolic Jul 19, 2019
c8d1968
tests/Security/write_stream_meta_security
prolic Jul 19, 2019
4921a2a
tests/Security/write_stream_security
prolic Jul 20, 2019
fbe0567
improve security test assertions
prolic Jul 20, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
nbproject
composer.lock
docs/html
.phpunit.result.cache
13 changes: 6 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ matrix:
- php: 7.3
env:
- DEPENDENCIES=""
- TEST_COVERAGE=true
- php: 7.3
env:
- DEPENDENCIES="--prefer-lowest --prefer-stable"
Expand All @@ -28,11 +27,11 @@ cache:
- $HOME/.local

before_script:
- echo downloading event-store 4.1.1-hotfix1
- wget https://eventstore.org/downloads/EventStore-OSS-Ubuntu-14.04-v4.1.1-hotfix1.tar.gz
- echo downloading EventStore 5.0.1
- wget https://eventstore.org/downloads/ubuntu/EventStore-OSS-Linux-Ubuntu-16.04-v5.0.1.tar.gz
- echo extracting event-store
- tar xf EventStore-OSS-Ubuntu-14.04-v4.1.1-hotfix1.tar.gz
- cd EventStore-OSS-Ubuntu-14.04-v4.1.1-hotfix1
- tar xf EventStore-OSS-Linux-Ubuntu-16.04-v5.0.1.tar.gz
- cd EventStore-OSS-Linux-Ubuntu-16.04-v5.0.1
- echo starting event-store
- ./run-node.sh --run-projections=all --mem-db --ext-tcp-heartbeat-interval 5000 --ext-tcp-heartbeat-timeout 1500 > /dev/null &
- cd ..
Expand All @@ -48,12 +47,12 @@ before_script:
- echo "extension = protobuf.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- mkdir -p "$HOME/.php-cs-fixer"
- if php --ri xdebug >/dev/null; then phpenv config-rm xdebug.ini; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then pecl install pcov; fi
- composer self-update
- composer update --prefer-dist $DEPENDENCIES
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then composer require prooph/php-cs-fixer-config ^0.3; fi

script:
- if [[ $TEST_COVERAGE == 'true' ]]; then php -dzend_extension=xdebug.so ./vendor/bin/phpunit --exclude-group=ignore --coverage-text --coverage-clover ./build/logs/clover.xml; else ./vendor/bin/phpunit --exclude-group=ignore; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then php ./vendor/bin/phpunit --exclude-group=ignore --coverage-text --coverage-clover ./build/logs/clover.xml; else ./vendor/bin/phpunit --exclude-group=ignore; fi
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/php-cs-fixer fix -v --diff --dry-run; fi

after_script:
Expand Down
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@
"amphp/byte-stream": "^1.6",
"amphp/file": "^0.3.5",
"amphp/socket": "^0.10.12",
"prooph/event-store": "^8.0.0-BETA-2",
"prooph/event-store": "dev-master",
"ramsey/uuid": "^3.8"
},
"require-dev": {
"amphp/log": "^1.0",
"phpspec/prophecy": "^1.7",
"phpunit/phpunit": "^7.5",
"phpspec/prophecy": "^1.7.2",
"phpunit/phpunit": "^8.2.2",
"doctrine/instantiator": "^1.1",
"sebastian/object-enumerator": "^3.0.3",
"php-coveralls/php-coveralls": "^2.1"
"php-coveralls/php-coveralls": "^2.1",
"prooph/php-cs-fixer-config": "^0.3"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion docker/local-1-node/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
command: tail -f /dev/null

eventstore:
image: eventstore/eventstore:release-4.1.0
image: eventstore/eventstore:release-5.0.1
ports:
- 2113:2113
- 1113:1113
Expand Down
6 changes: 3 additions & 3 deletions docker/local-3-node-cluster/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3"
services:

eventstore1:
image: eventstore/eventstore:release-4.1.0
image: eventstore/eventstore:release-5.0.1
env_file:
- common-variables.env
environment:
Expand All @@ -28,7 +28,7 @@ services:
ipv4_address: 172.16.0.11

eventstore2:
image: eventstore/eventstore:release-4.1.0
image: eventstore/eventstore:release-5.0.1
env_file:
- common-variables.env
environment:
Expand All @@ -53,7 +53,7 @@ services:
ipv4_address: 172.16.0.12

eventstore3:
image: eventstore/eventstore:release-4.1.0
image: eventstore/eventstore:release-5.0.1
env_file:
- common-variables.env
environment:
Expand Down
6 changes: 3 additions & 3 deletions docker/local-3-node-dns-cluster/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3"
services:

eventstore1:
image: eventstore/eventstore:release-4.1.0
image: eventstore/eventstore:release-5.0.1
env_file:
- common-variables.env
environment:
Expand All @@ -27,7 +27,7 @@ services:
- escluster.net

eventstore2:
image: eventstore/eventstore:release-4.1.0
image: eventstore/eventstore:release-5.0.1
env_file:
- common-variables.env
environment:
Expand All @@ -51,7 +51,7 @@ services:
- escluster.net

eventstore3:
image: eventstore/eventstore:release-4.1.0
image: eventstore/eventstore:release-5.0.1
env_file:
- common-variables.env
environment:
Expand Down
2 changes: 1 addition & 1 deletion docker/unittest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Run the following commands from repo root:

## Start eventstore container
## Start EventStore container

The eventstore container takes a few seconds to be ready. So start it upfront.

Expand Down
2 changes: 1 addition & 1 deletion docker/unittest/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- eventstore

eventstore:
image: eventstore/eventstore:release-4.1.0
image: eventstore/eventstore:release-5.0.1
ports:
- 2113:2113
- 1113:1113
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="vendor/autoload.php"
bootstrap="tests/_bootstrap.php"
failOnWarning="true"
failOnRisky="true"
>
Expand Down
2 changes: 2 additions & 0 deletions src/Internal/EventStoreNodeConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,8 @@ public function getRawStreamMetadataAsync(string $stream, ?UserCredentials $user
$readEventPromise->onResolve(function (?Throwable $e, $eventReadResult) use ($stream, $deferred) {
if ($e) {
$deferred->fail($e);

return;
}

\assert($eventReadResult instanceof EventReadResult);
Expand Down