Skip to content

[CTM-534] check for requester pays#2111

Draft
calypsomatic wants to merge 1 commit into
developfrom
bm/ctm-534_requester-pays
Draft

[CTM-534] check for requester pays#2111
calypsomatic wants to merge 1 commit into
developfrom
bm/ctm-534_requester-pays

Conversation

@calypsomatic

@calypsomatic calypsomatic commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Jira ticket: https://broadworkbench.atlassian.net/browse/CTM-534

Addresses

TDR was using the x-user-project header as the billing project on any signed URL request, regardless of whether the snapshot had requireUserProject=true. Since Terra clients always send this header, all TDR-hosted data (HCA, LungMAP, etc.) was being charged to users — not just AnVIL requester-pays snapshots. This pr gates userProject usage in getUrlSigningOptions and signGoogleUrl on cachedSnapshot.requireUserProject, so TDR only bills the caller when the snapshot explicitly requires it.

Summary of changes

DrsService.java

  • getUrlSigningOptions: only uses caller's userProject as billing project when cachedSnapshot.requireUserProject is true
  • signGoogleUrl self-hosted branch: same gate — only routes through SAM with userProject when requireUserProject is true

DrsServiceTest.java

  • testSignGcpUrl: added snapshot.requireUserProject(true) for the parameterized cases where a billing project is provided — those cases now explicitly test the RP scenario
  • testSignGcpUrlWithTokenVariations: added snapshot.requireUserProject(true) to correctly represent a self-hosted AnVIL snapshot
  • New test getAccessUrlIgnoresUserProjectForNonRequesterPaysSnapshot: verifies the regression — non-RP snapshot with userProject provided succeeds but doesn't call SAM with the caller's project

Testing Strategy

@sonarqubecloud

Copy link
Copy Markdown

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