marshmallow-code / marshmallow-code/flask-smorest

define requestInterceptor to handle XSRF cookie to header inside Swagger UI

Open
#264 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
717
Forks
77
Avg merge
7h 49m
Merged PRs (30d)
3

Description

I'm using flask-security to generate session and csrf tokens. It set's a cookie and the web frontend is expected to copy that cookie to every model-changing request.

Swagger offers the requestInterceptor option to define a function that sets the header.

Is there a way to define a function in API_SPEC_OPTIONS or any other way, to achieve XSRF protection inside the Swagger UI?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how API_SPEC_OPTIONS is consumed when Swagger UI is configured, then compare that path with Swagger UI's requestInterceptor option. Determine whether the option can be passed through or needs an exposed configuration mechanism; done means the supported approach is clear and covered by the relevant behavior or documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
flask, openapi, python
Domain
api, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.