Commit graph libervia-backend/src/core/exceptions.py
Author SHA1 Message Date
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
1eeddf5900 better PEP-8 compliance 2014-05-07 15:44:31 +02: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
souliane
d158589881 core, frontends: add method asyncDeleteProfile, remove synchronous methods createProfile and deleteProfile 2014-03-03 09:59:10 +01:00
Goffi
a280080563 core (sqlite): automatic database update:
- new Updater class check database consistency (by calculating a hash on the .schema), and updates base if necessary
    - database now has a version (1 for current, 0 will be for 0.3's database), for each change this version will be increased
    - creation statements and update statements are in the form of dict of dict with tuples. There is a help text at the top of the module to explain how it works
    - if we are on a development version, the updater try to update the database automaticaly (without deleting table or columns). The Updater.generateUpdateData method can be used to ease the creation of update data (i.e. the dictionary at the top, see the one for the key 1 for an example).
    - if there is an inconsistency, an exception is raised, and a message indicate the SQL statements that should fix the situation.
    - well... this is rather complicated, a KISS method would maybe have been better. The future will say if we need to simplify it :-/
    - new DatabaseError exception
2014-02-23 23:30:32 +01:00
Goffi
b6aaecc5c2 core, bridge: better GenericException handling 2013-12-17 00:56:39 +01:00
Goffi
f7efb167c8 plugin XEP-0050: Ad-Hoc commands first draft (answering part) 2013-12-10 17:25:31 +01:00
souliane
4c30dcf240 core: better handling of profile_key and don't write the param file anymore
- new error ProfileNotSetError and some methods use the default @NONE@ instead of @DEFAULT@
- do not output the .sat/param file anymore, it is not needed and created confusion
- plugin XEP-0054: remove an error message at startup
2013-09-05 21:03:52 +02:00
Goffi
923e755c49 plugin XEP-0055: implementation of Jabber Search 2013-09-08 18:05:19 +02:00
Goffi
8e2f394b5b core, bridge, jp, quick_frontend: SàT stop more gracefully if bridge can't be initialised:
- new BridgeInitError and BridgeExceptionNoService are in core.exceptions
    - D-Bus NotSupported is catched in bridge, and launch a BridgeInitError
    - BridgeInitError stop SàT core, jp, and quick_frontends with an explanation message.
fix bug 27
2013-06-21 02:00:37 +02:00
Goffi
1cd98e8dea fixed licences in docstrings (they are now in comments) 2013-03-08 00:36:22 +01:00
Emmanuel Gil Peyrot
37f7912520 Fix pep8 support in src/core. 2013-01-18 17:55:35 +01:00
Goffi
181d08f2e4 core, plugin XEP-0054: avatar upload:
- plugin XEP-0054: new setAvatar bridge method
    - new "presence_available" trigger
    - new DataError
2012-12-28 01:00:31 +01:00
Goffi
14d8e07d22 core: renamed badly named ConnectedProfileError 2012-12-16 18:02:43 +01:00
Goffi
fa38394401 core, frontends, bridgen plugins: fixed methods which were unproperly managing multi-profiles
- added profile argument to askConfirmation, actionResult, actionResultExt, entityDataUpdated, confirmationAnswer, getProgress
    - core, frontends: fixed calls/signals according to new bridge API
    - user of proper profile namespace for progression indicators and dialogs
    - memory: getParam* now return bool when param type is bool
    - memory: added getStringParam* to return string instead of typed value
    - core, memory, storage, quick_frontend: getHistory now manage properly multi-profiles
    - plugins XEP-0047, XEP-0054, XEP-0065, XEP-0077, XEP-0096; multi-profiles proper handling
2012-11-10 16:38:16 +01:00
Goffi
b44412ec0d core, quick_frontend, primitivus, wix: Contacts List refactoring phase 1:
- QuickContactManagement is not used anymore and will be removed, ContactList + Core are used instead
	- disconnected contacts are now displayed in Primitivus (M-d to show/hide them)
	- avatars are temporary unavailable in wix
	- new bridge method: getContactsFromGroup
2012-09-25 00:58:34 +02:00
Goffi
8e8e67f8f3 core: entity cache misc data management + error moved to core.exceptions in memory 2012-08-17 03:07:22 +02:00
Goffi
c5a930b627 Licence modification: the full project is now under AGPL v3+ instead of GPL v3+ 2012-08-01 22:53:02 +02:00
Goffi
52b00f6d6f core: exceptions moved to core
plugin group blog: group blog now manage public microblogs
2012-04-04 00:06:44 +02:00
Renamed from src/exceptions.py (Browse further)