Skip to content

misc 0.6.9 improvements - #1359

Merged
eschultink merged 6 commits into
rc-v0.6.9from
s230-misc-0.6.9-improve
Jul 30, 2026
Merged

misc 0.6.9 improvements#1359
eschultink merged 6 commits into
rc-v0.6.9from
s230-misc-0.6.9-improve

Conversation

@eschultink

@eschultink eschultink commented Jul 28, 2026

Copy link
Copy Markdown
Member

Features

  • add REQUEST_PATH_PREFIX_TO_TRIM so API connectors can strip a configured inbound path prefix before routing requests to the upstream API. This supports deployments where clients hit the proxy under a fixed base path that should not be forwarded downstream.
  • ensure mvn build option to skip nlp download is true by default, and omitted wherever that's appropriate
  • allowQueryParams case-insensitive

Change implications

  • dependencies added/changed? no
  • something important to note in future release notes?
    • NOTE in CHANGELOG.md anything that will show up in terraform plan/apply that isn't obviously a no-op?
      • New optional connector config REQUEST_PATH_PREFIX_TO_TRIM; no Terraform plan/apply impact unless explicitly configured.
    • breaking changes? if in module/example that is NOT marked alpha, requires major version change
      • No — additive configuration only; existing connectors behave unchanged when unset.

Support trimming a configured path prefix and function name before rule matching and outbound URL construction, with host-module Terraform wiring on AWS and GCP.

Co-authored-by: Cursor <cursoragent@cursor.com>
@eschultink eschultink self-assigned this Jul 28, 2026

@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.

Claude Code Review

Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.

Tip: disable this comment in your organization's Code Review settings.

eschultink and others added 2 commits July 28, 2026 09:51
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@eschultink eschultink changed the title S230 : misc 0.6.9 improve misc 0.6.9 improvements Jul 28, 2026

Copilot AI 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.

Pull request overview

Adds API-mode request path normalization to support deployments behind a fixed inbound base path, makes allowedQueryParams checks case-insensitive, and updates OpenNLP model-download behavior to be skipped by default (with CI explicitly enabling downloads).

Changes:

  • Introduces REQUEST_PATH_PREFIX_TO_TRIM (config + Terraform wiring) and normalizes inbound paths for both rule-matching and outbound target URL construction.
  • Makes allowedQueryParams enforcement case-insensitive and documents the behavior.
  • Sets OpenNLP model download to skipped by default in Maven, removing now-redundant flags from scripts and updating CI to opt-in.

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/release/generate-sbom.sh Removes explicit OpenNLP skip flags relying on new default behavior.
tools/lib/maven-local-repo.sh Removes documentation of PSOXY_SKIP_OPENNLP (no longer used).
tools/build.sh Removes PSOXY_SKIP_OPENNLP plumbing and related Maven flags.
java/pom.xml Sets <skipOpenNlpModelDownload> default to true.
java/impl/gcp/src/main/java/co/worklytics/psoxy/CloudFunctionRequest.java Stops stripping function name in adapter; defers to shared normalizer/handler logic.
java/gateway-core/src/test/java/com/avaulta/gateway/rules/augments/SentenceMetadataProcessorTest.java Updates guidance text to reflect new default skip behavior.
java/gateway-core/src/main/java/com/avaulta/gateway/rules/Endpoint.java Clarifies allowed query params are matched case-insensitively.
java/core/src/test/java/co/worklytics/test/TestModules.java Adds mock config for new requestPathPrefixToTrim config getter.
java/core/src/test/java/co/worklytics/psoxy/storage/impl/BulkDataSanitizerImplTest.java Adds HostEnvironment module to satisfy new injection dependency.
java/core/src/test/java/co/worklytics/psoxy/rules/RulesBaseTestCase.java Adds HostEnvironment module to satisfy new injection dependency.
java/core/src/test/java/co/worklytics/psoxy/impl/SanitizerUtilsTest.java Adds HostEnvironment module to satisfy new injection dependency.
java/core/src/test/java/co/worklytics/psoxy/impl/RESTApiSanitizerImplTest.java Adds coverage for path normalization and case-insensitive allowed query params.
java/core/src/test/java/co/worklytics/psoxy/impl/RESTApiSanitizerImplConcurrencyTest.java Adds HostEnvironment module to satisfy new injection dependency.
java/core/src/test/java/co/worklytics/psoxy/gateway/InboundRequestPathNormalizerTest.java New unit tests for inbound path prefix trimming and function-name stripping.
java/core/src/test/java/co/worklytics/psoxy/gateway/impl/ApiDataRequestHandlerTest.java Adds HostEnvironment module to satisfy new injection dependency.
java/core/src/test/java/co/worklytics/psoxy/gateway/impl/ApiDataRequestHandlerConcurrencyTest.java Adds HostEnvironment module to satisfy new injection dependency.
java/core/src/test/java/co/worklytics/psoxy/gateway/ApiModeConfigTest.java Adds coverage for new REQUEST_PATH_PREFIX_TO_TRIM config property parsing.
java/core/src/main/java/co/worklytics/psoxy/impl/RESTApiSanitizerImpl.java Implements case-insensitive allowed query param checks; adds shared path normalization before rule matching.
java/core/src/main/java/co/worklytics/psoxy/gateway/InboundRequestPathNormalizer.java New shared path normalizer to trim configured prefix and function-name segment.
java/core/src/main/java/co/worklytics/psoxy/gateway/impl/ApiDataRequestHandler.java Uses shared normalizer when constructing the outbound upstream URL.
java/core/src/main/java/co/worklytics/psoxy/gateway/ApiModeConfig.java Adds REQUEST_PATH_PREFIX_TO_TRIM property and accessor.
infra/modules/psoxy-package/build.sh Removes explicit OpenNLP skip flags relying on new default behavior.
infra/modules/gcp-host/variables.tf Adds api_connector_path_prefix_to_trim variable for GCP host module.
infra/modules/gcp-host/main.tf Wires REQUEST_PATH_PREFIX_TO_TRIM env var into API connectors (GCP).
infra/modules/aws-host/variables.tf Adds api_connector_path_prefix_to_trim variable for AWS host module.
infra/modules/aws-host/main.tf Wires REQUEST_PATH_PREFIX_TO_TRIM env var into API connectors (AWS).
docs/configuration/api-data-sanitization.md Documents case-insensitive allowedQueryParams behavior.
CHANGELOG.md Adds 0.6.9 note for case-insensitive allowedQueryParams.
AGENTS.md Adds agent guidance on DI preference and config property placement.
.github/workflows/build-java.yaml Forces OpenNLP model download in CI compile/test steps.

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

