diff --git a/README.md b/README.md index abfa90f12b..bf78e4626a 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,8 @@ addon | version | maintainers | summary [password_security](password_security/) | 18.0.1.0.1 | | Allow admin to set password security requirements. [user_log_view](user_log_view/) | 18.0.1.0.0 | trojikman | Allow to see user's actions log [users_ldap_mail](users_ldap_mail/) | 18.0.1.0.0 | joao-p-marques | LDAP mapping for user name and e-mail -[vault](vault/) | 18.0.1.0.9 | | Password vault integration in Odoo -[vault_share](vault_share/) | 18.0.1.0.0 | | Implementation of a mechanism to share secrets +[vault](vault/) | 18.0.1.0.10 | | Password vault integration in Odoo +[vault_share](vault_share/) | 18.0.1.0.2 | | Implementation of a mechanism to share secrets [//]: # (end addons) diff --git a/vault/README.rst b/vault/README.rst index 3d493c0ab9..dcd95d16d9 100644 --- a/vault/README.rst +++ b/vault/README.rst @@ -11,7 +11,7 @@ Vault !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:62ba75fa0fe77bb78614b758628712b1d76b8326168bbaab921f2ecd72392ac9 + !! source digest: sha256:4c1e235277a22d56ad27351359792d02ea259f8824ebcd1fcfdbc9183e179c28 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/vault/__manifest__.py b/vault/__manifest__.py index 39d733aa29..976f64ef03 100644 --- a/vault/__manifest__.py +++ b/vault/__manifest__.py @@ -5,7 +5,7 @@ "name": "Vault", "summary": "Password vault integration in Odoo", "license": "AGPL-3", - "version": "18.0.1.0.9", + "version": "18.0.1.0.10", "website": "https://github.com/OCA/server-auth", "application": True, "author": "initOS GmbH, Odoo Community Association (OCA)", diff --git a/vault/i18n/es.po b/vault/i18n/es.po index 46100670ff..0b37db0d3d 100644 --- a/vault/i18n/es.po +++ b/vault/i18n/es.po @@ -1297,6 +1297,16 @@ msgstr "Versión" msgid "Warning" msgstr "Advertencia" +#. module: vault +#: model_terms:ir.ui.view,arch_db:vault.view_vault_entry_search +msgid "With Content" +msgstr "" + +#. module: vault +#: model_terms:ir.ui.view,arch_db:vault.view_vault_entry_search +msgid "Without Content" +msgstr "" + #. module: vault #: model:ir.model,name:vault.model_vault_store_wizard msgid "Wizard store a shared secret in a vault" diff --git a/vault/i18n/it.po b/vault/i18n/it.po index 101d0de1ad..f876b4a707 100644 --- a/vault/i18n/it.po +++ b/vault/i18n/it.po @@ -1298,6 +1298,16 @@ msgstr "Versione" msgid "Warning" msgstr "Attenzione" +#. module: vault +#: model_terms:ir.ui.view,arch_db:vault.view_vault_entry_search +msgid "With Content" +msgstr "" + +#. module: vault +#: model_terms:ir.ui.view,arch_db:vault.view_vault_entry_search +msgid "Without Content" +msgstr "" + #. module: vault #: model:ir.model,name:vault.model_vault_store_wizard msgid "Wizard store a shared secret in a vault" diff --git a/vault/i18n/nl.po b/vault/i18n/nl.po index 28ea71736d..281583fb7e 100644 --- a/vault/i18n/nl.po +++ b/vault/i18n/nl.po @@ -1283,6 +1283,16 @@ msgstr "Versie" msgid "Warning" msgstr "Waarschuwing" +#. module: vault +#: model_terms:ir.ui.view,arch_db:vault.view_vault_entry_search +msgid "With Content" +msgstr "" + +#. module: vault +#: model_terms:ir.ui.view,arch_db:vault.view_vault_entry_search +msgid "Without Content" +msgstr "" + #. module: vault #: model:ir.model,name:vault.model_vault_store_wizard msgid "Wizard store a shared secret in a vault" diff --git a/vault/i18n/vault.pot b/vault/i18n/vault.pot index e38594d619..58ba420a67 100644 --- a/vault/i18n/vault.pot +++ b/vault/i18n/vault.pot @@ -1279,6 +1279,16 @@ msgstr "" msgid "Warning" msgstr "" +#. module: vault +#: model_terms:ir.ui.view,arch_db:vault.view_vault_entry_search +msgid "With Content" +msgstr "" + +#. module: vault +#: model_terms:ir.ui.view,arch_db:vault.view_vault_entry_search +msgid "Without Content" +msgstr "" + #. module: vault #: model:ir.model,name:vault.model_vault_store_wizard msgid "Wizard store a shared secret in a vault" diff --git a/vault/static/description/index.html b/vault/static/description/index.html index 30637148db..f9829a0f5e 100644 --- a/vault/static/description/index.html +++ b/vault/static/description/index.html @@ -372,7 +372,7 @@

Vault

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:62ba75fa0fe77bb78614b758628712b1d76b8326168bbaab921f2ecd72392ac9 +!! source digest: sha256:4c1e235277a22d56ad27351359792d02ea259f8824ebcd1fcfdbc9183e179c28 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/server-auth Translate me on Weblate Try me on Runboat

