Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: obscure cross-space headers from response errors #532

Merged
merged 2 commits into from
Mar 10, 2025

Conversation

scuilla
Copy link
Contributor

@scuilla scuilla commented Mar 10, 2025

With the use of the extra header for cross-space resolution, errors include an unobscured encoded token map. This applies the same obscuring technique used for the Authorization header to the X-Contentful-Resource-Resolution one.

Example:

{
    "status": 404,
    "statusText": "Not Found",
    "message": "The resource could not be found.",
    "details": {
      "type": "Space",
      "id": "J2Lo0Dwdxt"
    },
    "request": {
      "url": "https://preview.contentful.com:443/spaces/J2Lo0Dwdxt/environments/master/entries",
      "headers": {
        "Accept": "application/json, text/plain, */*",
        "Content-Type": "application/vnd.contentful.delivery.v1+json",
        "X-Contentful-Resource-Resolution": "...9fQ==",
        "X-Contentful-User-Agent": "sdk contentful.js/11.5.4; platform node.js/v22.13.1; os macOS/v22.13.1;",
        "Authorization": "Bearer ...i_KuA",
        "User-Agent": "axios/1.8.1",
        "Accept-Encoding": "gzip, compress, deflate, br"
      },
      "method": "get"
    },
    "requestId": "10621051-215d-55cc-87fa-b00d4f550218"
  }

@scuilla scuilla requested a review from a team as a code owner March 10, 2025 01:37
@jjolton-contentful jjolton-contentful merged commit c00beb9 into contentful:master Mar 10, 2025
6 checks passed
@contentful-automation
Copy link

🎉 This PR is included in version 9.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants