Skip to content

fix(xtest): detect java dpop support via supports subcommand#558

Merged
dmihalcik-virtru merged 1 commit into
mainfrom
java-dpop-supports-detection
Jul 14, 2026
Merged

fix(xtest): detect java dpop support via supports subcommand#558
dmihalcik-virtru merged 1 commit into
mainfrom
java-dpop-supports-detection

Conversation

@dmihalcik-virtru

@dmihalcik-virtru dmihalcik-virtru commented Jul 14, 2026

Copy link
Copy Markdown
Member

Problem

The java-sdk removed the user-facing --dpop / --dpop-key CLI flags in opentdf/java-sdk#374. DPoP is now always-on by default, and capability is exposed through the supports subcommand instead.

The Java wrapper's supports dpop case still detects DPoP by grepping help encrypt for the --dpop flag:

dpop)
  set -o pipefail
  java -jar "$SCRIPT_DIR"/cmdline.jar help encrypt | grep -iE -- '--dpop'
  exit $?
  ;;

With the flags gone this grep finds nothing, exits 1, and xtest skips java DPoP tests:

SKIPPED [2] tdfs.py:619: java@... sdk doesn't yet support [dpop]

The sibling dpop_nonce_challenge case already delegates to the supports subcommand and is unaffected.

Fix

Detect dpop the same way dpop_nonce_challenge already does — via the supports subcommand, whose exit code is the capability contract (0 = supported, 1 = not):

dpop)
  java -jar "$SCRIPT_DIR"/cmdline.jar supports dpop
  exit $?
  ;;

set -o pipefail is dropped since there's no longer a pipe.

Verification

With a current java cmdline.jar installed: ./cli.sh supports dpop; echo $? prints 0, and dpop_nonce_challenge still returns 0. Only xtest/sdk/java/cli.sh changes; other SDK wrappers are untouched.

Summary by CodeRabbit

  • Bug Fixes
    • Improved detection of DPoP support in the Java CLI feature probe.
    • Prevents incorrect results caused by relying on help output and flag matching.

The java-sdk removed the user-facing --dpop/--dpop-key CLI flags
(opentdf/java-sdk#374); DPoP is now always-on and capability is
exposed through the `supports` subcommand. The old detector grepped
`help encrypt` for --dpop, which now finds nothing and marks java as
not supporting dpop. Delegate to `cmdline.jar supports dpop` to match
the existing dpop_nonce_challenge case.

Signed-off-by: Dave Mihalcik <dmihalcik@virtru.com>
@dmihalcik-virtru
dmihalcik-virtru requested review from a team as code owners July 14, 2026 14:13
@sonarqubecloud

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request simplifies the 'dpop' support check in the xtest/sdk/java/cli.sh script. It replaces a pipeline that grepped the help output of the encrypt command with a direct call to supports dpop on the Java command-line utility. There are no review comments, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 41c6e600-0cb2-4dbf-ad95-043b83024161

📥 Commits

Reviewing files that changed from the base of the PR and between 66920c7 and 09e7ac0.

📒 Files selected for processing (1)
  • xtest/sdk/java/cli.sh

📝 Walkthrough

Walkthrough

The Java CLI script’s supports dpop probe now directly invokes the CLI’s DPoP support command instead of searching encryption help output for a flag.

Changes

DPoP feature probing

Layer / File(s) Summary
Direct DPoP support check
xtest/sdk/java/cli.sh
The dpop feature probe now runs java -jar ... supports dpop directly, removing the previous help-output grep and pipefail guard.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

Suggested reviewers: sujankota

Poem

I’m a bunny with a probe to run,
DPoP support checked direct in the sun.
No grep through help, no flags to seek,
One simple command makes the check sleek.
Hop, hop—cleaner logic this week!

🚥 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 summarizes the main change: switching Java DPoP capability detection to the supports subcommand.
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 java-dpop-supports-detection

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.

@dmihalcik-virtru
dmihalcik-virtru merged commit 9ed7af1 into main Jul 14, 2026
22 checks passed
@dmihalcik-virtru
dmihalcik-virtru deleted the java-dpop-supports-detection branch July 14, 2026 16:43
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