Maintainers
This module is part of the sygel-technology/sy-rest-framework project on GitHub.
You are welcome to contribute.
This module provides FastAPI Depends to allow authentication with Odoo’s API Keys.
Table of contents
The following FastAPI dependencies are provided and importable from odoo.addons.fastapi_auth_odoo_api_key.dependencies:
Return the authenticated partner based on the provided API key. Raise a 401 (unauthorized) if the API key is invalid or the partner could not be found. Also validates that the user associated with the API key matches the endpoint’s expected user, if specified.
Return the authenticated partner based on the provided API key, or an empty recordset if the key is valid but doesn’t match the expected user. Returns None if authentication fails silently.
Return an Odoo environment bound to the authenticated partner. The partner must be authenticated using apikey_authenticated_partner_impl. Raise a 401 if authentication fails.
Return the authenticated partner bound to the correct Odoo environment. This function uses the partner returned by apikey_authenticated_partner_impl and binds it to the environment returned by apikey_authenticated_partner_env.
Return an Odoo environment bound to the optionally authenticated partner, or a default environment if the partner could not be authenticated.
Return the optionally authenticated partner bound to the appropriate environment, or None if no valid API key was provided.
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.
Do not contact contributors directly about support or help with technical issues.
This module is part of the sygel-technology/sy-rest-framework project on GitHub.
You are welcome to contribute.