Skip to content

API design for tornado guard #1

Closed

Description

@joegasewicz

This issue represents a discussion on the api design for tornadoapi-guard.

The below issues will give some context on why tornado doesn't have a middleware or extension plugin api:

This is a quote from one of the main maintainers of tornado (@ploxiln):

Tornado tends more towards a parts-you-can-use structure. You can make (and distribute) custom Router class, custom RequestHandler subclass, custom httpserver class, custom httpclient class, or a library that's convenient to use with an existing tornado usage pattern. Examples:

https://github.com/bdarnell/tornado_http2
https://www.tornadoweb.org/en/stable/routing.html
https://github.com/siddhantgoel/streaming-form-data/blob/master/examples/tornado/stream_request_body.py

You can also use the mixin pattern, just pass it any subclasses you are extending e.g

class BaseHandler(
    # Add Request middleware here 
    TornadoAuthSessionMixin,
    tornado.web.RequestHandler,
):
    pass

Activity

  1. locked and limited conversation to collaborators on Apr 5, 2026
  2. converted this issue into a discussion #2 on Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions