Skip to content

fix(pds-core): redact request_uri from CSS middleware log - #80

Open
aspiers wants to merge 2 commits into
mainfrom
fix/redact-request-uri-in-logs
Open

fix(pds-core): redact request_uri from CSS middleware log#80
aspiers wants to merge 2 commits into
mainfrom
fix/redact-request-uri-in-logs

Conversation

@aspiers

@aspiers aspiers commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Stop logging raw PAR request_uri values in the CSS injection middleware's warn log. Log only presence (hasRequestUri: true) since the URI is an opaque short-lived handle.

Addresses CodeRabbit review comment on PR #48: #48 (comment)

Test plan

  • Existing unit tests pass (19/19 in client-css-injection.test.ts)
  • Verify Railway pds-core logs no longer contain raw request_uri values

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved error logging during client-side CSS injection by avoiding potentially sensitive request URI details while retaining relevant diagnostic information.
  • Chores

    • Updated code coverage thresholds for reporting and failure detection.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.

Once credits are available, reopen this pull request to trigger a review.

@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The changes add Coveralls coverage thresholds and replace a logged request URI value with a boolean presence indicator in client CSS injection error handling.

Changes

Coverage configuration

Layer / File(s) Summary
Coveralls thresholds
.coveralls.yml
Adds coverage_decreased_threshold: 0.05 and coverage_threshold_for_failure: 32.3.

Error logging metadata

Layer / File(s) Summary
Request URI logging metadata
packages/pds-core/src/lib/client-css-injection.ts
Changes warning metadata from the request URI value to hasRequestUri: true while retaining the caught error.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main pds-core change: redacting request_uri from the CSS middleware warning log.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/redact-request-uri-in-logs

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed: private package registry requires authentication. Disable ESLint in CodeRabbit settings or use public packages.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@vercel

vercel Bot commented Apr 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
epds-demo Ready Ready Preview, Comment Jul 14, 2026 10:04pm

Request Review

@railway-app

railway-app Bot commented Apr 14, 2026

Copy link
Copy Markdown

🚅 Deployed to the ePDS-pr-80 environment in ePDS

Service Status Web Updated (UTC)
@certified-app/pds-core ✅ Success (View Logs) Web Jul 14, 2026 at 10:08 pm
@certified-app/demo ✅ Success (View Logs) Web Apr 14, 2026 at 3:32 pm
@certified-app/demo untrusted ✅ Success (View Logs) Web Apr 14, 2026 at 2:52 pm
@certified-app/auth-service ✅ Success (View Logs) Web Apr 14, 2026 at 2:52 pm

@coveralls-official

coveralls-official Bot commented Apr 14, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 29371698031

Coverage remained the same at 56.404%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 2977
Covered Lines: 1670
Line Coverage: 56.1%
Relevant Branches: 1840
Covered Branches: 1047
Branch Coverage: 56.9%
Branches in Coverage %: Yes
Coverage Strength: 5.91 hits per line

💛 - Coveralls

@sonarqubecloud

Copy link
Copy Markdown

aspiers and others added 2 commits July 14, 2026 23:03
request_uri is an opaque PAR handle that should not be logged
verbatim. Log only its presence for debugging.

Addresses CodeRabbit review on PR #48.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Allow up to 0.05% coverage drop per PR to absorb measurement jitter,
and set 32.3% absolute floor to prevent unbounded ratchet drift.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@aspiers
aspiers force-pushed the fix/redact-request-uri-in-logs branch from 5991f75 to 0dfb6cd Compare July 14, 2026 22:03
Copilot AI review requested due to automatic review settings July 14, 2026 22:03
@changeset-bot

changeset-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0dfb6cd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens log hygiene in pds-core by ensuring the CSS injection middleware no longer logs opaque PAR request_uri values, while also adding a Coveralls configuration to enforce coverage-related CI thresholds.

Changes:

  • Redact raw PAR request_uri from the CSS middleware warning log (log only presence via hasRequestUri).
  • Add .coveralls.yml to configure Coveralls coverage thresholds for CI reporting.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/pds-core/src/lib/client-css-injection.ts Replaces logging of raw requestUri with a boolean presence flag in the error path.
.coveralls.yml Introduces Coveralls thresholds for coverage decrease tolerance and failure gating.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.coveralls.yml:
- Around line 1-2: Remove the coverage_decreased_threshold and
coverage_threshold_for_failure entries from .coveralls.yml, leaving only
supported Coveralls configuration there. Configure both coverage thresholds
through the Coveralls repository settings or API so the intended coverage gate
is enforced.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 59479769-9c8a-4e7b-95eb-16d97dd157fd

