Commit graph libervia-backend/src/memory/params.py
Author SHA1 Message Date
Goffi
f5f25e8ab5 misc: date update (yes it's a bit late :p ) 2017-11-03 14:31:42 +01:00
Goffi
52dce48694 core (params): removed registerNewAccount button: it is misplaced and more confusing than useful, may come back in the future 2017-03-09 00:06:09 +01:00
Goffi
97337202cb core, jp: component handling + client handling refactoring:
- SàT can now handle components
    - plugin have now a "modes" key in PLUGIN_INFO where they declare if they can be used with clients and or components. They default to be client only.
    - components are really similar to clients, but with some changes in behaviour:
        * component has "entry point", which is a special plugin with a componentStart method, which is called just after component is connected
        * trigger end with a different suffixes (e.g. profileConnected vs profileConnectedComponent), so a plugin which manage both clients and components can have different workflow
        * for clients, only triggers of plugins handling client mode are launched
        * for components, only triggers of plugins needed in dependencies are launched. They all must handle component mode.
        * component have a sendHistory attribute (False by default) which can be set to True to allow saving sent messages into history
        * for convenience, "client" is still used in method even if it can now be a component
        * a new "component" boolean attribute tells if we have a component or a client
        * components have to add themselve Message protocol
        * roster and presence protocols are not added for components
        * component default port is 5347 (which is Prosody's default port)
    - asyncCreateProfile has been renamed for profileCreate, both to follow new naming convention and to prepare the transition to fully asynchronous bridge
    - createProfile has a new "component" attribute. When used to create a component, it must be set to a component entry point
    - jp: added --component argument to profile/create
    - disconnect bridge method is now asynchronous, this way frontends can know when disconnection is finished
    - new PI_* constants for PLUGIN_INFO values (not used everywhere yet)
    - client/component connection workflow has been moved to their classes instead of being a host methods
    - host.messageSend is now client.sendMessage, and former client.sendMessage is now client.sendMessageData.
    - identities are now handled in client.identities list, so it can be updated dynamically by plugins (in the future, frontends should be able to update them too through bridge)
    - profileConnecting* profileConnected* profileDisconnected* and getHandler now all use client instead of profile
2017-02-12 17:55:43 +01:00
Goffi
6bbcbaf522 use of /usr/bin/env instead of /usr/bin/python in shebang 2016-04-17 14:45:26 +02:00
Goffi
046fb62a52 core (memory/params): fixed exception when setting an empty password 2016-03-26 18:43:54 +01:00
Goffi
d7bca38b31 core (params): return given profile for ProfileUnknownError 2016-01-25 17:03:45 +01:00
Goffi
348be27934 copyright update 2016-01-03 16:28:30 +01:00
souliane
4d3d6fb8b8 memory (params): fixes loading user value and building params XML for jids_list type 2015-12-15 17:43:36 +01:00
Goffi
0ecb55517d core (params): removed unused values 2015-12-15 16:25:37 +01:00
Goffi
77c3e83ec8 plugin extra_pep, params: fixed insecure building of jids_list 2015-12-15 16:25:19 +01:00
souliane
9e0b24a4a5 memory (params): parameter jids_list values are specified with <jid>...</jid> 2015-12-15 14:12:19 +01:00
souliane
a29630c3b6 memory (params): forbid to pass a value to a parameter of type "list" with <param value...> 2015-12-15 13:33:35 +01:00
Goffi
566de1dd33 core(params): replaced isConnected by isSessionStarted for profile update signal when a general param is modified 2015-11-26 16:04:45 +01:00
Goffi
c58da8d413 profile (params): fixed password setting: if profile was not connected, set was silently ignored 2015-11-26 15:47:01 +01:00
Goffi
cb27db7cdf core: fixed getStringParamA 2015-11-23 17:50:23 +01:00
Goffi
66739d9dfc core (param), plugin file: set security_limit for acount changes, backend (dis)connection, and put a higher one for file send 2015-11-23 13:19:42 +01:00
Goffi
ad973c6a2c core: fixed launchAction:
- getClient now raise a NotFound error if client is not available
    - errors ConnectedProfileError, NotConnectedProfileError anf ProfileKeyUnknownError renamed for consistency (all profile error must prefixed by Profile)
    - launchAction fixed, the case where client is not available is handled
    - kept actions are actuall1y removed on launchAction
2015-11-18 11:06:24 +01:00
Goffi
5702b2a849 core (params): removed resource from default JabberID (example value), as it is best practive to have resource binded by server. Advanced used can force it if needed though. 2015-11-16 11:58:11 +01:00
Goffi
182f192703 core, bridge: added a profileSetDefault method 2015-11-14 19:18:10 +01:00
Goffi
736dbfa1b4 core (memory): fixed a case where getProfileName was returning an empty string instead of raising an errror 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
souliane
95c7e2b809 core (params): fixes jid_list to use node's default value when no user value is defined 2015-08-22 10:28:07 +02:00
Goffi
456ff0ab6c core (params): fixed exception on empty jids list 2015-08-25 20:20:53 +02:00
Goffi
135fba2de1 core, plugin watched: new plugin, show an alert when a watched entity goes online 2015-08-20 18:43:56 +02:00
Goffi
a39e66b598 core (params): jids_list type management 2015-08-20 18:35:27 +02:00
Goffi
0f10526746 core: getProfileName no raise ProfileUnknownError + minor doc fixes 2015-08-16 00:41:58 +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
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
1f602f33cb memory (params): set "Show empty groups" to True by default 2014-10-16 17:02:44 +02:00
souliane
136395eb6d memory (params): add parameters "Show offline contacts" and "Show empty groups" 2014-10-06 11:20:43 +02:00
souliane
9378e1306a memory (params): use more generic param attribute "constraint" instead of "min" and "max" 2014-10-06 11:18:37 +02:00
souliane
4f339272b7 memory: add Parameter "Chat history limit" 2014-09-24 13:49:43 +02:00
souliane
ac59d061f4 memory (params), tools (xml_tools), plugins, frontends: add "int" parameter type with "min" and "max" attributes 2014-10-03 12:27:43 +02:00
souliane
94d36a7d3e memory: add helper methods encryptValue and decryptValue 2014-06-25 19:01:00 +02:00
souliane
d4eff5b99c core, memory, plugins, stdui, frontends: look for DNS SRV records when server is not specified:
- fix bug 3
    - modify "Connection" params:
          - rename "Server" to "Force server" and "Port" to "Force port"
          - set the default value to empty string for both
2014-06-23 00:44:10 +02:00
souliane
5f2b90e163 memory (params), test: fixes updateParams bug 2014-06-03 17:10:12 +02:00
souliane
900047c921 memory (params), test: fixes bug relative to parameter filtering 2014-06-03 15:10:51 +02:00
souliane
ae45889d50 plugins misc_account, misc_register_account: manually delete the sessions when not needed anymore 2014-05-21 23:17:51 +02:00
souliane
ea05b4e0d6 memory (params): fixes bugs in setParam:
- symbol 'd' was accessed without having been initialized when setting the empty value to a password which is not the profile password
    - the method was actually returning without waiting for the parameter to be set
2014-05-21 21:14:40 +02:00
souliane
8eddcc4ec9 memory (params): fix parameters of type "list" to use the default option when no individual value is set 2014-05-20 09:34:02 +02:00
souliane
dd597a2ead core, memory, bridge, plugin misc_register_account: move registerNewAccount to a new plugin:
- the bridge method has been removed, now a plugin takes care of it with XMLUI callback system
    - TODO: xmpp.RegisteringAuthenticator still needs to be fixed
2014-05-16 00:58:20 +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
Goffi
f0b2c7dea3 core: added a getReady method which can be called by frontends to ensure that backend is fully initialised before doing anything + this ckeck is automatically done in asyncConnect 2014-05-15 16:02:16 +02:00
souliane
1eeddf5900 better PEP-8 compliance 2014-05-07 15:44:31 +02:00
souliane
2e6420fb49 memory, jp: added jp commands to load/save parameters template 2014-05-04 18:43:54 +02:00