Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
58e8260
New generic module du define REST services
lmignon Jan 31, 2018
5cd5f8d
auth_api_key: New module to provide authentication by api_key
lmignon Jan 31, 2018
52b4d3c
auth_api_key: Remove useless code
lmignon Feb 2, 2018
f26e728
Update the auth_api_key for keychan 10.0.2 (renamed method)
RobinetDenisAcsone Feb 19, 2018
1ed30e7
Fix the authentification method and show the user_id on the form
RobinetDenisAcsone Feb 19, 2018
f4ee2e4
refactor code in order to use generic code from base_rest instead of …
sebastienbeau Feb 25, 2018
1cd1e8c
fix wrong name in selection box
sebastienbeau Aug 29, 2018
92ee605
Since keychain 10.0.2.0.1 there is a default validation method
hparfr Oct 17, 2018
d13d8c7
Keychain removed
qgroulard Nov 6, 2018
d1bb071
Update Readme with more details
qgroulard Nov 8, 2018
9808673
Quick fix CONFIGURE.rst
qgroulard Nov 8, 2018
24bcea6
Developmet status: Beta
qgroulard Nov 8, 2018
d9fec16
[FIX] auth_api_key: fix api and flake8
lmignon Nov 13, 2018
6807293
[MIG] server_auth from 10 to 12
sbidoul Nov 20, 2018
1edf895
auth_api_key: add description to model
sbidoul Nov 20, 2018
31834ac
[CHG] auth_api_key is LGPL
sbidoul Nov 21, 2018
419e8b0
Use consteq to compare keys
ap-wtioit Nov 30, 2018
58e7d64
[UPD] README.rst
OCA-git-bot Feb 14, 2019
cda4dcc
[IMP] ADD possibility to save api keys in database by using server.en…
mourad-ehm Jul 18, 2019
86f48d4
[FIX] login_name error
mourad-ehm Jul 18, 2019
bda17a7
[IMP] make auth_api_key compatible in multi-db
sebastienbeau Jul 19, 2019
cbfe151
[UPD] README.rst
OCA-git-bot Jul 29, 2019
e273214
[FIX] auth_api_key: Fix tests according to last changes and add views…
lmignon Sep 20, 2019
f8830f9
[IMP] auth_api_key: Ensures backward compatibility
lmignon Sep 27, 2019
bc6eed1
[FIX] auth_api_key: Cache must be cleared if the user_id is modified
lmignon Sep 27, 2019
4f5a236
[IMP] auth_api_key: Improves key field description
lmignon Sep 27, 2019
a8e6509
[UPD] README.rst
OCA-git-bot Sep 28, 2019
8b1ab4a
[IMP] auth_api_key: black, isort
Oct 17, 2019
a6ffa29
[MIG] auth_api_key: Migration to 13.0
Oct 17, 2019
23b5354
[UPD] Update auth_api_key.pot
oca-travis Oct 29, 2019
52cb9a0
[UPD] README.rst
OCA-git-bot Oct 29, 2019
d42bd8d
pre-commit update
OCA-git-bot Mar 14, 2020
4e6d5f3
[MIG] auth_api_key: Migration to 14.0
chafique-delli Oct 12, 2020
757b172
[UPD] Update auth_api_key.pot
oca-travis Dec 21, 2020
9f966fc
[UPD] README.rst
OCA-git-bot Dec 21, 2020
67f91d3
Added translation using Weblate (Italian)
primes2h Feb 12, 2021
c8d0b50
Translated using Weblate (Italian)
primes2h Feb 12, 2021
e4cf7bf
[14.0][IMP] auth_api_key: Allow to search on every key even if void
rousseldenis Sep 9, 2021
caf3eac
auth_api_key 14.0.1.0.1
OCA-git-bot Sep 10, 2021
6eae2c6
auth_api_key: drop old migration
simahawk Sep 24, 2021
a5c8cce
auth_api_key: get rid of server env
simahawk Sep 24, 2021
f38a5fa
auth_api_key: 14.0.2.0.0
simahawk Sep 24, 2021
69d0277
[UPD] Update auth_api_key.pot
oca-travis Sep 27, 2021
24c9ab8
[UPD] README.rst
OCA-git-bot Sep 27, 2021
e4fa119
auth_api_key 14.0.2.0.1
OCA-git-bot Sep 27, 2021
0b4cd3c
Update translation files
oca-transbot Sep 27, 2021
9562587
[IMP] auth_api_key: black, isort, prettier
yankinmax Nov 24, 2021
4dcb8c4
[MIG] auth_api_key: Migration to 15.0
yankinmax Nov 24, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions auth_api_key/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
============
Auth Api Key
============

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
: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/15.0/auth_api_key
: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-15-0/server-auth-15-0-auth_api_key
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/251/15.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

