Base Rest - SomConnexio
This module builds a REST API controller base, to build endpoints on them in the somconnexio application modules.
Table of contents
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.
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
Metadata
Release files for odoo-addon-base-rest-somconnexio 16.0.1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| odoo_addon_base_rest_somconnexio-16.0.1.0.2.tar.gz | 8.1 kB | Without provenance | Details for odoo_addon_base_rest_somconnexio-16.0.1.0.2.tar.gz |
Release files / odoo_addon_base_rest_somconnexio-16.0.1.0.2.tar.gz
| Download URL | odoo_addon_base_rest_somconnexio-16.0.1.0.2.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
187cd67c78cd11b1485d4622899e4818a2e15411bcde18a06d534f96c666a867
|
|
BLAKE2b-256 checksum How to use checksums |
256981cb61ff6be41f7f5353ce2d34cf18527f54bc690dbde804ada3edf20b8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.12
|
Security for odoo-addon-base-rest-somconnexio 16.0.1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.