Skip to content

Comments

fix(logging): enhance debug logging for auth headers#540

Open
d-klotz wants to merge 5 commits intonextfrom
feat/investigate-uninstall-issue
Open

fix(logging): enhance debug logging for auth headers#540
d-klotz wants to merge 5 commits intonextfrom
feat/investigate-uninstall-issue

Conversation

@d-klotz
Copy link
Contributor

@d-klotz d-klotz commented Feb 13, 2026

📦 Published PR as canary version: 2.0.0--canary.540.d07ab53.0

✨ Test out this PR locally via:

npm install @friggframework/core@2.0.0--canary.540.d07ab53.0
npm install @friggframework/devtools@2.0.0--canary.540.d07ab53.0
npm install @friggframework/eslint-config@2.0.0--canary.540.d07ab53.0
npm install @friggframework/prettier-config@2.0.0--canary.540.d07ab53.0
npm install @friggframework/schemas@2.0.0--canary.540.d07ab53.0
npm install @friggframework/serverless-plugin@2.0.0--canary.540.d07ab53.0
npm install @friggframework/test@2.0.0--canary.540.d07ab53.0
npm install @friggframework/ui@2.0.0--canary.540.d07ab53.0
# or 
yarn add @friggframework/core@2.0.0--canary.540.d07ab53.0
yarn add @friggframework/devtools@2.0.0--canary.540.d07ab53.0
yarn add @friggframework/eslint-config@2.0.0--canary.540.d07ab53.0
yarn add @friggframework/prettier-config@2.0.0--canary.540.d07ab53.0
yarn add @friggframework/schemas@2.0.0--canary.540.d07ab53.0
yarn add @friggframework/serverless-plugin@2.0.0--canary.540.d07ab53.0
yarn add @friggframework/test@2.0.0--canary.540.d07ab53.0
yarn add @friggframework/ui@2.0.0--canary.540.d07ab53.0

@d-klotz d-klotz added release Create a release when this pr is merged prerelease This change is available in a prerelease. labels Feb 13, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 234d64e3c0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 38 to 40
acc[key] = key === 'x-frigg-api-key' ? `${value.substring(0, 4)}...`
: key === 'authorization' ? `${value.split(' ')[0]} ...`
: value;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Redact all x-frigg API keys before logging headers

This redaction logic only masks x-frigg-api-key, but it logs every other x-frigg* header value verbatim, which can leak credentials into logs on any handled 4xx path. The codebase already uses other secret headers (x-frigg-health-api-key in packages/core/handlers/routers/health.js and x-frigg-admin-api-key in packages/core/handlers/routers/db-migration.js), so those keys will now be exposed if present when an error reaches this handler.

Useful? React with 👍 / 👎.

Comment on lines +73 to +75
console.log(
'[Frigg] No x-frigg-api-key header found, skipping shared secret authentication'
);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This console.log is incorrectly placed outside the if (apiKey) block. It will execute unconditionally after the shared secret check, logging "No x-frigg-api-key header found" even when an API key is present and authentication succeeds.

To fix, move this log inside an else block:

if (apiKey) {
    // ... authentication logic
} else {
    console.log('[Frigg] No x-frigg-api-key header found, skipping shared secret authentication');
}
Suggested change
console.log(
'[Frigg] No x-frigg-api-key header found, skipping shared secret authentication'
);
if (apiKey) {
// Authentication logic (existing code)
} else {
console.log(
'[Frigg] No x-frigg-api-key header found, skipping shared secret authentication'
);
}

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

prerelease This change is available in a prerelease. release Create a release when this pr is merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant