MCPcopy Index your code
hub / github.com/plotly/dash / add_auth

Function add_auth

tests/integration/renderer/test_request_hooks.py:257–265  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

255 # test with an auth layer that requires a JWT with a certain length
256 @app.server.before_request
257 def add_auth():
258 if flask.request.method != "OPTIONS":
259 token = flask.request.headers.environ.get("HTTP_AUTHORIZATION")
260 if jwt_token.value and (
261 not token or len(token) != jwt_token.value + len("Bearer ")
262 ):
263 # Read the data to prevent bug with base http server.
264 flask.request.get_json(silent=True)
265 flask.abort(expiry_code, description="JWT Expired " + str(token))
266
267 dash_duo.start_server(app)
268

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
get_jsonMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…