📥 Commits

Reviewing files that changed from the base of the PR and between 78d9769 and 0dfb6cd.

📒 Files selected for processing (2)
  • .coveralls.yml
  • packages/pds-core/src/lib/client-css-injection.ts

Comment thread .coveralls.yml
Comment on lines +1 to +2
coverage_decreased_threshold: 0.05
coverage_threshold_for_failure: 32.3

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== .coveralls.yml =="
if [ -f .coveralls.yml ]; then
  cat -n .coveralls.yml
fi

echo
echo "== Search for coveralls references =="
rg -n --hidden -S "coveralls|coverage_decreased_threshold|coverage_threshold_for_failure|commit_status_fail_threshold|commit_status_fail_change_threshold" .

echo
echo "== Relevant CI workflow files =="
fd -a -t f '.github/workflows' .

Repository: hypercerts-org/ePDS

Length of output: 895


🌐 Web query:

site:docs.coveralls.io coverage_decreased_threshold coverage_threshold_for_failure .coveralls.yml

💡 Result:

The settings for controlling build failures based on coverage metrics in Coveralls are configured via the Coveralls web interface rather than through the.coveralls.yml file [1][2]. In the Coveralls UI, you can manage these thresholds under the repository settings for Status Updates [1][2]. The relevant configurations are: 1. Coverage Threshold for Failure: This defines the minimum coverage percentage required for a build to pass [3]. 2. Coverage Decrease Threshold for Failure (often referred to as the "Decrease threshold"): This sets the maximum allowable decrease in coverage from the previous build before a failure is triggered [1][3]. While the.coveralls.yml file is used to configure integration-specific variables (such as repo_token, service_name, or branch) [4], it does not natively support setting these specific failure thresholds. These thresholds are handled by the Coveralls backend API, which processes incoming build data and reports status updates (such as "failed" or "passed") back to your Git provider (e.g., GitHub) based on the settings defined in the web UI [1][3]. If you are using the Coveralls API directly, these settings correspond to the following parameters on the /repos endpoint [3]: - commit_status_fail_threshold [3] - commit_status_fail_change_threshold [3]

Citations:


🌐 Web query:

"coverage_decreased_threshold" Coveralls repository status settings API

💡 Result:

The setting you are referring to is managed through the Coveralls API via the commit_status_fail_change_threshold parameter [1][2]. This setting corresponds to the "Coverage Decrease Threshold for Failure" option found in the repository settings page on the Coveralls web interface [3]. When using the Coveralls /repos API endpoint, you can configure this threshold to control build failure behavior [1][4]: - API Parameter: repo[commit_status_fail_change_threshold] [1] - Purpose: Defines the maximum allowed percentage decrease in coverage before a build is marked as failed [1][3]. - Default: null (which defaults to failure on any decrease) [1]. You can interact with this setting by sending a POST or PUT request to the repository endpoint [1][4]. Below is a summary of the relevant API fields for repository configuration: - commit_status_fail_threshold: Sets the absolute minimum coverage percentage required for a build to pass [1][5]. - commit_status_fail_change_threshold: Sets the tolerance for coverage decreases (e.g., if set to 1.0, a decrease of less than 1% will not cause the build to fail) [1][3][5]. These settings ensure that pull request status checks only block when the specified coverage drop thresholds are exceeded [3][6]. If you are automating this process, the same parameters can be used programmatically to update your repository configuration [4].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Try to identify any local docs or config schema references for these keys.
rg -n --hidden -S "coverage_decreased_threshold|coverage_threshold_for_failure|commit_status_fail_threshold|commit_status_fail_change_threshold" . || true

# Show the repository workflows mentioning Coveralls.
rg -n --hidden -S "coverallsapp/github-action|coveralls" .github . || true

Repository: hypercerts-org/ePDS

Length of output: 413


Move the coverage thresholds to Coveralls settings.

coverage_decreased_threshold and coverage_threshold_for_failure belong in Coveralls repository settings/API, not .coveralls.yml, so this file won’t enforce the intended coverage gate. Remove them here and set the thresholds through Coveralls instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.coveralls.yml around lines 1 - 2, Remove the coverage_decreased_threshold
and coverage_threshold_for_failure entries from .coveralls.yml, leaving only
supported Coveralls configuration there. Configure both coverage thresholds
through the Coveralls repository settings or API so the intended coverage gate
is enforced.

