Skip to content

Support adding headers, scoped by url + customer - #94

Open
donaldgray wants to merge 1 commit into
mainfrom
feature/add_header
Open

Support adding headers, scoped by url + customer#94
donaldgray wants to merge 1 commit into
mainfrom
feature/add_header

Conversation

@donaldgray

Copy link
Copy Markdown
Member

This is similar to CustomerOriginStrategy in Protagonist. It allows custom headers to be specified per customer and origin URL.

Note

Setuptools version pinning in docker image is temporary, follow up PR #93 updates to django-q2 and this can go.

Rather than add a table (and model/migration etc) I've kept it fairly lightweight. The entire JSON block is specified as an envvar, will be in format:

{
    "2": { // customer
        "^https://customer-url.*": { // regex
            "addHeader": { // type of operation
                "X-Api-Key": "abc12345" // add "X-Api-Key:abc12345 to matches
            }
        }
    }
}

This is obviously pretty limited but meets the requirements, if these expand we can look to add something more robust. My thinking is that the behaviour in repo is pretty much unchanged in 3/4 years so no need to add exhaustive handling at this stage.

This is similar to CustomerOriginStrategy in Protagonist. It allows
custom headers to be specified per customer and origin URL.

Note that setuptools version pining in docker image is temporary,
follow up PR will update to django-q2 and this can go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant