Skip to content

Commit 9a64666

Browse files
committed
Merge PR #873 into 19.0
Signed-off-by thomaspaulb
2 parents 6baf478 + 5a6cd9a commit 9a64666

24 files changed

Lines changed: 1436 additions & 0 deletions

auth_api_key/README.rst

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
5+
============
6+
Auth Api Key
7+
============
8+
9+
..
10+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11+
!! This file is generated by oca-gen-addon-readme !!
12+
!! changes will be overwritten. !!
13+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14+
!! source digest: sha256:78e3946b0dbb81bb6fbf6c434aaf5214faec00449a765c2f41e321b65024ba05
15+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16+
17+
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
18+
:target: https://odoo-community.org/page/development-status
19+
:alt: Production/Stable
20+
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
21+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
22+
:alt: License: LGPL-3
23+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github
24+
:target: https://github.com/OCA/server-auth/tree/19.0/auth_api_key
25+
:alt: OCA/server-auth
26+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27+
:target: https://translation.odoo-community.org/projects/server-auth-19-0/server-auth-19-0-auth_api_key
28+
:alt: Translate me on Weblate
29+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-auth&target_branch=19.0
31+
:alt: Try me on Runboat
32+
33+
|badge1| |badge2| |badge3| |badge4| |badge5|
34+
35+
Authenticate http requests from an API key.
36+
37+
API keys are codes passed in (in the http header API-KEY) by programs
38+
calling an API in order to identify -in this case- the calling program's
39+
user.
40+
41+
Take care while using this kind of mechanism since information into http
42+
headers are visible in clear. Thus, use it only to authenticate requests
43+
from known sources.
44+
45+
For unknown sources, it is a good practice to filter out this header at
46+
proxy level.
47+
48+
Odoo allows users to authenticate ``XMLRPC/JSONRPC`` calls using their
49+
API key instead of a password by native API keys (``res.users.apikey``).
50+
However, ``auth_api_key`` has some special features of its own such as:
51+
52+
- API keys remain usable even when the user is inactive, if enabled via
53+
settings (e.g., for system users in a shopinvader case).
54+
- Supports dual authentication via Basic Auth and API_KEY in separate
55+
HTTP headers.
56+
- Admins can manage API keys for all users
57+
58+
Given these advantages, particularly in use case like system user
59+
authentication, we have decided to keep the ``auth_api_key`` module
60+
61+
**Table of contents**
62+
63+
.. contents::
64+
:local:
65+
66+
Configuration
67+
=============
68+
69+
The api key menu is available into Settings > Technical in debug mode.
70+
By default, when you create an API key, the key is saved into the
71+
database.
72+
73+
If you want to manage them via serve environment settings use
74+
auth_api_key_server_env.
75+
76+
Usage
77+
=====
78+
79+
To apply this authentication system to your http request you must set
80+
'api_key' as value for the 'auth' parameter of your route definition
81+
into your controller.
82+
83+
.. code:: python
84+
85+
class MyController(Controller):
86+
87+
@route('/my_service', auth='api_key', ...)
88+
def my_service(self, *args, **kwargs):
89+
pass
90+
91+
Bug Tracker
92+
===========
93+
94+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-auth/issues>`_.
95+
In case of trouble, please check there if your issue has already been reported.
96+
If you spotted it first, help us to smash it by providing a detailed and welcomed
97+
`feedback <https://github.com/OCA/server-auth/issues/new?body=module:%20auth_api_key%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
98+
99+
Do not contact contributors directly about support or help with technical issues.
100+
101+
Credits
102+
=======
103+
104+
Authors
105+
-------
106+
107+
* ACSONE SA/NV
108+
109+
Contributors
110+
------------
111+
112+
- Denis Robinet <denis.robinet@acsone.eu>
113+
- Laurent Mignon <laurent.mignon@acsone.eu>
114+
- Quentin Groulard <quentin.groulard@acsone.eu>
115+
- Sébastien Beau <sebastien.beau@akretion.com>
116+
- Chafique Delli <chafique.delli@akretion.com>
117+
- Thien Vo Hong <thienvh@trobz.com>
118+
119+
Other credits
120+
-------------
121+
122+
The migration of this module from 17.0 to 18.0 was financially supported
123+
by Camptocamp.
124+
125+
Maintainers
126+
-----------
127+
128+
This module is maintained by the OCA.
129+
130+
.. image:: https://odoo-community.org/logo.png
131+
:alt: Odoo Community Association
132+
:target: https://odoo-community.org
133+
134+
OCA, or the Odoo Community Association, is a nonprofit organization whose
135+
mission is to support the collaborative development of Odoo features and
136+
promote its widespread use.
137+
138+
This module is part of the `OCA/server-auth <https://github.com/OCA/server-auth/tree/19.0/auth_api_key>`_ project on GitHub.
139+
140+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

auth_api_key/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models

