Commit graph libervia-backend/src/memory/memory.py
Author SHA1 Message Date
Goffi
fad4200be3 core (memory): asyncCreateProfile fix: a fake session is created to set general password param 2015-11-27 16:52:14 +01:00
Goffi
1bf3950ce6 core (memory): profile is checked in startSession (an error is raised if it doesn't exist) 2015-11-27 16:50:29 +01:00
Goffi
3d8d66fa43 core (memory): stopSession implementation 2015-11-27 16:48:41 +01:00
Goffi
939b6ba80b core (memory): catch exceptions.UnknownEntityError in getMainResource 2015-11-26 17:00:18 +01:00
Goffi
95ad000f62 core (disco): disco hashes are now stored in database to avoid doing the same disco request on next load 2015-11-25 21:41:15 +01:00
Goffi
9c4ec1595c plugin XEP-0054: fixed vcard-update callback which was updating avatar when hash was empty, resulting in a really slow start 2015-11-25 20:01:39 +01:00
souliane
3fa1ea0376 memory: fixes asyncCreateProfile to not overwrite the personal key 2015-11-23 18:51:15 +01:00
Goffi
182f192703 core, bridge: added a profileSetDefault method 2015-11-14 19:18:10 +01:00
Goffi
e0a28858a8 core: profile session starting and connection are now separated. Moved profile session starting/authentication to memory module 2015-11-14 19:18:10 +01:00
Goffi
ce4e717ea8 core, bridge (params): added asyncGetParamsValuesFromCategory (yes that's a long name!) method to retrive params names and values for a given category 2015-11-14 19:18:10 +01:00
Goffi
bfd143b1e4 bridge, core(params): removed obsolete methods:
- getParams and getParamsForCategory are removed from bridge: XMLUI is now used in place of the old params XML
    - getParamsForCategory has also been removed internaly, as it is now unused, getParams is still used to construct the XMLUI
2015-11-14 19:18:07 +01:00
Goffi
76e571e18b plugin ip, params: plugin IP discovery, first draft:
- a dedicated plugin now manage IP discovery, for now it uses external website, but it should implement XEP-0279 soon
    - a permission is requested to user for calling an external website. Once the permission is granted (it's global), it is not asked anymore.
    - the ip is discovered on demand, and cache is kept for the session.
    - memory.params.getParamA has a new parameter use_default, which allow to get None when a parameter is not set, instead of the default value.
        This allow to detected when we need to do the first permission request. memory.getParamA don't have this parameter.
2015-09-29 17:54:22 +02:00
Goffi
74d91860ad core (memory, params): minor docstrings updates 2015-09-25 19:19:12 +02:00
Goffi
4623af2784 core (memory): fixed a double timer.cancel in Sessions 2015-08-18 10:36:41 +02:00
Goffi
0f10526746 core: getProfileName no raise ProfileUnknownError + minor doc fixes 2015-08-16 00:41:58 +02:00
Goffi
0a22619026 core (memory): Sessions fixes:
- avoid memory leak with forgotten _purgeSession in case of conflict: an exception is now raised instead
    - _purgeSession now cancel the timer if it was not done before
    - KeyError in profileGet is now explicitly raised throught a failure.Failure
    - use iterator to iterate session in ProfileSessions
2015-08-15 22:13:27 +02:00
souliane
67ff77e5de massive (preventive) addition of 'u' (unicode) before the strings passed to logging functions 2015-04-16 14:57:57 +02:00
Goffi
fbec02d396 2015 copyright dates update 2015-03-30 10:26:26 +02:00
souliane
3bff0d0237 memory, plugin XEP-0045: getMainResource returns None when asking a MUC entity + fixes /whois on a MUC (bare) entity 2015-03-25 15:28:02 +01:00
Goffi
2900e815c4 core: if we are in dev version and it's possible, repository data are now checked and added to SàT version 2015-03-19 19:47:01 +01:00
Goffi
cdfb2c4dc6 core (memory): updateEntityData now accept a "silent" argument to avoid sending signal to frontends when updating an attribute with "signalOnUpdate" flag. 2015-02-09 21:39:51 +01:00
Goffi
ec25ba82e1 core: added getEntitiesData which get cache data for several entities at once 2015-02-09 21:39:51 +01:00
Goffi
8ce5c1862b core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
/!\ not finished, everything is still instable !
    - bridge: DBus bridge has been modified to allow blocking call to be called in the same way as asynchronous calls
    - bridge: calls with a callback and no errback are now possible, default errback log the error
    - constants: removed hack to manage presence without OrderedDict, as an OrderedDict like class has been implemented in Libervia
    - core: getLastResource has been removed and replaced by getMainResource (there is a global better management of resources)
    - various style improvments: use of constants when possible, fixed variable overlaps, import of module instead of direct class import
    - frontends: printInfo and printMessage methods in (Quick)Chat are more generic (use of extra instead of timestamp)
    - frontends: bridge creation and option parsing (command line arguments) are now specified by the frontend in QuickApp __init__
    - frontends: ProfileManager manage a more complete plug sequence (some stuff formerly manage in contact_list have moved to ProfileManager)
    - quick_frontend (quick_widgets): QuickWidgetsManager is now iterable (all widgets are then returned), or can return an iterator on a specific class (return all widgets of this class) with getWidgets
    - frontends: tools.jid can now be used in Pyjamas, with some care
    - frontends (XMLUI): profile is now managed
    - core (memory): big improvment on entities cache management (and specially resource management)
    - core (params/exceptions): added PermissionError
    - various fixes and improvments, check diff for more details
2015-01-24 01:00:29 +01:00
Goffi
05e5e1448b core: misc improvments:
- added some constants for message types and presence
    - removed profile authentification specific methods in favor of a more generic "validated" key
2014-12-10 18:36:11 +01:00
souliane
0da2c0228f memory: fixes issue in a test 2014-10-22 18:58:29 +02:00
souliane
92cb3c0503 memory: add method isContactConnected 2014-10-20 16:38:49 +02:00
souliane
e018212fb4 memory: temporary dirty hack to fix the personnal key issue after the auth session expired 2014-10-19 15:07:16 +02:00
souliane
2f6b8ae771 memory: don't save last resource in entity data for the MUC jids 2014-10-17 20:26:01 +02:00
Goffi
6b20989ecc core: better management of default value in getConfig 2014-10-07 17:12:41 +02:00
souliane
767f3d50dc bridge, memory: add "search" attribute to getHistory (filter the results with a unix globbing pattern) 2014-10-04 10:25:32 +02:00
souliane
4f339272b7 memory: add Parameter "Chat history limit" 2014-09-24 13:49:43 +02:00
souliane
4c61bf8fad memory: getHistory with limit=0 now returns an empty list, use limit=None to return all messages 2014-10-03 12:43:59 +02:00
souliane
1388ff8fac memory: session timeout won't be reset on each access if the Sessions() is called with resettable_timeout=False 2014-09-22 19:24:07 +02:00
souliane
ef7035a3ca memory: profileSessions.profileGetUnique was not resetting the timer 2014-09-22 18:42:54 +02:00
souliane
ccaa5412c5 memory: handle the case where an existing session ID is re-used for creating a new session 2014-09-22 20:26:40 +02:00
souliane
830b6d8ef6 memory: Sessions.newSession can be called with a forced session ID 2014-09-21 13:10:55 +02:00
Matteo Cypriani
71e29f5c44 misc: fixed some typos 2014-09-15 14:18:25 +02:00
souliane
e0f8d09bf2 memory (memory): delete profile session on profile deletion 2014-06-27 20:05:31 +02:00
souliane
94d36a7d3e memory: add helper methods encryptValue and decryptValue 2014-06-25 19:01:00 +02:00
souliane
76413b3679 memory, tools (config): move special config retrieval from memory to tools 2014-06-09 20:40:13 +02:00
souliane
90115df6f1 tools: add missing file src/tools/config.py 2014-05-23 10:03:33 +02:00
souliane
c68b147398 memory: auto-update configuration file with libervia's passphrase when migrating the database 2014-05-23 09:59:15 +02:00
souliane
0d28c03d27 core, memory, bridge: added profile password + password encryption:
/!\ This changeset updates the database version to 2 and modify the database content!

Description:
    - new parameter General / Password to store the profile password
    - profile password is initialized with XMPP password value, it is stored hashed
    - bridge methods asyncCreateProfile/asyncConnect takes a new argument "password" (default = "")
    - bridge method asyncConnect returns a boolean (True = connection already established, False = connection initiated)
    - profile password is checked before initializing the XMPP connection

    - new private individual parameter to store the personal encryption key of each profile
    - personal key is randomly generated and encrypted with the profile password
    - personal key is decrypted after profile authentification and stored in a Sessions instance
    - personal key is used to encrypt/decrypt other passwords when they need to be retrieved/modified

    - modifying the profile password re-encrypt the personal key
    - Memory.setParam now returns a Deferred (the bridge method "setParam" is unchanged)
    - Memory.asyncGetParamA eventually decrypts the password, Memory.getParamA would fail on a password parameter

TODO:
    - if profile authentication is OK but XMPP authentication is KO, prompt the user for another XMPP password
    - fix the method "registerNewAccount" (and move it to a plugin)
    - remove bridge method "connect", sole "asyncConnect" should be used
2014-05-07 16:02:23 +02:00
souliane
c9f4397000 memory: add class ProfileSessions based on Sessions 2014-05-10 17:37:32 +02:00
souliane
2e6420fb49 memory, jp: added jp commands to load/save parameters template 2014-05-04 18:43:54 +02:00
Goffi
ba103161d5 core (log): refactoring + twisted backend:
- configuration is now done with classes, so inheritance is possible
    - twisted backend now use twisted log methods
    - log not produced by SàT directly in twisted backend are captured by an observer (twistedObserver) and sent back to SàT logging chain, with the "twisted" logger.
    - \\default output use normal twistd output, except in debug mode where it add an stdout output in addition to the log file.
    - when log_colors = True, colors are enabled only where it's possible (tty out), when log_colors=force colors are always enabled.
    - fixed some bad log.xxx calls
2014-05-05 18:58:34 +02:00
souliane
4b8ba7a6f4 memory: fixes the method fixLocalDir for pid_dir and log_dir to use local_dir as default 2014-04-30 19:54:21 +02:00
Goffi
501bc92528 core: use of the new core.log module:
/!\ this is a massive refactoring and was largely automated, it probably did bring some bugs /!\
2014-04-19 19:19:19 +02:00
Goffi
56ed5f13a5 core(memory): fixed last resource 2014-03-28 19:11:00 +01:00
Goffi
95678d7967 core, plugin XEP-0115: discovery refactoring:
- hashing algorithm of XEP-0115 has been including in core
    - our own hash is still calculated by XEP-0115 and can be regenerated with XEP_0115.recalculateHash
    - old discovery methods have been removed. Now the following methods are used:
        - hasFeature: tell if a feature is available for an entity
        - getDiscoInfos: self explaining
        - getDiscoItems: self explaining
        - findServiceEntities: return all available items of an entity which given (category, type)
        - findFeaturesSet: search for a set of features in entity + entity's items
      all these methods are asynchronous, and manage cache automatically
    - XEP-0115 manage in a better way hashes, and now use a trigger for presence instead of monkey patch
    - new FeatureNotFound exception, when we want to do something which is not available
    - refactored client initialisation sequence, removed client.initialized Deferred
    - added constant APP_URL
    - test_plugin_xep_0033.py has been temporarly deactivated, the time to adapt it
    - lot of cleaning
2014-03-28 18:07:22 +01:00