Skip to content

feat(web-app): send DPoP-Nonce on sample app requests (DSPX-3397) - #994

Draft
dmihalcik-virtru wants to merge 1 commit into
dspx-3397-6-dpop-noncefrom
dspx-3397-7-web-app-nonce
Draft

feat(web-app): send DPoP-Nonce on sample app requests (DSPX-3397)#994
dmihalcik-virtru wants to merge 1 commit into
dspx-3397-6-dpop-noncefrom
dspx-3397-7-web-app-nonce

Conversation

@dmihalcik-virtru

Copy link
Copy Markdown
Member

Stack level 7 of the DSPX-3397 split. Base: #993.

What

Teaches the sample browser app to participate in the DPoP-Nonce handshake so it keeps working against a Keycloak configured with require_nonce.

  • Token endpoint — Keycloak answers the first proof with HTTP 400 + DPoP-Nonce when nonces are required (RFC 9449 §8). The request now goes through the SDK's sendWithNonceRetry helper (exported in feat(sdk): handle DPoP-Nonce challenges (DSPX-3397) #993), so the proof is re-minted around the server-supplied nonce and retried once — rather than hand-rolling a sixth copy of that retry loop in the app.
  • Per-session nonce cache — adds a DPoPNonceCache on the session and threads the cached nonce into the proof withCreds mints for platform requests.
  • Auth scheme — switches Authorization from Bearer to DPoP, which is what RFC 9449 §7.1 requires for a DPoP-bound access token.
  • Playwright specweb-app/tests/tests/dpop-headers.spec.ts asserts the headers the app actually emits.

Why

The sample app is the manual smoke test for the SDK's DPoP path. Without this it can't exercise the nonce handshake #993 adds.

How to test

cd web-app && npm test        # vitest
cd web-app/tests && npm test  # playwright

Risk

Touches auth. The BearerDPoP scheme change is the behavioral one; it only affects the sample app, not the published SDK.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 34e98e4d-d3e2-4c4d-a04e-dd4c69ca304d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

Teaches the sample browser app to participate in the DPoP-Nonce handshake
so it keeps working against a Keycloak configured with `require_nonce`.

- Token endpoint: Keycloak answers the first proof with HTTP 400 +
  `DPoP-Nonce` when nonces are required (RFC 9449 §8). Wraps the request
  in the SDK's `sendWithNonceRetry` helper so the proof is re-minted
  around the server-supplied nonce and retried once, rather than
  hand-rolling a sixth copy of that retry loop in the app.
- Adds a per-session `DPoPNonceCache` and threads the cached nonce into
  the proof `withCreds` mints for platform requests.
- Switches the `Authorization` scheme from `Bearer` to `DPoP`, which is
  what RFC 9449 §7.1 requires for a DPoP-bound access token.
- Adds a Playwright spec covering the headers the app actually emits.

How to test: `cd web-app && npm test`, and `cd web-app/tests && npm test`
for the browser spec.

Signed-off-by: Dave Mihalcik <dmihalcik@virtru.com>
@dmihalcik-virtru
dmihalcik-virtru force-pushed the dspx-3397-7-web-app-nonce branch from e8178eb to 602e4ff Compare August 10, 2026 17:47
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 33%)

See analysis details on SonarQube Cloud

@github-actions

Copy link
Copy Markdown

X-Test Failure Report

opentdf-ctl
opentdf-sdk-lib

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.

1 participant