Metadata-Version: 2.4
Name: odoo-addon-base_rest_somconnexio
Version: 16.0.1.0.1
Summary: Expose the basic REST and public API controllers used in Som Connexió.
Home-page: https://git.coopdevs.org/coopdevs/som-connexio/odoo/odoo-somconnexio
Author: Som Connexió SCCL, Coopdevs Treball SCCL
License: AGPL-3
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 16.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Requires-Python: >=3.10
Requires-Dist: odoo-addon-auth_api_key<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-base_rest<16.1dev,>=16.0dev
Requires-Dist: odoo<16.1dev,>=16.0a
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: home-page
Dynamic: license
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

#########################
 Base Rest - SomConnexio
#########################

..
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:1614423d340008335f552b55056ced34554a9187993e584db2ccb85c9738b530
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
   :alt: Beta
   :target: https://odoo-community.org/page/development-status

.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
   :alt: License: AGPL-3
   :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html

.. |badge3| image:: https://img.shields.io/badge/gitlab-coopdevs%2Fodoo--somconnexio-lightgray.png?logo=gitlab
   :alt: coopdevs/som-connexio/odoo-somconnexio
   :target: https://git.coopdevs.org/coopdevs/som-connexio/odoo-somconnexio

|badge1| |badge2| |badge3|

This module builds a REST API controller base, to build endpoints on
them in the somconnexio application modules.

**Table of contents**

.. contents::
   :local:

***************
 Configuration
***************

Create a API key with a user related with the needed security rights to
read and modify contracts.

You can follow the next instruccions:

-  Settings > Technical (debug mode) > Auth API Key
-  click create and select a user, save.
-  communicate the API-KEY to the client or app to use the API.

*******
 Usage
*******

Two controllers with two collections are set: - APIKeyController, with
an api-key authentication. Collection: "sc.api.key.services" -
PublicController, for endpoints with no authentication required.
Collection: "sc.public.services"

To use them, create service with a Component class using one of these
collections.

.. code:: python

   class PingPublicAPIService(Component):
       _name = "ping.public.api.service"    # name for the new component
       _inherit = "base.rest.service"       # always inherit from base.rest.service (se base_rest module)
       _collection = "sc.public.services"   # collection to use
       _usage = "ping"  # service_name      # collection path
       _description = """
           Ping services (test the public api)
       """

The collection used will inherit its related Controller `_root_path` and
`auth` method for the given Component The final endpoint will be formed
by the Controller `_root_path` plus the Component `usage` plus its child
endponts defined in their methods. Example: "/public-api/ping/create"

You can see the PingAuthAPIService or PingPublicAPIService services,
left as model references.

Also, a "common_service" test class is created for tests purposes. Tests
classes using endpoints can inherit from it to use its API call methods.

**************
 Contributors
**************

-  ``Som Connexió SCCL <https://somconnexio.coop/>``

   -  Gerard Funonsas gerard.funosas@somconnexio.coop
   -  Borja Gimeno borja.gimeno@somconnexio.coop

-  ``Coopdevs Treball SCCL <https://coopdevs.coop/>``

   -  Daniel Palomar daniel.palomar@coopdevs.org
   -  Cesar Lopez cesar.lopez@coopdevs.org
   -  Carla Berenguer carla.berenguer@coopdevs.org