auth_api_key/__manifest__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2018 ACSONE SA/NV
2+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
3+
4+
{
5+
"name": "Auth Api Key",
6+
"summary": """
7+
Authenticate http requests from an API key""",
8+
"version": "19.0.1.0.1",
9+
"license": "LGPL-3",
10+
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
11+
"website": "https://github.com/OCA/server-auth",
12+
"development_status": "Production/Stable",
13+
"depends": ["base_setup"],
14+
"data": [
15+
"security/ir.model.access.csv",
16+
"views/auth_api_key.xml",
17+
"views/res_config_settings.xml",
18+
],
19+
}

auth_api_key/i18n/auth_api_key.pot

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * auth_api_key
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 18.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"Last-Translator: \n"
10+
"Language-Team: \n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: \n"
14+
"Plural-Forms: \n"
15+
16+
#. module: auth_api_key
17+
#: model:ir.model,name:auth_api_key.model_auth_api_key
18+
msgid "API Key"
19+
msgstr ""
20+
21+
#. module: auth_api_key
22+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__active
23+
msgid "Active"
24+
msgstr ""
25+
26+
#. module: auth_api_key
27+
#: model:ir.model.constraint,message:auth_api_key.constraint_auth_api_key_name_uniq
28+
msgid "Api Key name must be unique."
29+
msgstr ""
30+
31+
#. module: auth_api_key
32+
#: model_terms:ir.ui.view,arch_db:auth_api_key.auth_api_key_form_view
33+
msgid "Archived"
34+
msgstr ""
35+
36+
#. module: auth_api_key
37+
#: model:ir.actions.act_window,name:auth_api_key.auth_api_key_act_window
38+
#: model:ir.ui.menu,name:auth_api_key.auth_api_key_menu
39+
msgid "Auth Api Key"
40+
msgstr ""
41+
42+
#. module: auth_api_key
43+
#: model:ir.model,name:auth_api_key.model_res_company
44+
msgid "Companies"
45+
msgstr ""
46+
47+
#. module: auth_api_key
48+
#: model:ir.model,name:auth_api_key.model_res_config_settings
49+
msgid "Config Settings"
50+
msgstr ""
51+
52+
#. module: auth_api_key
53+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__create_uid
54+
msgid "Created by"
55+
msgstr ""
56+
57+
#. module: auth_api_key
58+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__create_date
59+
msgid "Created on"
60+
msgstr ""
61+
62+
#. module: auth_api_key
63+
#: model:ir.model.fields,field_description:auth_api_key.field_res_company__archived_user_disable_auth_api_key
64+
#: model:ir.model.fields,field_description:auth_api_key.field_res_config_settings__archived_user_disable_auth_api_key
65+
msgid "Disable API key for archived user"
66+
msgstr ""
67+
68+
#. module: auth_api_key
69+
#: model_terms:ir.ui.view,arch_db:auth_api_key.res_config_settings_view_form
70+
msgid "Disable API key when archiving user"
71+
msgstr ""
72+
73+
#. module: auth_api_key
74+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__display_name
75+
msgid "Display Name"
76+
msgstr ""
77+
78+
#. module: auth_api_key
79+
#: model:ir.model,name:auth_api_key.model_ir_http
80+
msgid "HTTP Routing"
81+
msgstr ""
82+
83+
#. module: auth_api_key
84+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__id
85+
msgid "ID"
86+
msgstr ""
87+
88+
#. module: auth_api_key
89+
#: model:ir.model.fields,help:auth_api_key.field_res_company__archived_user_disable_auth_api_key
90+
#: model:ir.model.fields,help:auth_api_key.field_res_config_settings__archived_user_disable_auth_api_key
91+
msgid ""
92+
"If checked, when a user is archived/unactivated the same change is "
93+
"propagated to his related api key. It is not retroactive (nothing is done "
94+
"when enabling/disabling this option)."
95+
msgstr ""
96+
97+
#. module: auth_api_key
98+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__key
99+
msgid "Key"
100+
msgstr ""
101+
102+
#. module: auth_api_key
103+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__write_uid
104+
msgid "Last Updated by"
105+
msgstr ""
106+
107+
#. module: auth_api_key
108+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__write_date
109+
msgid "Last Updated on"
110+
msgstr ""
111+
112+
#. module: auth_api_key
113+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__name
114+
msgid "Name"
115+
msgstr ""
116+
117+
#. module: auth_api_key
118+
#: model:ir.model.fields,help:auth_api_key.field_auth_api_key__key
119+
msgid ""
120+
"The API key. Enter a dummy value in this field if it is\n"
121+
" obtained from the server environment configuration."
122+
msgstr ""
123+
124+
#. module: auth_api_key
125+
#: model:ir.model.fields,help:auth_api_key.field_auth_api_key__user_id
126+
msgid ""
127+
"The user used to process the requests authenticated by\n"
128+
" the api key"
129+
msgstr ""
130+
131+
#. module: auth_api_key
132+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__user_id
133+
msgid "User"
134+
msgstr ""
135+
136+
#. module: auth_api_key
137+
#. odoo-python
138+
#: code:addons/auth_api_key/models/auth_api_key.py:0
139+
msgid "User is not allowed"
140+
msgstr ""

0 commit comments

Comments
 (0)