Comment on lines +3 to +30
import javax.inject.Inject;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

/**
* Normalizes inbound HTTP paths for API-mode rule matching and outbound URL construction.
*
* <p>Strips an optional configured path prefix ({@link ApiModeConfig.ApiModeConfigProperty#REQUEST_PATH_PREFIX_TO_TRIM}),
* then removes the deployed function name segment ({@link HostEnvironment#getInstanceId()}).
*/
@NoArgsConstructor(onConstructor_ = @Inject)
public class InboundRequestPathNormalizer {

@Inject
ApiModeConfig apiModeConfig;
@Inject
HostEnvironment hostEnvironment;

public String normalize(String rawPath) {
String path = apiModeConfig.getRequestPathPrefixToTrim()
.map(prefix -> stripLeadingPathPrefix(rawPath, prefix))
.orElse(rawPath);
String functionName = hostEnvironment.getInstanceId();
if (StringUtils.isNotBlank(functionName)) {
path = path.replace(functionName + "/", "");
}
return path;
}
Comment thread .github/workflows/build-java.yaml Outdated
working-directory: java/
run: |
mvn clean compile -T 2C -Dversions.logOutput=false
mvn clean compile -T 2C -Dversions.logOutput=false -DskipOpenNlpModelDownload=false

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.

Do we need this @eschultink ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it should skip by default; and we should need to download ONLY when it's running tests that use NLP transforms in CI.

Add Dependabot config for /java and publish resolved transitive deps on main/rc pushes so GitHub can surface Maven CVEs; bump single-JDK workflows to JDK 25 while pom.xml remains Java 21.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread CHANGELOG.md

## [Unreleased]
## [0.6.9]
- `allowedQueryParams` rule checks are now case-insensitive (e.g., `$top` and `$TOP` are treated as equivalent).

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.

Thanks, forgot to include this

Comment thread .github/workflows/build-java.yaml Outdated
working-directory: java/
run: |
mvn clean compile -T 2C -Dversions.logOutput=false
mvn clean compile -T 2C -Dversions.logOutput=false -DskipOpenNlpModelDownload=false

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.

Do we need this @eschultink ?

eschultink and others added 2 commits July 30, 2026 06:52
- Strip function-name path segment only when leading, including bare /functionName
- Quote target host path literals before regex stripping in rule matching
- Download OpenNLP models only during CI test step, not compile

Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve additive conflicts: combine 0.6.9 changelog entries, keep both
api_connector_path_prefix_to_trim and external_api_alb variables, and
retain allMatch-based case-insensitive allowedQueryParams check.

Co-authored-by: Cursor <cursoragent@cursor.com>
@eschultink
eschultink enabled auto-merge (squash) July 30, 2026 16:31
@eschultink
eschultink merged commit 26885cf into rc-v0.6.9 Jul 30, 2026
120 checks passed
@eschultink
eschultink deleted the s230-misc-0.6.9-improve branch July 30, 2026 16:32
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.

3 participants