Skip to content

Commit

Permalink
Merge branch 'release/0.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Christensen Jacob authored and Christensen Jacob committed Sep 28, 2016
2 parents 527475c + 748f68c commit a775dc7
Show file tree
Hide file tree
Showing 28 changed files with 7,881 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
filter:
excluded_paths:
- 'vendor/*'
- 'app/*'
- 'web/*'
before_commands:
- 'composer install --dev'
application:
dependencies:
before:
- php app/console cache:warmup
tools:
external_code_coverage: true
php_mess_detector: true
php_pdepend: true
php_analyzer:
config:
metrics_coupling:
enabled: true
metrics_lack_of_cohesion_methods:
enabled: true
phpunit_checks:
enabled: true
doctrine_entity_manager_injection:
enabled: true
checkstyle:
enabled: true
php_code_sniffer:
config:
php_sim: true
php_cpd: false
38 changes: 38 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
language: php
sudo: false
before_script:
- free -m
- >
if [ "$PHPUNIT_SUITE" != "unit" ]; then
phpenv config-rm xdebug.ini
fi
- echo "memory_limit=2G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini;
- composer install --no-interaction --ignore-platform-reqs --no-scripts --profile
- >
if [ "$PHPUNIT" = "true" ]; then
wget https://scrutinizer-ci.com/ocular.phar
fi
php:
- 5.6
env:
matrix:
- COMPOSER_CHECK=true PHPUNIT=false
- COMPOSER_CHECK=false PHPUNIT=true PHPUNIT_SUITE=unit
matrix:
exclude:
- php: 5.6
env: COMPOSER_CHECK=true PHPUNIT=false
script:
if [ "$COMPOSER_CHECK" = "true" ]; then
composer check;
fi
notifications:
hipchat:
rooms:
secure: F5pTVtwBACRIXMdkQ/oE6f5faK3eHvPqDmD7jmAv4vU7Nyog4RN1h1nqa8kJo6fRaRvdbIF5ovAwfdX5nuoMBQqio4FpfpT4jkfFNf5gGEFOlGW3UTQR/8JyoVCEvZ4Wau3OsIouv1U3du9uWvaqHoxIeI9HvnTVinSzu9P4EjE=
on_success: change
on_failure: always

cache:
directories:
- vendor/
57 changes: 55 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,55 @@
# AuditTrackingBundle
Configurable auditing bundle, an easy way to keep record of users requests to Graviton
# GravitonAuditTrackingBundle

## Inner Auditing tool bundle
This tool is meant to run as a hidden service in order to know what each user request or modifies.
It will not limit nor interfere with the users request but only store the changes and data received.
* x-header-audit-thread → id-string-uuid
* Api to list thread: /auditing/?eq(thread,string:id-string-uuid)`

### version
* `v0.1.0`: 2016/09/28 First version with basic auditing enabled by default, collection changes.

#### Configuration
* Need Graviton ^v0.77.0, so ModelEvent is fired on Document Updates.
* Setup configuration in `AuditTracking/Resources/config/parameters.yml`.

```yml
parameters:
graviton_audit_tracking:
# General on/off switch
log_enabled: true
# Localhost and not Real User on/off switch
log_test_calls: false
# Store request log also on 400 error
log_on_failure: false
# Request methods to be saved, array PUT,POST,DELETE,PATCH...
requests: []
# Store full request header request data.
request_headers: false
# Store full request content body. if true full lenght, can be limited with a integer
request_content: false
# Store reponse basic information. if true full lenght, can be limited with a integer
response: false
# Store full response header request data.
response_headers: false
# Store response body content
response_content: false
# Store data base events, array of events, insert, update, delete
database: ['insert','update','delete']
# Store all exception
exceptions: false
# Exclude header status exceptions code, 400=bad request, form validation
exceptions_exclude: [400]
# Exclude listed URLS, array
exlude_urls: ["/auditing"]
```
### Testing in Graviton
* composer require graviton/graviton-service-bundle-audit-tracking
* Inside graviton load the bundle: GravitonBundleBundle:getBundles - add the load of this new bundle
* Enable in config the log_test_calls: true ( also, so you use the bundle in dev mode )
### Enabling in a Wrapper
* Enable in resources/configuration.sh the new bundle: `\\Graviton\\AuditTrackingBundle\\GravitonAuditTrackingBundle`
* composer require graviton/graviton-service-bundle-audit-tracking
* sh dev-cleanstart.sh
37 changes: 37 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "graviton/graviton-service-bundle-audit-tracking",
"license": "GPL",
"type": "project",
"description": "Audit tracking bundle to be used in graviton/graviton",
"authors": [
{
"name": "List of contributors",
"homepage": "https://github.com/libgraviton/graviton/graphs/contributors"
}
],
"require": {
"php": ">=5.6",
"graviton/graviton": ">=0.77.0"
},
"autoload": {
"psr-0": { "Graviton": "src/"}
},
"require-dev": {
"phpunit/phpunit": "~5.5",
"squizlabs/php_codesniffer": "~2.6",
"libgraviton/codesniffer": "~1.3"
},
"scripts": {
"check": [
"./vendor/bin/phpcs --config-set installed_paths vendor/libgraviton/codesniffer/CodeSniffer/Standards",
"./vendor/bin/phpcs --standard=PSR1 --ignore='*.css' --ignore='*.js' src/",
"./vendor/bin/phpcs --standard=PSR2 --ignore='*.css' --ignore='*.js' src/",
"./vendor/bin/phpcs --standard=ENTB --ignore='*.css' --ignore='*.js' src/"
]
},
"installer-paths": {
"vendor/composer_phpcs": ["libgraviton/codesniffer"]
},
"minimum-stability": "dev",
"prefer-stable": true
}
Loading

0 comments on commit a775dc7

Please sign in to comment.