Skip to content

Manage external accounts in Odoo: #622

@mourad-ehm

Description

@mourad-ehm

After reflection with the akretion team, we propose the following

Context :

Odoo is dealing to communicate with several external services (ie 3thd party APIs).
Credentials needs to be stored securely and accessible in a clearly defined manner.
Currently each module implement this feature differently : it's a bad practice, error prone and waste of time to reimplement it.
We propose a specification of a generic module to manage accounts.

## Solution proposed :

Features:

  • store account credentials
  • multiple account per provider
  • access restriction per society and/or per security group
  • store aditionnal data (config)
  • ensure data security by encrypting the identification data.

Design:

1 - store credential information in table with few columns (module_name, company_id, password, data). data will be stored in json and contain additionnal info ie {'login':'', 'key1': 'value1', 'key2': 'value2'},
2- encrypting key will be stored in config file. Potentially reduce damage if a database is leaked.
3- provide a method that allows to provides identification data (decrypting) (create a abstract object that can be inherited by business object ex stock.picking).
5 - restrict read/write by default to admin and a group "external account managers”.
6 - each consumer modules provides a dict for registration : a dict of expected info

** Example of table :**
| name | type | identifier | company_id | login | password | json data |

| Laposte | lapost | laposte_warehouse1 | 1 | 122732| ****** | {'customerId': 51221, 'agencyCode: 'paris0701'} |
| Laposte | lapost | laposte_warehouse2 | 2 | 122732| ****** | {'customerId': 53232, 'agencyCode: 'nice1323'} |
| Service aws | aws | s3_storage | 1 | 45877 | ****** | {'preferedRegion':'EU'} |

Management of multiple accounts by service provider :

In certain use case : for their shipping, the company can use the same authentification (login/password) with different customer number. For example customer number for parent company and an other customer number for subsidiary. Or customer number by white brand ext.
the sub-account use used for either statical or accounting reasons (ex: Invoice parent company and subsidiary separately)

** There 2 approaches to manage several accounts by service provider:**
1 – duplicate the account and modify only the json column (customernumber, my_other_param', ..)
2 - Split the table in to object account and account line :

  • Account contain fields Name, account type, Company, login, password
    *Account line contain : account_id, key, value (json)

Use Case:

  • carriers: ups, laposte, geodis
  • marketplace: ebay, amazon, magento, ...
  • ftp/sftp

Proposal for module name :

* credential_storage +
* keypass_manager +
* login_credential +              (translate fr: informations d'identification) 
* api_keychain

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions