From f1041cd83d0aef911abd5d84533e308788a8516f Mon Sep 17 00:00:00 2001 From: chien Date: Tue, 26 Dec 2023 15:31:19 +0700 Subject: [PATCH] [IMP] auth_api_key_server_env: pre-commit auto fixes --- auth_api_key_server_env/README.rst | 31 ++++++++++--------- .../models/auth_api_key.py | 3 +- auth_api_key_server_env/pyproject.toml | 3 ++ .../readme/CONTRIBUTORS.md | 2 ++ .../readme/CONTRIBUTORS.rst | 2 -- .../{DESCRIPTION.rst => DESCRIPTION.md} | 13 ++++---- .../static/description/index.html | 11 ++++--- 7 files changed, 35 insertions(+), 30 deletions(-) create mode 100644 auth_api_key_server_env/pyproject.toml create mode 100644 auth_api_key_server_env/readme/CONTRIBUTORS.md delete mode 100644 auth_api_key_server_env/readme/CONTRIBUTORS.rst rename auth_api_key_server_env/readme/{DESCRIPTION.rst => DESCRIPTION.md} (52%) diff --git a/auth_api_key_server_env/README.rst b/auth_api_key_server_env/README.rst index 00d59120d9..f72e9764e9 100644 --- a/auth_api_key_server_env/README.rst +++ b/auth_api_key_server_env/README.rst @@ -17,13 +17,13 @@ Auth API key server environment :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github - :target: https://github.com/OCA/server-auth/tree/16.0/auth_api_key_server_env + :target: https://github.com/OCA/server-auth/tree/17.0/auth_api_key_server_env :alt: OCA/server-auth .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/server-auth-16-0/server-auth-16-0-auth_api_key_server_env + :target: https://translation.odoo-community.org/projects/server-auth-17-0/server-auth-17-0-auth_api_key_server_env :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-auth&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/server-auth&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -31,13 +31,14 @@ Auth API key server environment Configure api keys via server env. This can be very useful to avoid mixing your keys between your various -environments when restoring databases. All you have to do is to add a new -section to your configuration file according to the following convention: +environments when restoring databases. All you have to do is to add a +new section to your configuration file according to the following +convention: -.. code-block:: ini +.. code:: ini - [api_key_] - key=my_api_key + [api_key_] + key=my_api_key .. IMPORTANT:: This is an alpha version, the data model and design can change at any time without warning. @@ -55,7 +56,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. @@ -63,18 +64,18 @@ Credits ======= Authors -~~~~~~~ +------- * Camptocamp Contributors -~~~~~~~~~~~~ +------------ -* Simone Orsi -* Florian da Costa +- Simone Orsi +- Florian da Costa Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -86,6 +87,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-auth `_ project on GitHub. +This module is part of the `OCA/server-auth `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/auth_api_key_server_env/models/auth_api_key.py b/auth_api_key_server_env/models/auth_api_key.py index 4e30d81011..64db93d4e8 100644 --- a/auth_api_key_server_env/models/auth_api_key.py +++ b/auth_api_key_server_env/models/auth_api_key.py @@ -8,7 +8,6 @@ class AuthApiKey(models.Model): - _name = "auth.api.key" _inherit = ["auth.api.key", "server.env.techname.mixin", "server.env.mixin"] @@ -20,7 +19,7 @@ def _server_env_section_name(self): 'api_key_{name}' """ self.ensure_one() - return "api_key_{}".format(getattr(self, self._server_env_section_name_field)) + return f"api_key_{getattr(self, self._server_env_section_name_field)}" @property def _server_env_fields(self): diff --git a/auth_api_key_server_env/pyproject.toml b/auth_api_key_server_env/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/auth_api_key_server_env/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/auth_api_key_server_env/readme/CONTRIBUTORS.md b/auth_api_key_server_env/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..ce82e0f8d5 --- /dev/null +++ b/auth_api_key_server_env/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Simone Orsi \<\> +- Florian da Costa \<\> diff --git a/auth_api_key_server_env/readme/CONTRIBUTORS.rst b/auth_api_key_server_env/readme/CONTRIBUTORS.rst deleted file mode 100644 index bf905a1e0d..0000000000 --- a/auth_api_key_server_env/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,2 +0,0 @@ -* Simone Orsi -* Florian da Costa diff --git a/auth_api_key_server_env/readme/DESCRIPTION.rst b/auth_api_key_server_env/readme/DESCRIPTION.md similarity index 52% rename from auth_api_key_server_env/readme/DESCRIPTION.rst rename to auth_api_key_server_env/readme/DESCRIPTION.md index a1f43f857e..fd3f7ddf12 100644 --- a/auth_api_key_server_env/readme/DESCRIPTION.rst +++ b/auth_api_key_server_env/readme/DESCRIPTION.md @@ -1,10 +1,11 @@ Configure api keys via server env. This can be very useful to avoid mixing your keys between your various -environments when restoring databases. All you have to do is to add a new -section to your configuration file according to the following convention: +environments when restoring databases. All you have to do is to add a +new section to your configuration file according to the following +convention: -.. code-block:: ini - - [api_key_] - key=my_api_key +``` ini +[api_key_] +key=my_api_key +``` diff --git a/auth_api_key_server_env/static/description/index.html b/auth_api_key_server_env/static/description/index.html index d3c23db379..99f50c64f7 100644 --- a/auth_api_key_server_env/static/description/index.html +++ b/auth_api_key_server_env/static/description/index.html @@ -369,11 +369,12 @@

Auth API key server environment

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:7b7d72b7fe47a8aad3083f27767d93c4b0d78764c3faf6304d8ad2756ba201bf !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Alpha License: LGPL-3 OCA/server-auth Translate me on Weblate Try me on Runboat

+

Alpha License: LGPL-3 OCA/server-auth Translate me on Weblate Try me on Runboat

Configure api keys via server env.

This can be very useful to avoid mixing your keys between your various -environments when restoring databases. All you have to do is to add a new -section to your configuration file according to the following convention:

+environments when restoring databases. All you have to do is to add a +new section to your configuration file according to the following +convention:

 [api_key_<record.tech_name>]
 key=my_api_key
@@ -401,7 +402,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.

@@ -426,7 +427,7 @@

Maintainers

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-auth project on GitHub.

+

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

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