Skip to content

Commit 1c351be

Browse files
committed
Merge PR #311 into 15.0
Signed-off-by simahawk
2 parents 17bb7cf + 4dcb8c4 commit 1c351be

File tree

20 files changed

+1038
-0
lines changed

20 files changed

+1038
-0
lines changed

auth_api_key/README.rst

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
============
2+
Auth Api Key
3+
============
4+
5+
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6+
!! This file is generated by oca-gen-addon-readme !!
7+
!! changes will be overwritten. !!
8+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9+
10+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
11+
:target: https://odoo-community.org/page/development-status
12+
:alt: Beta
13+
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
14+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
15+
:alt: License: LGPL-3
16+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github
17+
:target: https://github.com/OCA/server-auth/tree/15.0/auth_api_key
18+
:alt: OCA/server-auth
19+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
20+
:target: https://translation.odoo-community.org/projects/server-auth-15-0/server-auth-15-0-auth_api_key
21+
:alt: Translate me on Weblate
22+
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
23+
:target: https://runbot.odoo-community.org/runbot/251/15.0
24+
:alt: Try me on Runbot
25+
26+
|badge1| |badge2| |badge3| |badge4| |badge5|
27+
28+
Authenticate http requests from an API key.
29+
30+
API keys are codes passed in (in the http header API-KEY)
31+
by programs calling an API in order to identify -in this case- the calling program's user.
32+
33+
Take care while using this kind of mechanism since information into http headers are visible in clear.
34+
Thus, use it only to authenticate requests from known sources.
35+
36+
For unknown sources, it is a good practice to filter out this header at proxy level.
37+
38+
**Table of contents**
39+
40+
.. contents::
41+
:local:
42+
43+
Configuration
44+
=============
45+
46+
The api key menu is available into Settings > Technical in debug mode.
47+
By default, when you create an API key, the key is saved into the database.
48+
49+
If you want to manage them via serve environment settings use `auth_api_key_server_env`.
50+
51+
Usage
52+
=====
53+
54+
To apply this authentication system to your http request you must set 'api_key'
55+
as value for the 'auth' parameter of your route definition into your controller.
56+
57+
.. code-block:: python
58+
59+
class MyController(Controller):
60+
61+
@route('/my_service', auth='api_key', ...)
62+
def my_service(self, *args, **kwargs):
63+
pass
64+
65+
Bug Tracker
66+
===========
67+
68+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-auth/issues>`_.
69+
In case of trouble, please check there if your issue has already been reported.
70+
If you spotted it first, help us smashing it by providing a detailed and welcomed
71+
`feedback <https://github.com/OCA/server-auth/issues/new?body=module:%20auth_api_key%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
72+
73+
Do not contact contributors directly about support or help with technical issues.
74+
75+
Credits
76+
=======
77+
78+
Authors
79+
~~~~~~~
80+
81+
* ACSONE SA/NV
82+
83+
Contributors
84+
~~~~~~~~~~~~
85+
86+
* Denis Robinet <[email protected]>
87+
* Laurent Mignon <[email protected]>
88+
* Quentin Groulard <[email protected]>
89+
* Sébastien Beau <[email protected]>
90+
* Chafique Delli <[email protected]>
91+
92+
Maintainers
93+
~~~~~~~~~~~
94+
95+
This module is maintained by the OCA.
96+
97+
.. image:: https://odoo-community.org/logo.png
98+
:alt: Odoo Community Association
99+
:target: https://odoo-community.org
100+
101+
OCA, or the Odoo Community Association, is a nonprofit organization whose
102+
mission is to support the collaborative development of Odoo features and
103+
promote its widespread use.
104+
105+
This module is part of the `OCA/server-auth <https://github.com/OCA/server-auth/tree/15.0/auth_api_key>`_ project on GitHub.
106+
107+
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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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": "15.0.1.0.0",
9+
"license": "LGPL-3",
10+
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
11+
"website": "https://github.com/OCA/server-auth",
12+
"development_status": "Beta",
13+
"data": ["security/ir.model.access.csv", "views/auth_api_key.xml"],
14+
}

auth_api_key/i18n/auth_api_key.pot

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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 15.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.constraint,message:auth_api_key.constraint_auth_api_key_name_uniq
23+
msgid "Api Key name must be unique."
24+
msgstr ""
25+
26+
#. module: auth_api_key
27+
#: model:ir.actions.act_window,name:auth_api_key.auth_api_key_act_window
28+
#: model:ir.ui.menu,name:auth_api_key.auth_api_key_menu
29+
msgid "Auth Api Key"
30+
msgstr ""
31+
32+
#. module: auth_api_key
33+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__create_uid
34+
msgid "Created by"
35+
msgstr ""
36+
37+
#. module: auth_api_key
38+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__create_date
39+
msgid "Created on"
40+
msgstr ""
41+
42+
#. module: auth_api_key
43+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__display_name
44+
#: model:ir.model.fields,field_description:auth_api_key.field_ir_http__display_name
45+
msgid "Display Name"
46+
msgstr ""
47+
48+
#. module: auth_api_key
49+
#: model:ir.model,name:auth_api_key.model_ir_http
50+
msgid "HTTP Routing"
51+
msgstr ""
52+
53+
#. module: auth_api_key
54+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__id
55+
#: model:ir.model.fields,field_description:auth_api_key.field_ir_http__id
56+
msgid "ID"
57+
msgstr ""
58+
59+
#. module: auth_api_key
60+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__key
61+
msgid "Key"
62+
msgstr ""
63+
64+
#. module: auth_api_key
65+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key____last_update
66+
#: model:ir.model.fields,field_description:auth_api_key.field_ir_http____last_update
67+
msgid "Last Modified on"
68+
msgstr ""
69+
70+
#. module: auth_api_key
71+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__write_uid
72+
msgid "Last Updated by"
73+
msgstr ""
74+
75+
#. module: auth_api_key
76+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__write_date
77+
msgid "Last Updated on"
78+
msgstr ""
79+
80+
#. module: auth_api_key
81+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__name
82+
msgid "Name"
83+
msgstr ""
84+
85+
#. module: auth_api_key
86+
#: model:ir.model.fields,help:auth_api_key.field_auth_api_key__key
87+
msgid ""
88+
"The API key. Enter a dummy value in this field if it is\n"
89+
" obtained from the server environment configuration."
90+
msgstr ""
91+
92+
#. module: auth_api_key
93+
#: code:addons/auth_api_key/models/auth_api_key.py:0
94+
#, python-format
95+
msgid "The key %s is not allowed"
96+
msgstr ""
97+
98+
#. module: auth_api_key
99+
#: model:ir.model.fields,help:auth_api_key.field_auth_api_key__user_id
100+
msgid ""
101+
"The user used to process the requests authenticated by\n"
102+
" the api key"
103+
msgstr ""
104+
105+
#. module: auth_api_key
106+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__user_id
107+
msgid "User"
108+
msgstr ""
109+
110+
#. module: auth_api_key
111+
#: code:addons/auth_api_key/models/auth_api_key.py:0
112+
#, python-format
113+
msgid "User is not allowed"
114+
msgstr ""

