✨ feat: ORJSON Rust-level serializer — lib registry + feature gates
swadhinbiswas committed 3 months ago
c4dc75f
1 parent d3107b1
commit c4dc75f
3 files changed
+7 -3
Showing 3 changed files+7-3
▼crates/justapi-core/src/lib.rs
+2-2
| @@ -11,6 +11,8 @@ pub mod extract; | ||
11 | 11 | pub mod gateway; |
12 | 12 | pub mod graphql; |
13 | 13 | pub mod health; |
14 | +#[cfg(feature = "mail")] | |
15 | +pub mod mail; | |
14 | 16 | pub mod memory; |
15 | 17 | pub mod metrics; |
16 | 18 | pub mod middleware; |
| @@ -33,8 +35,6 @@ pub mod tracing_setup; | ||
33 | 35 | pub mod validate; |
34 | 36 | pub mod wasm; |
35 | 37 | pub mod xml; |
36 | -#[cfg(feature = "mail")] | |
37 | -pub mod mail; | |
38 | 38 | |
39 | 39 | pub use server::{serve, Server}; |
40 | 40 | |
41 | 41 | |
▼crates/justapi-py/python/justapi/__init__.py
+2-1
| @@ -25,6 +25,7 @@ Usage: | ||
25 | 25 | |
26 | 26 | """ |
27 | 27 | |
28 | +from . import auth as auth | |
28 | 29 | from . import testing as testing |
29 | 30 | from . import tracing as tracing |
30 | 31 | from . import status as status |
| @@ -297,7 +298,7 @@ def pydantic_schema(model_class) -> str: | ||
297 | 298 | |
298 | 299 | __all__ = [ |
299 | 300 | "serve", "JustAPIApp", "JustAPI", "Depends", "Mailer", "Database", "DbPool", "DbParam", "Schema", "pydantic_schema", |
300 | - "JustAPITestClient", "testing", "tracing", "Jinja2Templates", "BackgroundTasks", "Scheduler", | |
301 | + "JustAPITestClient", "testing", "tracing", "auth", "Jinja2Templates", "BackgroundTasks", "Scheduler", | |
301 | 302 | "TokenStreamResponse", "ValidatedStreamResponse", "WebSocket", "Dag", "DagNode", "RateLimiter", "RateLimitResult", |
302 | 303 | "adaptive_batch", "APIRouter", "Controller", "controller", |
303 | 304 | "route_get", "route_post", "route_put", "route_patch", "route_delete", "route_query", |
304 | 305 | |
▼crates/justapi-py/src/lib.rs
+3-0
| @@ -1,5 +1,6 @@ | ||
1 | 1 | use pyo3::prelude::*; |
2 | 2 | |
3 | +pub mod auth; | |
3 | 4 | pub mod background; |
4 | 5 | pub mod buffer_test; |
5 | 6 | mod dag; |
| @@ -19,6 +20,7 @@ pub mod status; | ||
19 | 20 | mod test_client; |
20 | 21 | mod websocket; |
21 | 22 | |
23 | +pub use auth::PyJwtAuth; | |
22 | 24 | pub use dag::{Dag, DagNode}; |
23 | 25 | pub use database::{Database, DbParam, DbPool}; |
24 | 26 | #[cfg(feature = "mail")] |
| @@ -57,6 +59,7 @@ fn _justapi(_py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> { | ||
57 | 59 | m.add_function(wrap_pyfunction!(serve, m)?)?; |
58 | 60 | m.add_function(wrap_pyfunction!(validate_value, m)?)?; |
59 | 61 | m.add_class::<buffer_test::ZeroCopyBuffer>()?; |
62 | + auth::register(m)?; | |
60 | 63 | |
61 | 64 | rate_limit::register(m)?; |
62 | 65 | m.add_function(wrap_pyfunction!(_test_zero_copy, m)?)?; |
63 | 66 | |