diff --git a/data_encryption/README.rst b/data_encryption/README.rst index ece5da375..cc676279c 100644 --- a/data_encryption/README.rst +++ b/data_encryption/README.rst @@ -17,20 +17,20 @@ Encryption data :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github - :target: https://github.com/OCA/server-env/tree/16.0/data_encryption + :target: https://github.com/OCA/server-env/tree/17.0/data_encryption :alt: OCA/server-env .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/server-env-16-0/server-env-16-0-data_encryption + :target: https://translation.odoo-community.org/projects/server-env-17-0/server-env-17-0-data_encryption :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/server-env&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/server-env&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -This module allows to encrypt and decrypt data. This module is not usable -by itself, it is a low level module which should work as a base for others. -An example is the module server_environment_data_encryption +This module allows to encrypt and decrypt data. This module is not +usable by itself, it is a low level module which should work as a base +for others. An example is the module server_environment_data_encryption .. IMPORTANT:: This is an alpha version, the data model and design can change at any time without warning. @@ -47,34 +47,39 @@ Configuration To configure this module, you need to edit the main configuration file of your instance, and add a directive called ``running_env``. Commonly -used values are 'dev', 'test', 'production':: +used values are 'dev', 'test', 'production': - [options] - running_env=dev +:: + [options] + running_env=dev -You also need to set the encryption key(s). The main idea is to have different -encryption keys for your different environment, to avoid the possibility to retrieve -crucial information from the production environment in a developement environment, for instance. -So, if your running environment is 'dev':: +You also need to set the encryption key(s). The main idea is to have +different encryption keys for your different environment, to avoid the +possibility to retrieve crucial information from the production +environment in a developement environment, for instance. So, if your +running environment is 'dev': - [options] - encryption_key_dev=fyeMIx9XVPBBky5XZeLDxVc9dFKy7Uzas3AoyMarHPA= +:: -In the configuration file of your production environment, you may want to configure -all your other environments encryption key. This way, from production you can encrypt and decrypt -data for all environments. + [options] + encryption_key_dev=fyeMIx9XVPBBky5XZeLDxVc9dFKy7Uzas3AoyMarHPA= -You can generate keys with python -c 'from cryptography.fernet import Fernet; print(Fernet.generate_key())'. +In the configuration file of your production environment, you may want +to configure all your other environments encryption key. This way, from +production you can encrypt and decrypt data for all environments. + +You can generate keys with python -c 'from cryptography.fernet import +Fernet; print(Fernet.generate_key())'. Known issues / Roadmap ====================== -For now the encryption is dependent on the environment. It has been designed -to store the same kind of data with different values depending on the environement -(dev, preprod, prod...). -An improvement could be to split this in 2 modules. But the environment stuff -is not a big constraint. +For now the encryption is dependent on the environment. It has been +designed to store the same kind of data with different values depending +on the environement (dev, preprod, prod...). An improvement could be to +split this in 2 modules. But the environment stuff is not a big +constraint. Bug Tracker =========== @@ -82,7 +87,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -90,18 +95,18 @@ Credits ======= Authors -~~~~~~~ +------- * Akretion Contributors -~~~~~~~~~~~~ +------------ -* Raphaël Reverdy -* Florian da Costa +- Raphaël Reverdy +- Florian da Costa Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -113,6 +118,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/server-env `_ project on GitHub. +This module is part of the `OCA/server-env `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/data_encryption/pyproject.toml b/data_encryption/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/data_encryption/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/data_encryption/readme/CONFIGURE.md b/data_encryption/readme/CONFIGURE.md new file mode 100644 index 000000000..4b7323bba --- /dev/null +++ b/data_encryption/readme/CONFIGURE.md @@ -0,0 +1,22 @@ +To configure this module, you need to edit the main configuration file +of your instance, and add a directive called `running_env`. Commonly +used values are 'dev', 'test', 'production': + + [options] + running_env=dev + +You also need to set the encryption key(s). The main idea is to have +different encryption keys for your different environment, to avoid the +possibility to retrieve crucial information from the production +environment in a developement environment, for instance. So, if your +running environment is 'dev': + + [options] + encryption_key_dev=fyeMIx9XVPBBky5XZeLDxVc9dFKy7Uzas3AoyMarHPA= + +In the configuration file of your production environment, you may want +to configure all your other environments encryption key. This way, from +production you can encrypt and decrypt data for all environments. + +You can generate keys with python -c 'from cryptography.fernet import +Fernet; print(Fernet.generate_key())'. diff --git a/data_encryption/readme/CONFIGURE.rst b/data_encryption/readme/CONFIGURE.rst deleted file mode 100644 index c7f4131f1..000000000 --- a/data_encryption/readme/CONFIGURE.rst +++ /dev/null @@ -1,21 +0,0 @@ -To configure this module, you need to edit the main configuration file -of your instance, and add a directive called ``running_env``. Commonly -used values are 'dev', 'test', 'production':: - - [options] - running_env=dev - - -You also need to set the encryption key(s). The main idea is to have different -encryption keys for your different environment, to avoid the possibility to retrieve -crucial information from the production environment in a developement environment, for instance. -So, if your running environment is 'dev':: - - [options] - encryption_key_dev=fyeMIx9XVPBBky5XZeLDxVc9dFKy7Uzas3AoyMarHPA= - -In the configuration file of your production environment, you may want to configure -all your other environments encryption key. This way, from production you can encrypt and decrypt -data for all environments. - -You can generate keys with python -c 'from cryptography.fernet import Fernet; print(Fernet.generate_key())'. diff --git a/data_encryption/readme/CONTRIBUTORS.md b/data_encryption/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..7c8880894 --- /dev/null +++ b/data_encryption/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Raphaël Reverdy \<\> +- Florian da Costa \<\> diff --git a/data_encryption/readme/CONTRIBUTORS.rst b/data_encryption/readme/CONTRIBUTORS.rst deleted file mode 100644 index 3017ba278..000000000 --- a/data_encryption/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,2 +0,0 @@ -* Raphaël Reverdy -* Florian da Costa diff --git a/data_encryption/readme/DESCRIPTION.md b/data_encryption/readme/DESCRIPTION.md new file mode 100644 index 000000000..934050053 --- /dev/null +++ b/data_encryption/readme/DESCRIPTION.md @@ -0,0 +1,3 @@ +This module allows to encrypt and decrypt data. This module is not +usable by itself, it is a low level module which should work as a base +for others. An example is the module server_environment_data_encryption diff --git a/data_encryption/readme/DESCRIPTION.rst b/data_encryption/readme/DESCRIPTION.rst deleted file mode 100644 index 9c4dc1582..000000000 --- a/data_encryption/readme/DESCRIPTION.rst +++ /dev/null @@ -1,3 +0,0 @@ -This module allows to encrypt and decrypt data. This module is not usable -by itself, it is a low level module which should work as a base for others. -An example is the module server_environment_data_encryption diff --git a/data_encryption/readme/ROADMAP.md b/data_encryption/readme/ROADMAP.md new file mode 100644 index 000000000..e78b0ecdf --- /dev/null +++ b/data_encryption/readme/ROADMAP.md @@ -0,0 +1,5 @@ +For now the encryption is dependent on the environment. It has been +designed to store the same kind of data with different values depending +on the environement (dev, preprod, prod...). An improvement could be to +split this in 2 modules. But the environment stuff is not a big +constraint. diff --git a/data_encryption/readme/ROADMAP.rst b/data_encryption/readme/ROADMAP.rst deleted file mode 100644 index 71a6a1270..000000000 --- a/data_encryption/readme/ROADMAP.rst +++ /dev/null @@ -1,5 +0,0 @@ -For now the encryption is dependent on the environment. It has been designed -to store the same kind of data with different values depending on the environement -(dev, preprod, prod...). -An improvement could be to split this in 2 modules. But the environment stuff -is not a big constraint. diff --git a/data_encryption/static/description/index.html b/data_encryption/static/description/index.html index 4149cf0c7..fdb09d496 100644 --- a/data_encryption/static/description/index.html +++ b/data_encryption/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -369,10 +369,10 @@

