[WIP] Authentication
All checks were successful
Build on push / prepare (push) Successful in 9s
Build on push / core (push) Successful in 19s
Build on push / query (push) Successful in 19s
Build on push / dependency (push) Successful in 17s
Build on push / application (push) Successful in 16s
Build on push / mail (push) Successful in 16s
Build on push / translation (push) Successful in 18s
Build on push / database (push) Successful in 22s
Build on push / auth (push) Successful in 15s
Build on push / api (push) Successful in 13s

This commit is contained in:
2025-09-19 23:01:41 +02:00
parent 17dfb245bf
commit eceff6128b
9 changed files with 111 additions and 13 deletions

View File

@@ -15,6 +15,7 @@ def main():
app.with_route(path="/route1", fn=lambda r: JSONResponse("route1"), method="GET")
app.with_routes_directory("routes")
app.with_logging()
app.with_authentication()
app.run()

View File

@@ -7,6 +7,7 @@ from cpl.core.log import Logger
from service import PingService
@Router.authenticate()
@Router.get(f"/ping")
async def ping(r: Request, ping: PingService, logger: Logger):
logger.info(f"Ping: {ping}")