Code Monkey home page Code Monkey logo

yii2-audit's People

Contributors

amaelftah avatar blizzke avatar cooltr1x avatar cornernote avatar eluhr avatar filipe1309 avatar gb96 avatar githubjeka avatar ilgiz-badamshin avatar karataserkan avatar krsch avatar lisps avatar lucianolima00 avatar marc7000 avatar marcoadasilvaa avatar matej-ch avatar mazurva avatar mghollander avatar nash-x9 avatar schmunk42 avatar thtmorais avatar thyseus avatar tobisanya avatar wjrovers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yii2-audit's Issues

improve error view

i made a view, but its quite lite... need to spend some time getting a really nice looking error view page, something like the error that displays on the page when YII_DEBUG=true

track isAjax

track $request->getIsAjax() to the audit_entry table

Create clean set of migrations?

With all the huge data changes and compatibility breaks we did, we might want to consider starting over with a nice clean set of migration scripts. Per @cornernote's suggestion we should definitely keep the old scripts in a subdirectory and update them to end up with the database format that we use in (i assume) 0.2
The last "old" migration script should probably batch insert the names of the new set into the migrations table, so that users can seamlessly continue with the rest

module should have its own layout

I think the module should have it's own layout, and should only use the applications layout if it's provided as a configuration option to the module.

I really like how the yii2-debug module is laid out. Should we aim for something like that?

store audit_entry.audit_trail_count

in yii1 i used to also store the audit_trail_count in the audit_entry table... then i can delete all records with audit_trail_count=0 after a short period, but retain the data with trails for longer

Docs should be split

The README file is getting to large, we should split it in /docs/*.md for the specialised functionality and only keep the features/installation in the main doc.

suggestion to move data save out of application lifecycle

[24/06/2015 11:54:29 PM] antonio ramirez cobos: @brett how is the audit logs saved?
[24/06/2015 11:54:56 PM] antonio ramirez cobos: during request lifecycle?
[24/06/2015 11:55:18 PM] Brett O'Donnell: the trail (db changes) are saved using batchInsert on aftersave
[24/06/2015 11:55:40 PM] antonio ramirez cobos: so is saved synchronously during app execution right?
[24/06/2015 11:55:57 PM] Brett O'Donnell: the initial request data is saved when app starts, or when an audit_entry_id is needed (by trail or error)
[24/06/2015 11:56:14 PM] Brett O'Donnell: and the final data (aka motherload) is saved at the end of the request
[24/06/2015 11:56:27 PM] antonio ramirez cobos: then this extension is only good for small apps with not many requests. I highly recommend you to implement async (workers) for audit log data recording
[24/06/2015 11:56:32 PM] Brett O'Donnell: at the same time the yii2-debug module saves its data
[24/06/2015 11:56:48 PM] antonio ramirez cobos: also... check Event Bus systems to do that...
[24/06/2015 11:57:19 PM] antonio ramirez cobos: i do not say the extension is bad... i am saying the extension is not fit for big apps with many requests
[24/06/2015 11:57:33 PM] Brett O'Donnell: can you define many ?
[24/06/2015 11:57:57 PM] antonio ramirez cobos: 10,000 requests per second?
[24/06/2015 11:58:09 PM] Brett O'Donnell: yeah, thats many
[24/06/2015 11:58:38 PM] antonio ramirez cobos: we worked with audit trail and we worked with that in an application that serves that amount of request. is useless.
[24/06/2015 11:58:45 PM] antonio ramirez cobos: but
[24/06/2015 11:58:57 PM] antonio ramirez cobos: adding the async behavior to it... thats a different story
[24/06/2015 11:59:12 PM] Brett O'Donnell: how do you do that ?
[24/06/2015 11:59:28 PM] Brett O'Donnell: like call gearman or similar to do the writes ?
[24/06/2015 11:59:35 PM] antonio ramirez cobos: ZeroMQ, Rabbit, or workers
[12:01:35 AM] antonio ramirez cobos: have a look at this: https://github.com/beberlei/litecqrs-php
implements Event Bus system based on DDD + CQRS. I believe that can be also done with it. CQRS actually works with Versioning, that is, an Entity can be saved in the database with version history in it. That way, if anything happens, you do not only can see what happens but also rollback on history on every action performed.
[12:02:02 AM] antonio ramirez cobos: is just to check and see how other systems work...
[12:02:51 AM] antonio ramirez cobos: or https://github.com/qandidate-labs/broadway
[12:04:23 AM] antonio ramirez cobos: the reason is that I believe that Audit Trail may work as a set of events that fired along the request lifecycle and providing the async functionality, which releases the app from audit logging storage process, would make your extensions a rock solid one.
[12:05:14 AM] antonio ramirez cobos: it can still work like it is right now... but big requests apps won't be able to use it and if they do, they will have to change it in the future.
[4:52:22 AM] antonio ramirez cobos: you define a server queue listener and send the jobs there right?
[4:53:55 AM] antonio ramirez cobos: looks fine
[4:53:59 AM] antonio ramirez cobos: https://github.com/chrisboulton/php-resque/blob/master/lib/Resque/Worker.php
[4:54:06 AM] antonio ramirez cobos: never tried though
[4:54:20 AM] Tobias Munk: yes
[4:54:34 AM] Tobias Munk: you can simply wrap a command in a job
[4:54:53 AM] Tobias Munk: and also start a worker by wrapping this into a command
[4:55:12 AM] Tobias Munk: with the former you can define, i.e. run the database import for articles
[4:55:20 AM] Tobias Munk: second one does the job
[4:55:36 AM] Tobias Munk: multiple workers, multiple queues
[4:56:03 AM] Tobias Munk: but very simple implementation, 11 records as "data-structure" after installation
[4:57:45 AM] antonio ramirez cobos: well... a good audit trail should use some kind of async process. you should have a look on that @brett

all extra data should have namespaced types

all panels should define a namespace that is used to prefix any stored data. The internal panels will use audit/panel-id. This allows people to add external panels for custom data.

Tracking support for cURL

Should we do tracking for cURL calls? How? (eg an Audit::curl()-function that you can pass a curl handle and that will activate verbose and fetching of headers and result?

documentation for creating a panel

Add some documentation that explains how to create a new panel.

Also, there is some docs on storing extra data, which I think is not very useful now because they cannot display it without a custom panel. Perhaps there should be a panel for extra-data so that its easy to whack data in without needing to create a panel.

Impossible to install from composer unless you use yii2 dev-master

composer require "bedezign/yii2-audit" "dev-master"

Problem 1
- Installation request for bedezign/yii2-audit dev-master -> satisfiable by bedezign/yii2-audit[dev-master].
- bedezign/yii2-audit dev-master requires yiisoft/yii2 dev-master -> no matching package found.

Minimum yii2 requirement should * or a specific version instead of dev-master unstable version

Screenshots

This issues will be used to add screenshots for the documentation.

add test suite

test suite to ensure everything is working, and keeps working

dont publish *Asset.php

we currently publish the whole web/assets folder, which contains some php classes... we should be publishing a folder with only the assets in it, not the classes.

update screenshots and features list

We have added a ton of great features thanks to extending yii2-debug, we should list them in the README.

Should also update the screenshots as the module looks a bit different now. NOTE when adding images don't add them to the repo. Instead, add them to an issue, and then just copy the link of the image. That way they are stored on S3 and don't blow out the repo size with binary image data.

cleanup trails

need to purge trails when cleaning up other audit data

audit_trail should always have an audit_id for grouping

Use case:

I want to not insert audit_entry rows, unless there is errors or trails. In the case of errors or trails they should be given an audit_id for grouping and logging purposes. This means the audit_trail.user_id field is no longer required.

The problem:

Some people want to use audit_trail stand-alone, without writing tons of data to the audit_entry and audit_data tables.

The solution:

The audit_entry table should be ultra light - no large data at all. #46 should take care of this. Once it's closed we can force an audit_entry to be created when trails or errors happen, eg:

In AuditingBehavior.php change this:

$entry = Auditing::current() ? Auditing::current()->getEntry() : null;

to this:

$entry = Yii::$app->auditing->getEntry(true);

remove AuditEntry.origin

remove field and all references to it

notes: its a feature that was not working, and has since been replaced by a new property redirect.

drop some fields from audit_entry

  • data is obsolete
  • memory is useless, all we care about is max_memory
  • start_time and end_time are only needed to calculate duration, don't need to store them

email errors

the yii1 module had a command to email any errors to the developer.

This was very useful and both developers and clients loved it.

Consider the following:

  1. An employee does an action that results in an error/exception
  2. Developer gets alert via email
  3. Developer can click a link to see entire audit data relating to the error
  4. Developer fixes bug
  5. Developer contacts client and tells them the bug is fixed BEFORE the client reports it.
  6. Client believes developer is super awesome at his job.

Support for tracking SOAP?

Should we add support for tracking SOAP calls, and if so, how would we handle custom SoapClient wrappers?

Correctly handle too long urls?

Sometimes its needed to use very long urls and the fields for storing them are not long enough. Very strict configured database will refuse to insert records while the non-strict ones just truncate the data. This should be handled by the module itself before attempting to insert.

For the regular URL there is no data loss given that the request is logged separately, but what about referrer and redirect?

wrong variable name in Auditing.php

Hi Guys,

in bedezign\yii2-audit\Auditing.php line (126) you checking variable

$this->maxAuditAge !== null

but it should be

$this->maxAge !== null

unless i am wrong.

summary in entry view

each panel can display its own summary (eg a count) that is displayed on the tab in the entry view page

How to see the data

Sorry to bother you but I do not understand if I'm missing something.
The module is installed and it works, I see the data in the db.

First problem
I didn't understand how to call the RequestController via browser.
Do I need to move it to my controller directory or it is possible to call it like directly?

Second problem
Looking to the controller code and related views I saw that overview view is missing

data cleanup should be a command

At the moment cleanup is (optionally) run on 1/100 page requests.

This could be moved out of the request lifecycle and moved into a command so that it can be run via cron in the background.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.