Encryption data

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:2d4447d50c16329e068a3699d69972506a62f5d3235b59046149e6aa76151e0e !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Alpha License: AGPL-3 OCA/server-env Translate me on Weblate Try me on Runboat

-

This module allows to encrypt and decrypt data. This module is not usable -by itself, it is a low level module which should work as a base for others. -An example is the module server_environment_data_encryption

+

Alpha License: AGPL-3 OCA/server-env Translate me on Weblate Try me on Runboat

+

This module allows to encrypt and decrypt data. This module is not +usable by itself, it is a low level module which should work as a base +for others. An example is the module server_environment_data_encryption

Important

This is an alpha version, the data model and design can change at any time without warning. @@ -402,33 +402,35 @@

Configuration

[options] running_env=dev -

You also need to set the encryption key(s). The main idea is to have different -encryption keys for your different environment, to avoid the possibility to retrieve -crucial information from the production environment in a developement environment, for instance. -So, if your running environment is ‘dev’:

+

You also need to set the encryption key(s). The main idea is to have +different encryption keys for your different environment, to avoid the +possibility to retrieve crucial information from the production +environment in a developement environment, for instance. So, if your +running environment is ‘dev’:

 [options]
 encryption_key_dev=fyeMIx9XVPBBky5XZeLDxVc9dFKy7Uzas3AoyMarHPA=
 
-

In the configuration file of your production environment, you may want to configure -all your other environments encryption key. This way, from production you can encrypt and decrypt -data for all environments.

-

You can generate keys with python -c ‘from cryptography.fernet import Fernet; print(Fernet.generate_key())’.

+

In the configuration file of your production environment, you may want +to configure all your other environments encryption key. This way, from +production you can encrypt and decrypt data for all environments.

+

You can generate keys with python -c ‘from cryptography.fernet import +Fernet; print(Fernet.generate_key())’.

Known issues / Roadmap

-

For now the encryption is dependent on the environment. It has been designed -to store the same kind of data with different values depending on the environement -(dev, preprod, prod…). -An improvement could be to split this in 2 modules. But the environment stuff -is not a big constraint.

+

For now the encryption is dependent on the environment. It has been +designed to store the same kind of data with different values depending +on the environement (dev, preprod, prod…). An improvement could be to +split this in 2 modules. But the environment stuff is not a big +constraint.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -449,11 +451,13 @@

Contributors

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/server-env project on GitHub.

+

This module is part of the OCA/server-env project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/data_encryption/tests/common.py b/data_encryption/tests/common.py index a57377dac..82cf60f6b 100644 --- a/data_encryption/tests/common.py +++ b/data_encryption/tests/common.py @@ -29,7 +29,7 @@ def set_new_key_env(self, environment): # the key com from the config file and is not in a binary format. # So we decode here to avoid having a special behavior because of # the tests. - config["encryption_key_{}".format(environment)] = crypting_key.decode() + config[f"encryption_key_{environment}"] = crypting_key.decode() def tearDown(self): config["running_env"] = self.old_running_env diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..368c5c28f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +# generated from manifests external_dependencies +cryptography