Skip to main content

No project description provided

Project description

DeprecationProxy

A mitmproxy-based forwarding proxy that returns HTTP 410 Gone for endpoints listed as deprecated in JSON config files. Anything not listed is forwarded to the real upstream.

Install

poetry install

Run

poetry run deproxy
# or with custom ports / folder:
poetry run deproxy --port 8080 --control-port 8081 --deprecations-dir ./deprecations

Configure your client to use http://localhost:8080 as its HTTP(S) proxy.

Deprecation config

Layout: one folder per host pattern (the folder name is the baseUrl), one JSON file per deprecation notice inside each folder.

deprecations/
  {instance}.atlassian.net/
    issue-v2.json
    search-v2.json
    project-v2.json

Each JSON file:

{
  "summary": "Jira v2 issue endpoints are deprecated. Migrate to v3.",
  "deprecationDate": "2026-06-30",
  "link": "https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1234",
  "deprecations": [
    {"url": "/rest/api/2/issue/{issueIdOrKey}", "verbs": ["GET", "PUT", "DELETE"]}
  ]
}
  • summary, deprecationDate, link are optional — missing fields emit a warning at load time and are omitted from the response.
  • The same summary/deprecationDate/link applies to every rule in deprecations[].
  • When a request matches, the 410 response includes a reason object with whichever of those fields are present.

Matching rules:

  • {name} in baseUrl matches a single host label (no .). {instance}.atlassian.net matches roberto.atlassian.net but not foo.bar.atlassian.net.
  • {name} in url matches a single path segment (no /).
  • Verb match is case-insensitive. Use "*" for any method.
  • Host/path match is case-insensitive.
  • If the pattern URL includes a query string, those key/values are required on the incoming request (extra keys are tolerated). If the pattern has no query string, the incoming query string is ignored.

Control server

A small HTTP server runs on the control port (default 8081, localhost-only):

  • GET /deprecations — dump currently loaded rules.
  • POST /reload — re-read all *.json files from the deprecations folder. Use this to refresh after edits or after a future DB seed job runs.
  • POST /stop — gracefully shut the proxy down.
curl -s http://127.0.0.1:8081/deprecations
curl -s -X POST http://127.0.0.1:8081/reload
curl -s -X POST http://127.0.0.1:8081/stop

HTTPS

mitmproxy generates a self-signed CA on first run at ~/.mitmproxy/mitmproxy-ca-cert.pem. Clients must trust that CA to make HTTPS calls through the proxy.

If the proxy itself reaches the upstream through a TLS-intercepting hop (e.g. Netskope), point it at the corporate CA — the CLI forwards the value to mitmproxy's ssl_verify_upstream_trusted_ca:

poetry run deproxy --upstream-ca ~/.mitmproxy/appfire-netskope-ca.pem
# or via env (used as fallback in this order: $DEPROXY_UPSTREAM_CA, $SSL_CERT_FILE):
export DEPROXY_UPSTREAM_CA=~/.mitmproxy/appfire-netskope-ca.pem
poetry run deproxy

On macOS, export the corporate intermediate CA from the system keychain (Appfire example):

security find-certificate -a -c "ca.appfire.goskope.com" -p /Library/Keychains/System.keychain \
  > ~/.mitmproxy/appfire-netskope-ca.pem

Test

poetry run pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdeprecation_proxy-0.1.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mdeprecation_proxy-0.1.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file mdeprecation_proxy-0.1.0.tar.gz.

File metadata

  • Download URL: mdeprecation_proxy-0.1.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.6 Darwin/25.4.0

File hashes

Hashes for mdeprecation_proxy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c1622b2a486b5bad46fb3f46212def860c49fa811d7f0f0c538d074c387ebab3
MD5 e4020129a51db18bb3bf9194438eea73
BLAKE2b-256 f9fd80a256ed6bc8c844cb07655bfbd8e095ef5368d213c8a409a2cde3913483

See more details on using hashes here.

File details

Details for the file mdeprecation_proxy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mdeprecation_proxy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.6 Darwin/25.4.0

File hashes

Hashes for mdeprecation_proxy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb7e39b538cf2652cd6cf7bcba5b43eb72bfe28482ead2b35e21308cb0745dbb
MD5 da82954377d86446e9553f3fa9f55d45
BLAKE2b-256 e1e555c5d69ae775692e88461d873c444468534ef7362ef0cfd2011756a331b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page