{
 "action": "Not for automatic application — format removed: there is no replacement to apply. Show this correction to the user as a lead. enable_jsonp is not available in oauthlib 4.0.0; remove or replace this use. The same code works on oauthlib 3.3.1: pin a version before 4.0.0 if you cannot change the code. Release notes: endpoint = RevocationEndpoint(validator)",
 "alternatives": [
  {
   "action": "Not for automatic application — the fix's output differs from the original's. Show this correction to the user as a lead. Review before applying: this fix runs on oauthlib 4.0.0, but its printed output differs from what the original printed on 3.3.1 (observed stdout of one example) — it may do different work. Replace the old line with the new one; the rest of the code can stay.",
   "applicability": {
    "exit_code": 0,
    "line": 28,
    "method": "literal_patch",
    "occurrences": 1,
    "output": "same",
    "patched_sha": "27a9396e03ba",
    "reason": "applied word for word, the patch parses, drops the old names, runs on 4.0.0 and prints what the verified example prints",
    "run_on": "4.0.0",
    "status": "applies"
   },
   "by_notes": true,
   "changelog_ref": {
    "quote": "Removed JSONP support from token revocation endpoint (#951)",
    "url": "https://github.com/oauthlib/oauthlib/releases/tag/v4.0.0"
   },
   "confirmations": 3,
   "detect": [
    "enable_jsonp"
   ],
   "equivalence": "differs",
   "format": "replace",
   "kind": "behavior_changed",
   "right": "endpoint = RevocationEndpoint(validator)",
   "script_right": "from urllib.parse import urlencode\nfrom oauthlib.oauth2 import RequestValidator, RevocationEndpoint\n\n\nclass MinimalRequestValidator(RequestValidator):\n    def authenticate_client(self, request):\n        if (\n            request.client_id == \"test_client\"\n            and request.client_secret == \"test_secret\"\n        ):\n            request.client = \"test_client\"\n            return True\n        return False\n\n    def client_authentication_required(self, request):\n        return True\n\n    def authenticate_client_id(self, client_id, request):\n        return client_id == \"test_client\"\n\n    def revoke_token(self, token, token_type_hint, request):\n        # In-memory revocation validator: accepts any token\n        pass\n\n\ndef main():\n    validator = MinimalRequestValidator()\n    endpoint = RevocationEndpoint(validator)\n\n    uri = \"https://example.com/oauth/revoke\"\n    post_data = {\n        \"token\": \"sample_token_to_revoke\",\n        \"token_type_hint\": \"access_token\",\n        \"callback\": \"handleRevoke\",\n        \"client_id\": \"test_client\",\n        \"client_secret\": \"test_secret\",\n    }\n    body = urlencode(post_data)\n    headers = {\"Content-Type\": \"application/x-www-form-urlencoded\"}\n\n    resp_headers, resp_body, status_code = endpoint.create_revocation_response(\n        uri=uri,\n        http_method=\"POST\",\n        body=body,\n        headers=headers,\n    )\n\n    print(f\"Status Code: {status_code}\")\n    print(f\"Headers: {resp_headers}\")\n    print(f\"Body: {resp_body}\")\n\n\nif __name__ == \"__main__\":\n    main()",
   "script_wrong": "from urllib.parse import urlencode\nfrom oauthlib.oauth2 import RequestValidator, RevocationEndpoint\n\n\nclass MinimalRequestValidator(RequestValidator):\n    def authenticate_client(self, request):\n        if (\n            request.client_id == \"test_client\"\n            and request.client_secret == \"test_secret\"\n        ):\n            request.client = \"test_client\"\n            return True\n        return False\n\n    def client_authentication_required(self, request):\n        return True\n\n    def authenticate_client_id(self, client_id, request):\n        return client_id == \"test_client\"\n\n    def revoke_token(self, token, token_type_hint, request):\n        # In-memory revocation validator: accepts any token\n        pass\n\n\ndef main():\n    validator = MinimalRequestValidator()\n    endpoint = RevocationEndpoint(validator, enable_jsonp=True)\n\n    uri = \"https://example.com/oauth/revoke\"\n    post_data = {\n        \"token\": \"sample_token_to_revoke\",\n        \"token_type_hint\": \"access_token\",\n        \"callback\": \"handleRevoke\",\n        \"client_id\": \"test_client\",\n        \"client_secret\": \"test_secret\",\n    }\n    body = urlencode(post_data)\n    headers = {\"Content-Type\": \"application/x-www-form-urlencoded\"}\n\n    resp_headers, resp_body, status_code = endpoint.create_revocation_response(\n        uri=uri,\n        http_method=\"POST\",\n        body=body,\n        headers=headers,\n    )\n\n    print(f\"Status Code: {status_code}\")\n    print(f\"Headers: {resp_headers}\")\n    print(f\"Body: {resp_body}\")\n\n\nif __name__ == \"__main__\":\n    main()",
   "seen_in_models": [
    "gemini-3.8-flash",
    "gpt-6.1-sol"
   ],
   "wrong": "endpoint = RevocationEndpoint(validator, enable_jsonp=True)"
  }
 ],
 "applicability": {
  "method": "literal_patch",
  "reason": "format removed: there is no replacement to apply",
  "run_on": "4.0.0",
  "status": "not_applicable"
 },
 "by_notes": true,
 "changelog_ref": {
  "quote": "Removed JSONP support from token revocation endpoint (#951)",
  "url": "https://github.com/oauthlib/oauthlib/releases/tag/v4.0.0"
 },
 "confirmations": {
  "failed": 0,
  "worked": 4
 },
 "detect": [
  "enable_jsonp"
 ],
 "ecosystem": "pypi",
 "equivalence": "not_comparable",
 "error_kind": "unexpected_kwarg",
 "error_signature": {
  "message": "RevocationEndpoint.__init__() got an unexpected keyword argument 'enable_jsonp'",
  "norm": "unexpected_kwarg:enable_jsonp",
  "type": "TypeError"
 },
 "first_seen": "2026-10-20T16:11:13+00:00",
 "format": "removed",
 "format_version": 2,
 "id": "pypi/oauthlib/4.0.0/0001",
 "kind": "removed",
 "license": "https://creativecommons.org/licenses/by/4.0/",
 "package": "oauthlib",
 "proof": {
  "applicability": {
   "method": "literal_patch",
   "reason": "format removed: there is no replacement to apply",
   "run_on": "4.0.0",
   "status": "not_applicable"
  },
  "auto_apply": false,
  "auto_apply_reason": "the fix's output was not compared; the patch gives not_applicable when applied word for word",
  "auto_apply_rule": "Automatic application is allowed only when proof.equivalent is true and proof.applicability.status is applies; otherwise show the correction to the user as a lead and do not apply it on your own.",
  "equivalence": "not_comparable",
  "equivalent": null,
  "fails_on": "4.0.0",
  "fixed_on": "4.0.0",
  "level": "differential",
  "method": {
   "fix_on": "4.0.0",
   "name": "stdout_match",
   "normalization": "lines stripped, blank lines dropped, runs of whitespace collapsed; memory addresses, timestamps and temporary paths masked",
   "original_on": "3.3.1",
   "scope": "the observable stdout of one example script; return values, files, other inputs and exception types are not compared, so a match is not a proof of equivalent behaviour"
  },
  "script_right": "from types import SimpleNamespace\nfrom urllib.parse import urlencode\nfrom hmac import compare_digest\n\nfrom oauthlib.oauth2 import RequestValidator, RevocationEndpoint\n\n\nclass InMemoryValidator(RequestValidator):\n    CLIENT_ID = \"demo-client\"\n    CLIENT_SECRET = \"demo-secret\"\n\n    def __init__(self):\n        self.revoked_tokens = set()\n\n    def client_authentication_required(self, request, *args, **kwargs):\n        return True\n\n    def authenticate_client(self, request, *args, **kwargs):\n        valid = (\n            compare_digest(request.client_id or \"\", self.CLIENT_ID)\n            and compare_digest(request.client_secret or \"\", self.CLIENT_SECRET)\n        )\n        if valid:\n            request.client = SimpleNamespace(client_id=self.CLIENT_ID)\n        return valid\n\n    def revoke_token(self, token, token_type_hint, request, *args, **kwargs):\n        # Accept any token, including tokens not previously seen.\n        self.revoked_tokens.add(token)\n\n\ndef main():\n    validator = InMemoryValidator()\n    endpoint = RevocationEndpoint(\n        validator,\n        supported_token_types=[\"access_token\", \"refresh_token\"],\n    )\n\n    body = urlencode({\n        \"client_id\": validator.CLIENT_ID,\n        \"client_secret\": validator.CLIENT_SECRET,\n        \"token\": \"arbitrary-demo-token\",\n        \"token_type_hint\": \"access_token\",\n        \"callback\": \"handleRevoke\",\n    })\n\n    headers, response_body, status_code = endpoint.create_revocation_response(\n        \"https://example.invalid/oauth/revoke\",\n        http_method=\"POST\",\n        body=body,\n        headers={\"Content-Type\": \"application/x-www-form-urlencoded\"},\n    )\n\n    print(\"Status code:\", status_code)\n    print(\"Headers:\", headers)\n    print(\"Body:\", response_body)\n\n\nif __name__ == \"__main__\":\n    main()",
  "script_wrong": "from types import SimpleNamespace\nfrom urllib.parse import urlencode\nfrom hmac import compare_digest\n\nfrom oauthlib.oauth2 import RequestValidator, RevocationEndpoint\n\n\nclass InMemoryValidator(RequestValidator):\n    CLIENT_ID = \"demo-client\"\n    CLIENT_SECRET = \"demo-secret\"\n\n    def __init__(self):\n        self.revoked_tokens = set()\n\n    def client_authentication_required(self, request, *args, **kwargs):\n        return True\n\n    def authenticate_client(self, request, *args, **kwargs):\n        valid = (\n            compare_digest(request.client_id or \"\", self.CLIENT_ID)\n            and compare_digest(request.client_secret or \"\", self.CLIENT_SECRET)\n        )\n        if valid:\n            request.client = SimpleNamespace(client_id=self.CLIENT_ID)\n        return valid\n\n    def revoke_token(self, token, token_type_hint, request, *args, **kwargs):\n        # Accept any token, including tokens not previously seen.\n        self.revoked_tokens.add(token)\n\n\ndef main():\n    validator = InMemoryValidator()\n    endpoint = RevocationEndpoint(\n        validator,\n        supported_token_types=[\"access_token\", \"refresh_token\"],\n        enable_jsonp=True,\n    )\n\n    body = urlencode({\n        \"client_id\": validator.CLIENT_ID,\n        \"client_secret\": validator.CLIENT_SECRET,\n        \"token\": \"arbitrary-demo-token\",\n        \"token_type_hint\": \"access_token\",\n        \"callback\": \"handleRevoke\",\n    })\n\n    headers, response_body, status_code = endpoint.create_revocation_response(\n        \"https://example.invalid/oauth/revoke\",\n        http_method=\"POST\",\n        body=body,\n        headers={\"Content-Type\": \"application/x-www-form-urlencoded\"},\n    )\n\n    print(\"Status code:\", status_code)\n    print(\"Headers:\", headers)\n    print(\"Body:\", response_body)\n\n\nif __name__ == \"__main__\":\n    main()",
  "works_on": "3.3.1"
 },
 "right": "",
 "seen_in_models": [
  "gemini-3.8-flash",
  "gpt-6.1-sol"
 ],
 "seq": 1,
 "slug": "revocationendpoint",
 "source": "pipeline",
 "symbol": "RevocationEndpoint",
 "updated": "2026-10-27T17:20:00+00:00",
 "url": "https://formachines.ai/errata/pypi/oauthlib/0001-revocationendpoint/",
 "variant_confirmations": 1,
 "variant_models": [
  "gpt-6.1-sol"
 ],
 "verified": "sandbox",
 "versions": {
  "changed_in": ">3.3.1,<=4.0.0",
  "fails_on": "4.0.0",
  "works_on": "3.3.1"
 },
 "wrong": "enable_jsonp=True,"
}