Thread: [W3af-develop] About substitute for persist/reqResDBHandler...
Status: Beta
Brought to you by:
andresriancho
From: Taras <ta...@se...> - 2009-08-16 20:14:00
|
Hello, all! I want to say a few words about new core DB classes DB and HistoryItem. First [1] is substitute for persist class. Reasons: - need for more simple then existing one DB backend which is not depended on DB structure (data_table, raw_pickled_data and so on) - it must be simple wrapper over SQLite DBI with custom code for threading and useful methods like creating table - clean up code Second [2] is substitute for reqResDBHandler class. HistoryItem represents one record in HTTP log. It consist of at least request and response. Now it consist of also mark and info attributes. Mark is for bookmarks in History tab. Info attribute will hold info/vulnerability information. After plugins will be executed we will simple update existing history item and then will be colorized in table. Reasons: - Active Record pattern [0] => convenience of developing Code snippet: def logHttp( self, request, response): historyItem = HistoryItem() try: historyItem.request = request historyItem.response = response historyItem.save() ... - More powerful then existing [0] http://en.wikipedia.org/wiki/Active_record_pattern [1] https://w3af.svn.sourceforge.net/svnroot/w3af/branches/taras/core/data/db/db.py [2] https://w3af.svn.sourceforge.net/svnroot/w3af/branches/taras/core/data/db/history.py -- Taras ---- "Software is like sex: it's better when it's free." - Linus Torvalds |