You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
3.0 KiB

  1. .. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/lgpl.html
  3. :alt: License: LGPL-3
  4. ======================
  5. Base - External System
  6. ======================
  7. This module provides an interface/adapter mechanism for the definition of remote
  8. systems.
  9. Note that this module stores everything in plain text. In the interest of security,
  10. it is recommended you use another module (such as `keychain` or `red_october` to
  11. encrypt things like the password and private key). This is not done here in order
  12. to not force a specific security method.
  13. Implementation
  14. ==============
  15. The credentials for systems are stored in the ``external.system`` model, and are to
  16. be configured by the user. This model is the unified interface for the underlying
  17. adapters.
  18. Using the Interface
  19. -------------------
  20. Given an ``external.system`` singleton called ``external_system``, you would do the
  21. following to get the underlying system client:
  22. .. code-block:: python
  23. with external_system.client() as client:
  24. client.do_something()
  25. The client will be destroyed once the context has completed. Destruction takes place
  26. in the adapter's ``external_destroy_client`` method.
  27. The only unified aspect of this interface is the client connection itself. Other more
  28. opinionated interface/adapter mechanisms can be implemented in other modules, such as
  29. the file system interface in `OCA/server-tools/external_file_location
  30. <https://github.com/OCA/server-tools/tree/9.0/external_file_location>`_.
  31. Creating an Adapter
  32. -------------------
  33. Modules looking to add an external system adapter should inherit the
  34. ``external.system.adapter`` model and override the following methods:
  35. * ``external_get_client``: Returns a usable client for the system
  36. * ``external_destroy_client``: Destroy the connection, if applicable. Does not need
  37. to be defined if the connection destroys itself.
  38. Configuration
  39. =============
  40. Configure external systems in Settings => Technical => External Systems
  41. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  42. :alt: Try me on Runbot
  43. :target: https://runbot.odoo-community.org/runbot/149/10.0
  44. Bug Tracker
  45. ===========
  46. Bugs are tracked on `GitHub Issues
  47. <https://github.com/OCA/server-tools/issues>`_. In case of trouble, please
  48. check there if your issue has already been reported. If you spotted it first,
  49. help us smash it by providing detailed and welcomed feedback.
  50. Credits
  51. =======
  52. Images
  53. ------
  54. * Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
  55. Contributors
  56. ------------
  57. * Dave Lasley <dave@laslabs.com>
  58. Maintainer
  59. ----------
  60. .. image:: https://odoo-community.org/logo.png
  61. :alt: Odoo Community Association
  62. :target: https://odoo-community.org
  63. This module is maintained by the OCA.
  64. OCA, or the Odoo Community Association, is a nonprofit organization whose
  65. mission is to support the collaborative development of Odoo features and
  66. promote its widespread use.
  67. To contribute to this module, please visit https://odoo-community.org.