Securing rest api (not rest channel) using custom auth in place of default sanic authentication

Hi All, I have read this - Rasa HTTP API and understood that we need to use an outside nginx-like api gateway to secure the rasa http apis. But have two questions on the other possibility.

  1. In server.py, there is Sanic App Initialize method that is called with the following authenticate method. My first question is - Is it possible to override the method with our custom authenticate method.
async def authenticate(_: Request) -> NoReturn:
    """Callback for authentication failed."""
    raise exceptions.AuthenticationFailed(
        "Direct JWT authentication not supported. You should already have "
        "a valid JWT from an authentication provider, Rasa will just make "
        "sure that the token is valid, but not issue new tokens."
    )
...
...
...
        app.config["USE_JWT"] = True
        Initialize(
            app,
            secret=jwt_secret,
            authenticate=authenticate,
            algorithm=jwt_method,
            user_id="username",
        )
  1. When we start rasa with the JWT token, it uses the default jwt auth implementation of the sanic. Is there anyway to customize the rasa sanic app to use our own custom jwt authentication?

Thank you in advance.