From 8a7122bd7db631798f6fb13cc63e7c048ccbb538 Mon Sep 17 00:00:00 2001 From: Devesh-Skyflow Date: Tue, 26 May 2026 17:13:07 +0530 Subject: [PATCH 01/12] feat(SK-2849): add v1.x deprecation warning and EOL notice - Print WARN-level deprecation message on Skyflow.init() startup - Update pom.xml description with EOL date (2026-10-31) and migration guide link Co-Authored-By: Claude Sonnet 4.6 --- pom.xml | 2 +- src/main/java/com/skyflow/vault/Skyflow.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 87e2d899..33f64a4d 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ jar ${project.groupId}:${project.artifactId} - Skyflow SDK for the Java programming language + [DEPRECATED - EOL 2026-10-31] Skyflow Java SDK v1.x. Migrate to v2: https://github.com/skyflowapi/skyflow-java/blob/main/docs/migrate_to_v2.md https://github.com/skyflowapi/skyflow-java/tree/main diff --git a/src/main/java/com/skyflow/vault/Skyflow.java b/src/main/java/com/skyflow/vault/Skyflow.java index b444dc4d..0cc1e18b 100644 --- a/src/main/java/com/skyflow/vault/Skyflow.java +++ b/src/main/java/com/skyflow/vault/Skyflow.java @@ -37,6 +37,8 @@ private Skyflow(SkyflowConfiguration config) { } public static Skyflow init(SkyflowConfiguration clientConfig) throws SkyflowException { + LogUtil.printWarningLog("skyflow-java v1.x is deprecated and will reach End of Life on October 31, 2026. " + + "Please migrate to v2: https://github.com/skyflowapi/skyflow-java/blob/main/docs/migrate_to_v2.md"); return new Skyflow(clientConfig); } From d45a1476abe06ae310acfeecd257e61c945984da Mon Sep 17 00:00:00 2001 From: Devesh-Skyflow Date: Tue, 26 May 2026 17:18:45 +0530 Subject: [PATCH 02/12] SK-2837: Add V2.1 migration guide and README upgrade banner (#313) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: add V2.1 migration guide and README upgrade banner Adds docs/migrate_to_v2.md covering auth options, client init, request/response structure, error format, and camelCase field name changes for V1 → V2 migration. Adds README banner pointing V1 users to the guide and noting EOL on 2026-10-31. Co-Authored-By: Claude Sonnet 4.6 * docs: update migration guide with v2.1 changes Add sections for UpdateRequest skyflowId preference, updateLogLevel and getBYOT deprecations. Co-Authored-By: Claude Sonnet 4.6 * docs: add downloadURL→downloadUrl rename to migration guide method renames table Co-Authored-By: Claude Sonnet 4.6 --------- Co-authored-by: Claude Sonnet 4.6 --- README.md | 3 + docs/migrate_to_v2.md | 284 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 287 insertions(+) create mode 100644 docs/migrate_to_v2.md diff --git a/README.md b/README.md index 647e8fe5..efc15e19 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # Skyflow Java + +> **Java V2.1.0 IS NOW AVAILABLE:** A new, improved version of the Skyflow SDK is ready with flexible authentication, multi-vault support, builder patterns, and richer error diagnostics. V1 is in maintenance mode (security patches only) and will reach End of Life on October 31, 2026. We recommend upgrading to v2.1.0 — see the **[Migration Guide](docs/migrate_to_v2.md)** for step-by-step instructions. + The Skyflow Java SDK is designed to help with integrating Skyflow into a Java backend. [![CI](https://img.shields.io/static/v1?label=CI&message=passing&color=green?style=plastic&logo=github)](https://github.com/skyflowapi/skyflow-java/actions) diff --git a/docs/migrate_to_v2.md b/docs/migrate_to_v2.md new file mode 100644 index 00000000..671210fd --- /dev/null +++ b/docs/migrate_to_v2.md @@ -0,0 +1,284 @@ +# Skyflow Java SDK — V1 to V2 Migration Guide + +This guide covers the steps to migrate the Skyflow Java SDK from v1 to v2. + +--- + +## Authentication options + +In V2, multiple authentication options are available. You can now provide credentials in the following ways: + +- Environment variable (`SKYFLOW_CREDENTIALS`) _(Recommended)_ +- API Key +- Path to credentials JSON file +- Stringified JSON of credentials +- Bearer token + +**V1 (Old)** + +```java +static class DemoTokenProvider implements TokenProvider { + @Override + public String getBearerToken() throws Exception { + ResponseToken res = null; + try { + String filePath = ""; + res = Token.generateBearerToken(filePath); + } catch (SkyflowException e) { + e.printStackTrace(); + } + return res.getAccessToken(); + } +} +``` + +**V2 (New): Choose one of the following:** + +```java +// Option 1: API Key (Recommended) +Credentials skyflowCredentials = new Credentials(); +skyflowCredentials.setApiKey(""); + +// Option 2: Environment Variable (Recommended) +// Set SKYFLOW_CREDENTIALS in your environment + +// Option 3: Credentials File +skyflowCredentials.setPath(""); + +// Option 4: Stringified JSON +skyflowCredentials.setCredentialsString(""); + +// Option 5: Bearer Token +skyflowCredentials.setToken(""); +``` + +> **Notes:** +> - Use only ONE authentication method per credentials object. +> - API Key or environment variable are recommended for production. +> - For priority order see [Quickstart — Initialize the client](../README.md#initialize-the-client). + +--- + +## Initializing the client + +V2 introduces a builder pattern for client initialization with multi-vault support. + +**Key changes:** +- `vaultUrl` replaced with `clusterId` (derived from vault URL) +- Added `env` specification (e.g. `Env.PROD`, `Env.SANDBOX`) +- Log level is now per-client-instance + +**V1 (Old)** + +```java +DemoTokenProvider demoTokenProvider = new DemoTokenProvider(); +SkyflowConfiguration skyflowConfig = new SkyflowConfiguration( + "", "", demoTokenProvider +); +Skyflow skyflowClient = Skyflow.init(skyflowConfig); +``` + +**V2 (New)** + +```java +Credentials credentials = new Credentials(); +credentials.setPath(""); + +VaultConfig config = new VaultConfig(); +config.setVaultId(""); +config.setClusterId(""); +config.setEnv(Env.PROD); +config.setCredentials(credentials); + +Skyflow skyflowClient = Skyflow.builder() + .setLogLevel(LogLevel.DEBUG) + .addVaultConfig(config) + .build(); +``` + +--- + +## Request and response structure + +V2 removes third-party JSON objects in favour of native `ArrayList` and `HashMap` with a builder pattern for requests. + +**V1 (Old) — Request** + +```java +JSONObject recordsJson = new JSONObject(); +JSONArray recordsArrayJson = new JSONArray(); +JSONObject recordJson = new JSONObject(); +recordJson.put("table", "cards"); +JSONObject fieldsJson = new JSONObject(); +fieldsJson.put("cardNumber", "41111111111"); +fieldsJson.put("cvv", "123"); +recordJson.put("fields", fieldsJson); +recordsArrayJson.add(recordJson); +recordsJson.put("records", recordsArrayJson); +try { + JSONObject insertResponse = skyflowClient.insert(records); +} catch (SkyflowException e) { + System.out.println(e); +} +``` + +**V2 (New) — Request** + +```java +HashMap value = new HashMap<>(); +value.put("", ""); +value.put("", ""); +ArrayList> values = new ArrayList<>(); +values.add(value); + +InsertRequest insertRequest = InsertRequest.builder() + .table("") + .values(values) + .returnTokens(true) + .build(); + +InsertResponse response = skyflowClient.vault().insert(insertRequest); +``` + +**V1 (Old) — Response** + +```json +{ + "records": [ + { + "table": "cards", + "fields": { + "skyflow_id": "16419435-aa63-4823-aae7-19c6a2d6a19f", + "cardNumber": "f3907186-e7e2-466f-91e5-48e12c2bcbc1", + "cvv": "1989cb56-63da-4482-a2df-1f74cd0dd1a5" + } + } + ] +} +``` + +**V2 (New) — Response** + +```json +{ + "insertedFields": [ + { + "skyflowId": "9fac9201-7b8a-4446-93f8-5244e1213bd1", + "card_number": "5484-7829-1702-9110", + "cardholder_name": "b2308e2a-c1f5-469b-97b7-1f193159399b" + } + ], + "errors": null +} +``` + +--- + +## Request options + +V2 builder pattern replaces V1 options objects. + +**V1 (Old)** + +```java +InsertOptions insertOptions = new InsertOptions(true); +``` + +**V2 (New)** + +```java +InsertRequest request = InsertRequest.builder() + .table("") + .values(values) + .continueOnError(false) + .tokenMode(TokenMode.DISABLE) + .returnTokens(false) + .upsert("") + .build(); +``` + +--- + +## Error structure + +V2 provides richer error details for easier debugging. + +**V1 (Old)** + +```json +{ + "code": "", + "description": "" +} +``` + +**V2 (New)** + +```json +{ + "httpStatus": "", + "grpcCode": "", + "httpCode": "", + "message": "", + "requestId": "", + "details": ["
"] +} +``` + +--- + +## Credential field names (v2.1+) + +The credentials JSON file field names are updated to follow Java camelCase conventions. Both old and new forms are permanently accepted. + +| Old form (still accepted) | New form (preferred) | +|---|---| +| `clientID` | `clientId` | +| `keyID` | `keyId` | +| `tokenURI` | `tokenUri` | + +--- + +## Response field names (v2.1+) + +Response maps now return `skyflowId` (camelCase). The legacy `skyflow_id` key is still present for backward compatibility but is deprecated. + +| Deprecated (still returned) | Preferred | +|---|---| +| `skyflow_id` | `skyflowId` | + +--- + +## Update request data key (v2.1+) + +When calling `update()`, use `skyflowId` (camelCase) as the key in the data map to identify the record. Using `skyflow_id` still works but emits a deprecation warning. If both keys are present, `skyflowId` takes precedence. + +```java +HashMap data = new HashMap<>(); +data.put("skyflowId", ""); // preferred +data.put("card_number", ""); + +UpdateRequest request = UpdateRequest.builder() + .table("") + .data(data) + .returnTokens(true) + .build(); + +skyflowClient.vault().update(request); +``` + +--- + +## Method renames (v2.1+) + +The following instance methods have been renamed for consistency. The old names still work but emit deprecation warnings. + +| Deprecated | Preferred | +|---|---| +| `skyflowClient.updateLogLevel(logLevel)` | `skyflowClient.setLogLevel(logLevel)` | +| `TokenMode.getBYOT()` | `TokenMode.getByot()` | +| `DetokenizeRequest.builder().downloadURL(b)` | `DetokenizeRequest.builder().downloadUrl(b)` | + +--- + +For the full list of changes see [CHANGELOG.md](../CHANGELOG.md). From 68766b02d420343ac3c6de822a64381f257d2f25 Mon Sep 17 00:00:00 2001 From: Devesh-Skyflow Date: Tue, 26 May 2026 17:59:29 +0530 Subject: [PATCH 03/12] chore: update internal release workflow to trigger on v1/release/* branches Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/internal-release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/internal-release.yml b/.github/workflows/internal-release.yml index 1e26a801..4da7ac28 100644 --- a/.github/workflows/internal-release.yml +++ b/.github/workflows/internal-release.yml @@ -1,12 +1,13 @@ name: Publish package to the JFROG Artifactory on: push: - tags: '*.*.*' + tags: + - '*.*.*' paths-ignore: - "pom.xml" - "*.md" branches: - - release/* + - v1/release/* jobs: build-and-deploy: From da05f13fe381b38f6a89907b48925504a09bef30 Mon Sep 17 00:00:00 2001 From: Devesh-Skyflow Date: Tue, 26 May 2026 18:02:25 +0530 Subject: [PATCH 04/12] chore: update internal release trigger to release/v1/* branches Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/internal-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/internal-release.yml b/.github/workflows/internal-release.yml index 4da7ac28..a294dec7 100644 --- a/.github/workflows/internal-release.yml +++ b/.github/workflows/internal-release.yml @@ -7,7 +7,7 @@ on: - "pom.xml" - "*.md" branches: - - v1/release/* + - release/v1/* jobs: build-and-deploy: From 7a0438bfb2f7c28a5513d1dff62de0795f3d3bf6 Mon Sep 17 00:00:00 2001 From: Devesh-Skyflow Date: Tue, 26 May 2026 18:55:03 +0530 Subject: [PATCH 05/12] chore: add workflow_dispatch and upgrade action versions --- .github/workflows/internal-release.yml | 1 + .github/workflows/shared-build-and-deploy.yml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/internal-release.yml b/.github/workflows/internal-release.yml index a294dec7..50813683 100644 --- a/.github/workflows/internal-release.yml +++ b/.github/workflows/internal-release.yml @@ -1,5 +1,6 @@ name: Publish package to the JFROG Artifactory on: + workflow_dispatch: push: tags: - '*.*.*' diff --git a/.github/workflows/shared-build-and-deploy.yml b/.github/workflows/shared-build-and-deploy.yml index 43a54dec..e3c5de9f 100644 --- a/.github/workflows/shared-build-and-deploy.yml +++ b/.github/workflows/shared-build-and-deploy.yml @@ -38,15 +38,15 @@ jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: ref: ${{ inputs.ref }} fetch-depth: 0 - name: Set up maven or jfrog repository - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: '1.8' + java-version: '8' distribution: 'adopt' server-id: ${{ inputs.server-id }} server-username: SERVER_USERNAME From 16ecdd4894b2ee4ec8f9fe8827e0a6e6d5d4e4b1 Mon Sep 17 00:00:00 2001 From: Devesh-Skyflow Date: Tue, 26 May 2026 13:25:21 +0000 Subject: [PATCH 06/12] [AUTOMATED] Private Release 2.1.0-dev-7a0438b --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 33f64a4d..195127e8 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.skyflow skyflow-java - 1.15.0 + 2.1.0-dev.7a0438b jar ${project.groupId}:${project.artifactId} @@ -233,4 +233,4 @@ - \ No newline at end of file + From f1e11b789063330d5275e91a28b1525cb6627e36 Mon Sep 17 00:00:00 2001 From: Devesh-Skyflow Date: Tue, 26 May 2026 19:06:58 +0530 Subject: [PATCH 07/12] chore: skip tests in v1 internal release deploy --- .github/workflows/shared-build-and-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/shared-build-and-deploy.yml b/.github/workflows/shared-build-and-deploy.yml index e3c5de9f..22456b4c 100644 --- a/.github/workflows/shared-build-and-deploy.yml +++ b/.github/workflows/shared-build-and-deploy.yml @@ -98,7 +98,7 @@ jobs: json: ${{ secrets.TEST_CREDENTIALS_FILE_STRING }} - name: Publish package - run: mvn clean deploy -P ${{ inputs.profile }} + run: mvn clean deploy -P ${{ inputs.profile }} -DskipTests env: SERVER_USERNAME: ${{ secrets.server-username }} SERVER_PASSWORD: ${{ secrets.server-password }} From 1f89db640dd87c2711a028215cdc3f0536603faa Mon Sep 17 00:00:00 2001 From: Devesh-Skyflow Date: Tue, 26 May 2026 20:54:18 +0530 Subject: [PATCH 08/12] chore: internal release manual-only trigger for v1 Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/internal-release.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/internal-release.yml b/.github/workflows/internal-release.yml index a294dec7..e6b79fb3 100644 --- a/.github/workflows/internal-release.yml +++ b/.github/workflows/internal-release.yml @@ -1,13 +1,6 @@ name: Publish package to the JFROG Artifactory on: - push: - tags: - - '*.*.*' - paths-ignore: - - "pom.xml" - - "*.md" - branches: - - release/v1/* + workflow_dispatch: jobs: build-and-deploy: From f69fe5781873ecba3663e4826a1e8b36bcf2052d Mon Sep 17 00:00:00 2001 From: Devesh-Skyflow Date: Tue, 26 May 2026 21:02:02 +0530 Subject: [PATCH 09/12] chore: rename internal release workflow for consistency Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/internal-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/internal-release.yml b/.github/workflows/internal-release.yml index e6b79fb3..e335b6ae 100644 --- a/.github/workflows/internal-release.yml +++ b/.github/workflows/internal-release.yml @@ -1,4 +1,4 @@ -name: Publish package to the JFROG Artifactory +name: Internal Release on: workflow_dispatch: From ee90e8e13f1e2903701cd069eb94acd6e5fb1643 Mon Sep 17 00:00:00 2001 From: Devesh-Skyflow Date: Tue, 26 May 2026 21:05:13 +0530 Subject: [PATCH 10/12] chore: restore release/v1/* trigger, remove unintentional tag trigger Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/internal-release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/internal-release.yml b/.github/workflows/internal-release.yml index e335b6ae..52323ff1 100644 --- a/.github/workflows/internal-release.yml +++ b/.github/workflows/internal-release.yml @@ -1,6 +1,11 @@ name: Internal Release on: - workflow_dispatch: + push: + paths-ignore: + - "pom.xml" + - "*.md" + branches: + - release/v1/* jobs: build-and-deploy: From ebacfb3b6c60aa1bebbdcfd8c81c1ed1407e9e04 Mon Sep 17 00:00:00 2001 From: Devesh-Skyflow Date: Tue, 26 May 2026 21:09:26 +0530 Subject: [PATCH 11/12] chore: remove manual trigger after merge Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/internal-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/internal-release.yml b/.github/workflows/internal-release.yml index 6b8192a5..52323ff1 100644 --- a/.github/workflows/internal-release.yml +++ b/.github/workflows/internal-release.yml @@ -1,6 +1,5 @@ name: Internal Release on: - workflow_dispatch: push: paths-ignore: - "pom.xml" From 12c7bf6b1310b5a6b0193c6e3063015a4b5a78e8 Mon Sep 17 00:00:00 2001 From: Devesh-Skyflow Date: Wed, 27 May 2026 14:34:42 +0530 Subject: [PATCH 12/12] chore: revert workflow changes to v1 baseline Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/internal-release.yml | 5 +++-- .github/workflows/shared-build-and-deploy.yml | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/internal-release.yml b/.github/workflows/internal-release.yml index 52323ff1..1e26a801 100644 --- a/.github/workflows/internal-release.yml +++ b/.github/workflows/internal-release.yml @@ -1,11 +1,12 @@ -name: Internal Release +name: Publish package to the JFROG Artifactory on: push: + tags: '*.*.*' paths-ignore: - "pom.xml" - "*.md" branches: - - release/v1/* + - release/* jobs: build-and-deploy: diff --git a/.github/workflows/shared-build-and-deploy.yml b/.github/workflows/shared-build-and-deploy.yml index 22456b4c..43a54dec 100644 --- a/.github/workflows/shared-build-and-deploy.yml +++ b/.github/workflows/shared-build-and-deploy.yml @@ -38,15 +38,15 @@ jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v2 with: ref: ${{ inputs.ref }} fetch-depth: 0 - name: Set up maven or jfrog repository - uses: actions/setup-java@v4 + uses: actions/setup-java@v1 with: - java-version: '8' + java-version: '1.8' distribution: 'adopt' server-id: ${{ inputs.server-id }} server-username: SERVER_USERNAME @@ -98,7 +98,7 @@ jobs: json: ${{ secrets.TEST_CREDENTIALS_FILE_STRING }} - name: Publish package - run: mvn clean deploy -P ${{ inputs.profile }} -DskipTests + run: mvn clean deploy -P ${{ inputs.profile }} env: SERVER_USERNAME: ${{ secrets.server-username }} SERVER_PASSWORD: ${{ secrets.server-password }}