Skip to content

[feat] Java Core - add native Statsig forward proxy support#38

Open
trentusus wants to merge 1 commit intomainfrom
codex/java-forward-proxy-support
Open

[feat] Java Core - add native Statsig forward proxy support#38
trentusus wants to merge 1 commit intomainfrom
codex/java-forward-proxy-support

Conversation

@trentusus
Copy link
Copy Markdown

Summary

This updates Java Core so the existing SpecAdapterConfig path can be used for native forward proxy support with the gRPC websocket adapter.

The main changes are:

  • add typed Java constants for spec adapter types and authentication modes
  • enable with_grpc in the Java FFI build path
  • update Java build/test/publish flows to produce grpc-enabled native artifacts
  • update Java tests to use the canonical adapter names that Rust already expects

This PR does not add a new forward-proxy-specific Java API. It keeps SpecAdapterConfig and setSpecAdapterConfigs(...) as the public surface.

Changes

  • Added Java constants:
    • SpecAdapterType.DATA_STORE
    • SpecAdapterType.NETWORK_HTTP
    • SpecAdapterType.NETWORK_GRPC_WEBSOCKET
    • AuthenticationMode.NONE
    • AuthenticationMode.TLS
    • AuthenticationMode.MTLS
  • Updated Java tests to use canonical adapter values instead of legacy "http" / "grpc" strings
  • Added Java-side coverage for grpc-websocket config construction with TLS fields
  • Added with_grpc feature forwarding in statsig-ffi
  • Updated the active Java build/test/publish paths to build statsig_ffi with with_grpc
  • Kept ProxyConfig unchanged; this remains generic outbound HTTP proxy config only

Verification

Successful testing completed locally:

  • ./tore test java --no-docker

    • passed under Java 11
  • ./tore build java --os macos --arch arm64 --skip-docker-build

    • passed
    • grpc-enabled native artifact was produced for the Java package
  • Local forward proxy validation against a running proxy

    • plaintext gRPC on http://127.0.0.1:50051
    • TLS on https://127.0.0.1:50052
    • mTLS on https://127.0.0.1:50052

For the local forward proxy runtime validation, Java Core successfully:

  • initialized through network_grpc_websocket
  • loaded config specs from the proxy
  • reported configSpecReady=true
  • completed a basic evaluation successfully

Additional local validation:

  • generated and validated local CA/server/client certs
  • verified the TLS listener with openssl s_client
  • confirmed proxy-side gRPC initialization logs during Java client startup

@trentusus trentusus changed the title [java-core] add native forward proxy support for gRPC websocket specs [java-core] add native Statsig forward proxy support Mar 23, 2026
@trentusus trentusus changed the title [java-core] add native Statsig forward proxy support [feat] Java Core - add native Statsig forward proxy support Mar 23, 2026
@trentusus trentusus marked this pull request as ready for review March 23, 2026 18:42
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