This provides an implementation of auth_partner for FastAPI
Project description
Fastapi Auth Partner
This module is the FastAPI implementation of auth_partner it provides all the routes to manage the authentication of partners.
Table of contents
Usage
First you have to add the auth router to your FastAPI endpoint and the authentication dependency to your app dependencies:
from odoo.addons.fastapi import dependencies
from odoo.addons.fastapi_auth_partner.dependencies import (
auth_partner_authenticated_partner,
)
from odoo.addons.fastapi_auth_partner.routers.auth import auth_router
class FastapiEndpoint(models.Model):
_inherit = "fastapi.endpoint"
def _get_fastapi_routers(self):
if self.app == "myapp":
return [
auth_router,
]
return super()._get_fastapi_routers()
def _get_app_dependencies_overrides(self):
res = super()._get_app_dependencies_overrides()
if self.app == "myapp":
res.update(
{
dependencies.authenticated_partner_impl: auth_partner_authenticated_partner,
}
)
return res
Next you can manage your authenticable partners and directories in the Odoo interface:
FastAPI > Authentication > Partner
and
FastAPI > Authentication > Directory
Next you must set the directory used for the authentication in the FastAPI endpoint:
FastAPI > FastAPI Endpoint > myapp > Directory
Then you can use the auth router to authenticate your requests:
POST /auth/register to register a partner
POST /auth/login to authenticate a partner
POST /auth/logout to unauthenticate a partner
POST /auth/validate_email to validate a partner email
POST /auth/request_reset_password to request a password reset
POST /auth/set_password to set a new password
GET /auth/profile to get the partner profile
GET /auth/impersonate to impersonate a partner
Bug Tracker
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.
Credits
Contributors
-
Sébastien Beau
Florian Mounier
Maintainers
This module is maintained by the OCA.
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/rest-framework project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file odoo_addon_fastapi_auth_partner-18.0.1.0.0.2-py3-none-any.whl.
File metadata
- Download URL: odoo_addon_fastapi_auth_partner-18.0.1.0.0.2-py3-none-any.whl
- Upload date:
- Size: 44.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae2fa52eaef1227626ad23d7fb53fcbdec8403fe69d22282b4ba7488a7e4a9bd
|
|
| MD5 |
a1ac179fddeaa8a6a00984b0fcef340b
|
|
| BLAKE2b-256 |
6e825b4a2dcfbbbd3ba55fc4efc53fcc8af5826b36a8f4c828d98c32aacaa5cd
|