This module implements a vault for secrets and files using diff --git a/vault/views/menuitems.xml b/vault/views/menuitems.xml index e1234153fb..cc05694426 100644 --- a/vault/views/menuitems.xml +++ b/vault/views/menuitems.xml @@ -10,7 +10,9 @@ All Entries vault.entry list,form - {'search_default_vault': 1} + {'search_default_vault': 1, 'search_default_with_content': 1} + + + [("vault_id", "=", active_id)] { "default_vault_id": active_id, - "searchpanel_default_vault_id": active_id} + "searchpanel_default_vault_id": active_id, + "search_default_with_content": 1} diff --git a/vault_share/README.rst b/vault_share/README.rst index 76c77bd011..d2a8321394 100644 --- a/vault_share/README.rst +++ b/vault_share/README.rst @@ -11,7 +11,7 @@ Vault - Share !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:de985f1f7b46fdf2880937e5d686d814a723b149913d09847320facdf9dc7a49 + !! source digest: sha256:cf5a42f160382ee63d76e136dca379f519787cd438eca581a1a9f13ddf74e45f !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/vault_share/__manifest__.py b/vault_share/__manifest__.py index 00c82bf82b..6fbd593bb3 100644 --- a/vault_share/__manifest__.py +++ b/vault_share/__manifest__.py @@ -5,7 +5,7 @@ "name": "Vault - Share", "summary": "Implementation of a mechanism to share secrets", "license": "AGPL-3", - "version": "18.0.1.0.0", + "version": "18.0.1.0.2", "website": "https://github.com/OCA/server-auth", "application": False, "author": "initOS GmbH, Odoo Community Association (OCA)", diff --git a/vault_share/controllers/main.py b/vault_share/controllers/main.py index 52eb94d1ef..c0a1ddcca2 100644 --- a/vault_share/controllers/main.py +++ b/vault_share/controllers/main.py @@ -10,7 +10,7 @@ class Controller(http.Controller): - @http.route("/vault/share/", type="http", auth="public") + @http.route("/vault/share/", type="http", auth="public", website=True) def vault_share(self, token): ctx = {"disable_footer": True, "token": token} share = request.env["vault.share"].sudo() diff --git a/vault_share/models/vault_share.py b/vault_share/models/vault_share.py index 3be86b6d36..3cf6aa37f7 100644 --- a/vault_share/models/vault_share.py +++ b/vault_share/models/vault_share.py @@ -22,7 +22,9 @@ class VaultShare(models.Model): store=False, help="Using this link and pin people can access the secret.", ) - token = fields.Char(readonly=True, required=True, default=lambda self: uuid4()) + token = fields.Char( + readonly=True, required=True, copy=False, default=lambda self: str(uuid4()) + ) secret = fields.Char() secret_file = fields.Char() filename = fields.Char() @@ -53,7 +55,9 @@ class VaultShare(models.Model): def _compute_url(self): base_url = self.env["ir.config_parameter"].sudo().get_param("web.base.url") for rec in self: - rec.share_link = f"{base_url}/vault/share/{rec.token}" + rec.share_link = ( + f"{base_url}/vault/share/{rec.token}" if rec.token else False + ) @api.model def get(self, token, ip=None): diff --git a/vault_share/static/description/index.html b/vault_share/static/description/index.html index 7546e8b0dc..6408ccf356 100644 --- a/vault_share/static/description/index.html +++ b/vault_share/static/description/index.html @@ -372,7 +372,7 @@

Vault - Share

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:de985f1f7b46fdf2880937e5d686d814a723b149913d09847320facdf9dc7a49 +!! source digest: sha256:cf5a42f160382ee63d76e136dca379f519787cd438eca581a1a9f13ddf74e45f !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/server-auth Translate me on Weblate Try me on Runboat

This module implements possibilities to share specific secrets with diff --git a/vault_share/tests/test_share.py b/vault_share/tests/test_share.py index ae4f1be628..069032e02a 100644 --- a/vault_share/tests/test_share.py +++ b/vault_share/tests/test_share.py @@ -32,6 +32,19 @@ def setUpClass(cls): cls.share = cls.env["vault.share"].create(cls.vals) + def test_token_generated_on_create(self): + # Fallback: a token is minted when none is supplied (e.g. code/RPC) + share = self.env["vault.share"].create(self.vals) + self.assertTrue(share.token) + self.assertIsInstance(share.token, str) + self.assertEqual(share, share.get(share.token)) + self.assertIn(share.token, share.share_link) + + # A supplied token is kept as-is (e.g. the client-generated one) + share = self.env["vault.share"].create({**self.vals, "token": "fixed-token"}) + self.assertEqual(share.token, "fixed-token") + self.assertEqual(share, share.get("fixed-token")) + @mute_logger("odoo.sql_db") def test_share(self): self.assertEqual(self.share, self.share.get(self.share.token)) diff --git a/vault_share/views/vault_share_views.xml b/vault_share/views/vault_share_views.xml index 6f03332da5..46762998b6 100644 --- a/vault_share/views/vault_share_views.xml +++ b/vault_share/views/vault_share_views.xml @@ -16,7 +16,6 @@

-