| 1 | --- java-client-before.java 2025-09-05 10:00:00 |
| 2 | +++ java-client-after.java 2025-09-05 10:30:00 |
| 3 | @@ -1,19 +1,11 @@ |
| 4 | import com.anduril.Lattice; |
| 5 | -import okhttp3.OkHttpClient; |
| 6 | |
| 7 | public class LatticeClientExample { |
| 8 | public static void main(String[] args) { |
| 9 | String endpoint = System.getenv("LATTICE_ENDPOINT"); |
| 10 | String token = System.getenv("ENVIRONMENT_TOKEN"); |
| 11 | String sandboxesToken = System.getenv("SANDBOXES_TOKEN"); |
| 12 | - |
| 13 | - // Create HTTP client with Sandbox authentication |
| 14 | - OkHttpClient httpClient = new OkHttpClient.Builder() |
| 15 | - .addInterceptor(chain -> { |
| 16 | - return chain.proceed(chain.request().newBuilder() |
| 17 | - .header("Anduril-Sandbox-Authorization", "Bearer " + sandboxesToken) |
| 18 | - .build()); |
| 19 | - }) |
| 20 | - .build(); |
| 21 | - |
| 22 | + |
| 23 | + // Create Lattice client with Sandbox authentication |
| 24 | Lattice client = Lattice.builder() |
| 25 | .url(endpoint) |
| 26 | .token(token) |
| 27 | - .httpClient(httpClient) |
| 28 | + .addHeader("Anduril-Sandbox-Authorization", "Bearer " + sandboxesToken) |
| 29 | .build(); |
| 30 | } |
| 31 | } |