Skip to content

Conversation

@DanielHougaard
Copy link
Member

This PR aims to add support for all Java versions all the way down to Java 8. I've moved us to use legacy Java syntax and legacy Java features in order for our code to be compatible with older Java versions. I've tested all the auth and secret methods against a real Infisical instance, everything works well. Tested on Java 21 and Java 8 respectively.

@gitguardian
Copy link

gitguardian bot commented Oct 28, 2025

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
21914599 Triggered Generic High Entropy Secret b608bfd src/test/java/com/infisical/sdk/InfisicalSdkTest.java View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@DanielHougaard DanielHougaard self-assigned this Oct 28, 2025
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Successfully adds Java 8 compatibility by replacing modern Java syntax with legacy equivalents. The PR systematically addresses Java 8 compatibility across the entire codebase.

Key changes:

  • Replaced var keyword with explicit type declarations throughout all source and test files
  • Replaced Java 9+ Map.of() and Map.ofEntries() with HashMap and Collections APIs
  • Changed List.getFirst() to List.get(0) for Java 8 compatibility
  • Updated URLEncoder.encode() and URLDecoder.decode() to use charset name strings instead of Charset objects
  • Downgraded logback dependencies from 1.5.19 to 1.3.14 and slf4j from 2.1.0 to 2.0.9 for Java 8 support
  • Changed Maven compiler configuration from Java 21 to Java 8

The author reports successful testing on both Java 21 and Java 8.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • All changes are straightforward syntax replacements for Java 8 compatibility with no logic modifications. The transformations follow standard patterns for backporting modern Java code, and the author has tested functionality on both Java 8 and Java 21.
  • No files require special attention - all changes are mechanical syntax replacements

Important Files Changed

File Analysis

Filename Score Overview
pom.xml 4/5 Changed compiler target from Java 21 to Java 8, downgraded logging dependencies to Java 8-compatible versions. Potential concern: java.version property still set to 21 while compiler targets 8.
src/main/java/com/infisical/sdk/auth/AwsAuthProvider.java 5/5 Replaced Java 9+ features: Map.of() with HashMap, .getFirst() with .get(0), URLEncoder.encode(String, Charset) with charset name string. Proper Java 8 compatible implementations.
src/test/java/com/infisical/sdk/auth/AwsAuthProviderTest.java 5/5 Replaced Java 9+ features in tests: Map.of() with HashMap, diamond operator with explicit types, URLDecoder.decode(String, Charset) with charset name string. All replacements maintain test correctness.

Sequence Diagram

sequenceDiagram
    participant D as Developer
    participant S as InfisicalSdk
    participant A as AuthClient
    participant H as ApiClient
    
    D->>S: new InfisicalSdk(config)
    S->>A: new AuthClient(apiClient)
    S->>H: new ApiClient(baseUrl)
    
    D->>A: UniversalAuthLogin(id, pass)
    A->>H: post(url, params, Class)
    H->>H: Build HTTP request
    H-->>A: Return credential
    A-->>D: Authentication complete
    
    D->>S: Secrets().ListSecrets(projectId, env)
    S->>H: get(url, queryParams, Class)
    H->>H: Build HTTP GET request
    H-->>S: Return response
    S-->>D: Return list
Loading

8 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@DanielHougaard DanielHougaard merged commit 4fc0091 into main Oct 28, 2025
2 checks passed
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