@blacksmith-sh

blacksmith-sh Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Found 58 test failures on Blacksmith runners:

Failures

Test View Logs
Cucumber//favicon.ico alias serves an SVG on both services - #1.2 View Logs
Cucumber/Account settings login uses standalone OTP View Logs
Cucumber/Auth-service login page references both favicon variants View Logs
Cucumber/Backup email verification link is delivered View Logs
Cucumber/Button is rendered when the client declares epds_handle_login_url View Logs
Cucumber/
Clicking Resend after the PAR has died bails to the OAuth client without issuing a new
OTP
View Logs
Cucumber/Clicking the button again returns to email-entry mode View Logs
Cucumber/Clicking the button toggles the email form into handle-entry mode View Logs
Cucumber/
Demo client's OAuth cookie has expired by the time of callback — useful error, not gene
ric auth_failed
View Logs
Cucumber/DID login hint is resolved and skips the email form View Logs
Cucumber/Email login hint skips the email form View Logs
Cucumber/Existing user sees consent screen for a new client View Logs
Cucumber/Expired OTP + expired PAR — clean exit back to the OAuth client View Logs
Cucumber/Expired OTP is rejected, resend recovers the flow View Logs
Cucumber/Expired PAR redirects back to the OAuth client instead of stranding the user View Logs
Cucumber/Favicon SVG assets are served on both services - #1.3 View Logs
Cucumber/Favicon SVG assets are served on both services - #1.4 View Logs
Cucumber/First-time user gets an auto-created PDS account View Logs
Cucumber/Handle login hint is resolved and skips the email form View Logs
Cucumber/Login hint from PAR body is used when not on query string View Logs
Cucumber/New user authenticates with email OTP View Logs
Cucumber/New user receives a welcome OTP email View Logs
Cucumber/New user skips consent when signing up via a trusted client View Logs
Cucumber/New user still sees consent when signing up via an untrusted client View Logs
Cucumber/OAuth flow expires after the auth_flow TTL elapses View Logs
Cucumber/OTP form's heartbeat reaches /auth/ping with ok:true View Logs
Cucumber/OTP verification rejects wrong code View Logs
Cucumber/Password-based login does not work for auto-created accounts View Logs
Cucumber/prompt=login + expired PAR — clean exit back to the OAuth client View Logs
Cucumber/Recovery via backup email + expired PAR — clean exit back to the OAuth client View Logs
Cucumber/Recovery with non-existent email shows same UI (anti-enumeration) View Logs
Cucumber/Resend button is hidden when the PAR has died — Start over is offered instead View Logs
Cucumber/Returning user authenticates with email OTP View Logs
Cucumber/Returning user receives a sign-in OTP email View Logs
Cucumber/Returning user skips consent for a previously-approved untrusted client View Logs
Cucumber/Returning user who has already approved skips consent View Logs
Cucumber/Sign-up consent skip does not carry over to a second client View Logs
Cucumber/Submitting a handle redirects to the client's handle login URL View Logs
Cucumber/Too many failed OTP attempts locks out the token View Logs
Cucumber/Trusted client's CSS is applied to the choose-handle page View Logs
Cucumber/Trusted client's CSS is applied to the login page View Logs
Cucumber/Trusted client's CSS is applied to the recovery page View Logs
Cucumber/Trusted client's CSS is applied to the upstream OAuth consent page View Logs
Cucumber/Trusted client's favicon is applied to the choose-handle page View Logs
Cucumber/Trusted client's favicon is applied to the login page View Logs
Cucumber/Trusted client's favicon is applied to the recovery page View Logs
Cucumber/Two Resend cycles after silent PAR death — clean exit back to the OAuth client View Logs
Cucumber/Unknown login hint falls back to email form View Logs
Cucumber/Untrusted client does not get CSS injection View Logs
Cucumber/Untrusted client does not get favicon injection View Logs
Cucumber/User adds and verifies a backup email View Logs
Cucumber/User changes their handle View Logs
Cucumber/User deletes their account View Logs
Cucumber/User denies consent View Logs
Cucumber/User recovers account via verified backup email View Logs
Cucumber/User removes a backup email View Logs
Cucumber/User views and revokes a session View Logs
Cucumber/User views their account information View Logs

Fix in Cursor

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.

2 participants