Authenticate http requests from an API key.

API keys are codes passed in (in the http header API-KEY)
by programs calling an API in order to identify -in this case- the calling program's user.

Take care while using this kind of mechanism since information into http headers are visible in clear.
Thus, use it only to authenticate requests from known sources.

For unknown sources, it is a good practice to filter out this header at proxy level.

**Table of contents**

.. contents::
:local:

Configuration
=============

The api key menu is available into Settings > Technical in debug mode.
By default, when you create an API key, the key is saved into the database.

If you want to manage them via serve environment settings use `auth_api_key_server_env`.

Usage
=====

To apply this authentication system to your http request you must set 'api_key'
as value for the 'auth' parameter of your route definition into your controller.

.. code-block:: python

class MyController(Controller):

@route('/my_service', auth='api_key', ...)
def my_service(self, *args, **kwargs):
pass

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-auth/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`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**>`_.

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

Credits
=======

Authors
~~~~~~~

* ACSONE SA/NV

Contributors
~~~~~~~~~~~~

* Denis Robinet <[email protected]>
* Laurent Mignon <[email protected]>
* Quentin Groulard <[email protected]>
* Sébastien Beau <[email protected]>
* Chafique Delli <[email protected]>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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 <https://github.com/OCA/server-auth/tree/15.0/auth_api_key>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions auth_api_key/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions auth_api_key/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2018 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
"name": "Auth Api Key",
"summary": """
Authenticate http requests from an API key""",
"version": "15.0.1.0.0",
"license": "LGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/server-auth",
"development_status": "Beta",
"data": ["security/ir.model.access.csv", "views/auth_api_key.xml"],
}
114 changes: 114 additions & 0 deletions auth_api_key/i18n/auth_api_key.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * auth_api_key
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: auth_api_key
#: model:ir.model,name:auth_api_key.model_auth_api_key
msgid "API Key"
msgstr ""

#. module: auth_api_key
#: model:ir.model.constraint,message:auth_api_key.constraint_auth_api_key_name_uniq
msgid "Api Key name must be unique."
msgstr ""

#. module: auth_api_key
#: model:ir.actions.act_window,name:auth_api_key.auth_api_key_act_window
#: model:ir.ui.menu,name:auth_api_key.auth_api_key_menu
msgid "Auth Api Key"
msgstr ""

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__create_uid
msgid "Created by"
msgstr ""

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__create_date
msgid "Created on"
msgstr ""

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__display_name
#: model:ir.model.fields,field_description:auth_api_key.field_ir_http__display_name
msgid "Display Name"
msgstr ""

#. module: auth_api_key
#: model:ir.model,name:auth_api_key.model_ir_http
msgid "HTTP Routing"
msgstr ""

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__id
#: model:ir.model.fields,field_description:auth_api_key.field_ir_http__id
msgid "ID"
msgstr ""

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__key
msgid "Key"
msgstr ""

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key____last_update
#: model:ir.model.fields,field_description:auth_api_key.field_ir_http____last_update
msgid "Last Modified on"
msgstr ""

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__write_uid
msgid "Last Updated by"
msgstr ""

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__write_date
msgid "Last Updated on"
msgstr ""

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__name
msgid "Name"
msgstr ""

#. module: auth_api_key
#: model:ir.model.fields,help:auth_api_key.field_auth_api_key__key
msgid ""
"The API key. Enter a dummy value in this field if it is\n"
" obtained from the server environment configuration."
msgstr ""

#. module: auth_api_key
#: code:addons/auth_api_key/models/auth_api_key.py:0
#, python-format
msgid "The key %s is not allowed"
msgstr ""

#. module: auth_api_key
#: model:ir.model.fields,help:auth_api_key.field_auth_api_key__user_id
msgid ""
"The user used to process the requests authenticated by\n"
" the api key"
msgstr ""

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__user_id
msgid "User"
msgstr ""

#. module: auth_api_key
#: code:addons/auth_api_key/models/auth_api_key.py:0
#, python-format
msgid "User is not allowed"
msgstr ""
124 changes: 124 additions & 0 deletions auth_api_key/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * auth_api_key
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-02-12 10:45+0000\n"
"Last-Translator: Sergio Zanchetta <[email protected]>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.3.2\n"

#. module: auth_api_key
#: model:ir.model,name:auth_api_key.model_auth_api_key
msgid "API Key"
msgstr "Chiave API"

#. module: auth_api_key
#: model:ir.model.constraint,message:auth_api_key.constraint_auth_api_key_name_uniq
msgid "Api Key name must be unique."
msgstr "La chiave API deve essere univoca."

#. module: auth_api_key
#: model:ir.actions.act_window,name:auth_api_key.auth_api_key_act_window
#: model:ir.ui.menu,name:auth_api_key.auth_api_key_menu
msgid "Auth Api Key"
msgstr "Chiave API di autenticazione"

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__create_uid
msgid "Created by"
msgstr "Creata da"

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__create_date
msgid "Created on"
msgstr "Creata il"

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__display_name
#: model:ir.model.fields,field_description:auth_api_key.field_ir_http__display_name
msgid "Display Name"
msgstr "Nome visualizzato"

#. module: auth_api_key
#: model:ir.model,name:auth_api_key.model_ir_http
msgid "HTTP Routing"
msgstr "Instradamento HTTP"

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__id
#: model:ir.model.fields,field_description:auth_api_key.field_ir_http__id
msgid "ID"
msgstr "ID"

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__key
msgid "Key"
msgstr "Chiave"

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key____last_update
#: model:ir.model.fields,field_description:auth_api_key.field_ir_http____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__write_uid
msgid "Last Updated by"
msgstr "Ultimo aggiornamento di"

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__write_date
msgid "Last Updated on"
msgstr "Ultimo aggiornamento il"

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__name
msgid "Name"
msgstr "Nome"

#. module: auth_api_key
#: model:ir.model.fields,help:auth_api_key.field_auth_api_key__key
msgid ""
"The API key. Enter a dummy value in this field if it is\n"
" obtained from the server environment configuration."
msgstr ""
"Chiave API. Se viene acquisita dalla configurazione\n"
" ambiente del server, inserire nel campo un valore fittizio."

#. module: auth_api_key
#: code:addons/auth_api_key/models/auth_api_key.py:0
#, python-format
msgid "The key %s is not allowed"
msgstr "Chiave %s non autorizzata"

#. module: auth_api_key
#: model:ir.model.fields,help:auth_api_key.field_auth_api_key__user_id
msgid ""
"The user used to process the requests authenticated by\n"
" the api key"
msgstr ""
"Utente utilizzato per elaborare le richieste autenticate\n"
" dalla chiave API"

#. module: auth_api_key
#: model:ir.model.fields,field_description:auth_api_key.field_auth_api_key__user_id
msgid "User"
msgstr "Utente"

#. module: auth_api_key
#: code:addons/auth_api_key/models/auth_api_key.py:0
#, python-format
msgid "User is not allowed"
msgstr "Utente non autorizzato"

#~ msgid "Server Env Defaults"
#~ msgstr "Variabili ambiente predefinite del server"
2 changes: 2 additions & 0 deletions auth_api_key/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import ir_http
from . import auth_api_key
Loading