diff --git a/endpoint_route_handler/README.rst b/endpoint_route_handler/README.rst
index 0b7485d6..731f5099 100644
--- a/endpoint_route_handler/README.rst
+++ b/endpoint_route_handler/README.rst
@@ -95,6 +95,13 @@ instance:
new_route = route_handler.new(vals)
new_route._register_controller()
+Available ``auth_type`` values:
+
+- ``public``: no authentication required
+- ``user_endpoint``: session-based user authentication (default)
+- ``bearer``: API key authentication via ``Authorization: Bearer``
+ header (uses Odoo's built-in ``res.users.apikeys``)
+
You can override options and define - for instance - a different
controller method:
@@ -120,31 +127,31 @@ You can see a real life example on shopfloor.app model.
Known issues / Roadmap
======================
-- add api docs helpers
+- add api docs helpers
-- allow multiple HTTP methods on the same endpoint
+- allow multiple HTTP methods on the same endpoint
-- multiple values for route and methods
+- multiple values for route and methods
- keep the same in the ui for now, later own we can imagine a
- multi-value selection or just add text field w/ proper validation
- and cleanup
+ keep the same in the ui for now, later own we can imagine a
+ multi-value selection or just add text field w/ proper validation
+ and cleanup
- remove the route field in the table of endpoint_route
+ remove the route field in the table of endpoint_route
- support a comma separated list of routes maybe support comma
- separated list of methods use only routing.routes for generating
- the rule sort and freeze its values to update the endpoint hash
+ support a comma separated list of routes maybe support comma
+ separated list of methods use only routing.routes for generating
+ the rule sort and freeze its values to update the endpoint hash
- catch dup route exception on the sync to detect duplicated routes
- and use the endpoint_hash to retrieve the real record (note: we
- could store more info in the routing information which will stay in
- the map)
+ catch dup route exception on the sync to detect duplicated routes
+ and use the endpoint_hash to retrieve the real record (note: we
+ could store more info in the routing information which will stay
+ in the map)
- for customizing the rule behavior the endpoint the hook is to
- override the registry lookup
+ for customizing the rule behavior the endpoint the hook is to
+ override the registry lookup
- make EndpointRule class overridable on the registry
+ make EndpointRule class overridable on the registry
NOTE in v16 we won't care anymore about odoo controller so the lookup of
the controller can be simplified to a basic py obj that holds the
@@ -171,8 +178,8 @@ Authors
Contributors
------------
-- Simone Orsi Available auth_type values: You can override options and define - for instance - a different
controller method:As a tool
new_route = route_handler.new(vals)
new_route._register_controller()
+
+
@@ -476,8 +483,8 @@
Known issues / Roadmap
the rule sort and freeze its values to update the endpoint hash
catch dup route exception on the sync to detect duplicated routes and use the endpoint_hash to retrieve the real record (note: we -could store more info in the routing information which will stay in -the map)
+could store more info in the routing information which will stay +in the map)for customizing the rule behavior the endpoint the hook is to override the registry lookup
make EndpointRule class overridable on the registry
diff --git a/endpoint_route_handler/tests/test_endpoint.py b/endpoint_route_handler/tests/test_endpoint.py index 14901918..60086503 100644 --- a/endpoint_route_handler/tests/test_endpoint.py +++ b/endpoint_route_handler/tests/test_endpoint.py @@ -50,6 +50,12 @@ def test_as_tool_base_data(self): new_route.route += "/new" self.assertNotEqual(new_route.endpoint_hash, first_hash) + def test_auth_type_routing_info(self): + for auth_type in ("public", "user_endpoint", "bearer"): + new_route = make_new_route(self.env, auth_type=auth_type) + __, routing, __ = new_route._get_routing_info() + self.assertEqual(routing["auth"], auth_type) + @mute_logger("odoo.addons.base.models.ir_http") def test_as_tool_register_single_controller(self): new_route = make_new_route(self.env)