auth_api_key/i18n/it.po

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
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 15.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"PO-Revision-Date: 2021-02-12 10:45+0000\n"
10+
"Last-Translator: Sergio Zanchetta <[email protected]>\n"
11+
"Language-Team: none\n"
12+
"Language: it\n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
17+
"X-Generator: Weblate 4.3.2\n"
18+
19+
#. module: auth_api_key
20+
#: model:ir.model,name:auth_api_key.model_auth_api_key
21+
msgid "API Key"
22+
msgstr "Chiave API"
23+
24+
#. module: auth_api_key
25+
#: model:ir.model.constraint,message:auth_api_key.constraint_auth_api_key_name_uniq
26+
msgid "Api Key name must be unique."
27+
msgstr "La chiave API deve essere univoca."
28+
29+
#. module: auth_api_key
30+
#: model:ir.actions.act_window,name:auth_api_key.auth_api_key_act_window
31+
#: model:ir.ui.menu,name:auth_api_key.auth_api_key_menu
32+
msgid "Auth Api Key"
33+
msgstr "Chiave API di autenticazione"
34+
35+
#. module: auth_api_key
36+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__create_uid
37+
msgid "Created by"
38+
msgstr "Creata da"
39+
40+
#. module: auth_api_key
41+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__create_date
42+
msgid "Created on"
43+
msgstr "Creata il"
44+
45+
#. module: auth_api_key
46+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__display_name
47+
#: model:ir.model.fields,field_description:auth_api_key.field_ir_http__display_name
48+
msgid "Display Name"
49+
msgstr "Nome visualizzato"
50+
51+
#. module: auth_api_key
52+
#: model:ir.model,name:auth_api_key.model_ir_http
53+
msgid "HTTP Routing"
54+
msgstr "Instradamento HTTP"
55+
56+
#. module: auth_api_key
57+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__id
58+
#: model:ir.model.fields,field_description:auth_api_key.field_ir_http__id
59+
msgid "ID"
60+
msgstr "ID"
61+
62+
#. module: auth_api_key
63+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__key
64+
msgid "Key"
65+
msgstr "Chiave"
66+
67+
#. module: auth_api_key
68+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key____last_update
69+
#: model:ir.model.fields,field_description:auth_api_key.field_ir_http____last_update
70+
msgid "Last Modified on"
71+
msgstr "Ultima modifica il"
72+
73+
#. module: auth_api_key
74+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__write_uid
75+
msgid "Last Updated by"
76+
msgstr "Ultimo aggiornamento di"
77+
78+
#. module: auth_api_key
79+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__write_date
80+
msgid "Last Updated on"
81+
msgstr "Ultimo aggiornamento il"
82+
83+
#. module: auth_api_key
84+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__name
85+
msgid "Name"
86+
msgstr "Nome"
87+
88+
#. module: auth_api_key
89+
#: model:ir.model.fields,help:auth_api_key.field_auth_api_key__key
90+
msgid ""
91+
"The API key. Enter a dummy value in this field if it is\n"
92+
" obtained from the server environment configuration."
93+
msgstr ""
94+
"Chiave API. Se viene acquisita dalla configurazione\n"
95+
" ambiente del server, inserire nel campo un valore fittizio."
96+
97+
#. module: auth_api_key
98+
#: code:addons/auth_api_key/models/auth_api_key.py:0
99+
#, python-format
100+
msgid "The key %s is not allowed"
101+
msgstr "Chiave %s non autorizzata"
102+
103+
#. module: auth_api_key
104+
#: model:ir.model.fields,help:auth_api_key.field_auth_api_key__user_id
105+
msgid ""
106+
"The user used to process the requests authenticated by\n"
107+
" the api key"
108+
msgstr ""
109+
"Utente utilizzato per elaborare le richieste autenticate\n"
110+
" dalla chiave API"
111+
112+
#. module: auth_api_key
113+
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__user_id
114+
msgid "User"
115+
msgstr "Utente"
116+
117+
#. module: auth_api_key
118+
#: code:addons/auth_api_key/models/auth_api_key.py:0
119+
#, python-format
120+
msgid "User is not allowed"
121+
msgstr "Utente non autorizzato"
122+
123+
#~ msgid "Server Env Defaults"
124+
#~ msgstr "Variabili ambiente predefinite del server"

auth_api_key/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import ir_http
2+
from . import auth_api_key

0 commit comments

Comments
 (0)