").deidentifyText(deidentifyTextRequest);
-
- // Step 5: Print the response
- System.out.println("Deidentify text Response: " + deidentifyTextResponse);
- }
-}
-
-```
-
-## An [example](https://github.com/skyflowapi/skyflow-java/blob/beta-release/25.6.2/samples/src/main/java/com/example/detect/DeidentifyTextExample.java) of deidentify text:
-```java
-import java.util.ArrayList;
-import java.util.List;
-
-import com.skyflow.enums.DetectEntities;
-import com.skyflow.errors.SkyflowException;
-import com.skyflow.vault.detect.DateTransformation;
-import com.skyflow.vault.detect.DeidentifyTextRequest;
-import com.skyflow.vault.detect.DeidentifyTextResponse;
-import com.skyflow.vault.detect.TokenFormat;
-import com.skyflow.vault.detect.Transformations;
-
-/**
- * Skyflow Deidentify Text Example
- *
- * This example demonstrates how to use the Skyflow SDK to deidentify text data
- * across multiple vaults. It includes:
- * 1. Setting up credentials and vault configurations.
- * 2. Creating a Skyflow client with multiple vaults.
- * 3. Performing deidentify of text with various options.
- * 4. Handling responses and errors.
- */
-
-public class DeidentifyTextExample {
- public static void main(String[] args) throws SkyflowException {
-
- // Step 1: Initialise the Skyflow client by configuring the credentials & vault config.
-
- // Step 2: Configuring the different options for deidentify
-
- // Replace with the entity you want to detect
- List detectEntitiesList = new ArrayList<>();
- detectEntitiesList.add(DetectEntities.SSN);
- detectEntitiesList.add(DetectEntities.CREDIT_CARD);
-
- // Replace with the entity you want to detect with vault token
- List vaultTokenList = new ArrayList<>();
- vaultTokenList.add(DetectEntities.SSN);
- vaultTokenList.add(DetectEntities.CREDIT_CARD);
-
- // Configure Token Format
- TokenFormat tokenFormat = TokenFormat.builder()
- .vaultToken(vaultTokenList)
- .build();
-
- // Configure Transformation for deidentified entities
- List detectEntitiesTransformationList = new ArrayList<>();
- detectEntitiesTransformationList.add(DetectEntities.DOB); // Replace with the entity you want to transform
-
- DateTransformation dateTransformation = new DateTransformation(20, 5, detectEntitiesTransformationList);
- Transformations transformations = new Transformations(dateTransformation);
-
- // Step 3: invoking Deidentify text on the vault
- try {
- // Create a deidentify text request for the vault
- DeidentifyTextRequest deidentifyTextRequest = DeidentifyTextRequest.builder()
- .text("My SSN is 123-45-6789 and my card is 4111 1111 1111 1111.") // Replace with your deidentify text
- .entities(detectEntitiesList)
- .tokenFormat(tokenFormat)
- .transformations(transformations)
- .build();
- // Replace `9f27764a10f7946fe56b3258e117` with the acutal vault id
- DeidentifyTextResponse deidentifyTextResponse = skyflowClient.detect("9f27764a10f7946fe56b3258e117").deidentifyText(deidentifyTextRequest);
-
- System.out.println("Deidentify text Response: " + deidentifyTextResponse);
- } catch (SkyflowException e) {
- System.err.println("Error occurred during deidentify: ");
- e.printStackTrace(); // Print the exception for debugging purposes
- }
- }
-}
-```
-
-Sample Response:
-```json
-{
- "processedText": "My SSN is [SSN_IWdexZe] and my card is [CREDIT_CARD_rUzMjdQ].",
- "entities": [
+ "summary": {
+ "total_tokens": 2,
+ "total_detokenized": 2,
+ "total_failed": 0,
+ },
+ "success": [
{
- "token": "SSN_IWdexZe",
- "value": "123-45-6789",
- "textIndex": {
- "start": 10,
- "end": 21
- },
- "processedIndex": {
- "start": 10,
- "end": 23
- },
- "entity": "SSN",
- "scores": {
- "SSN": 0.9384
+ "index": 0,
+ "token": "b8eea77a-47e1-4d67-a560-fd395cabc82f",
+ "value": "xxxx@skyflow.com",
+ "tokenGroupName": "nondeterministic_regex",
+ "metadata": {
+ "skyflowID": "5ddc71a6-3bdb-47e4-9723-259452946349",
+ "tableName": "table1"
}
},
- {
- "token": "CREDIT_CARD_rUzMjdQ",
- "value": "4111 1111 1111 1111",
- "textIndex": {
- "start": 37,
- "end": 56
- },
- "processedIndex": {
- "start": 39,
- "end": 60
- },
- "entity": "CREDIT_CARD",
- "scores": {
- "CREDIT_CARD": 0.9051
- }
- }
- ],
- "wordCount": 9,
- "charCount": 57
-}
-```
-
-## Reidentify Text
-To reidentify text, use the `reidentifyText` method. The `ReidentifyTextRequest` class creates a reidentify text request, which includes the redacted or deidentified text to be reidentified. Additionally, you can provide optional parameters using the ReidentifyTextOptions class to control how specific entities are returned (as redacted, masked, or plain text).
-
-### Construct an reidentify text request
-
-```java
-import com.skyflow.enums.DetectEntities;
-import com.skyflow.vault.detect.ReidentifyTextRequest;
-import com.skyflow.vault.detect.ReidentifyTextResponse;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * This example demonstrates how to build a reidentify text request.
- */
-public class ReidentifyTextSchema {
- public static void main(String[] args) {
- // Step 1: Initialise the Skyflow client by configuring the credentials & vault config.
-
- // Step 2: Configuring the different options for reidentify
- List maskedEntity = new ArrayList<>();
- maskedEntity.add(DetectEntities.CREDIT_CARD); // Replace with the entity you want to mask
-
- List plainTextEntity = new ArrayList<>();
- plainTextEntity.add(DetectEntities.SSN); // Replace with the entity you want to keep in plain text
-
- // List redactedEntity = new ArrayList<>();
- // redactedEntity.add(DetectEntities.SSN); // Replace with the entity you want to redact
-
-
- // Step 3: Create a reidentify text request with the configured entities
- ReidentifyTextRequest reidentifyTextRequest = ReidentifyTextRequest.builder()
- .text("My SSN is [SSN_IWdexZe] and my card is [CREDIT_CARD_rUzMjdQ].") // Replace with your deidentify text
- .maskedEntities(maskedEntity)
-// .redactedEntities(redactedEntity)
- .plainTextEntities(plainTextEntity)
- .build();
-
- // Step 4: Invoke reidentify text on the vault
- ReidentifyTextResponse reidentifyTextResponse = skyflowClient.detect("").reidentifyText(reidentifyTextRequest);
- System.out.println("Reidentify text Response: " + reidentifyTextResponse);
- }
-}
-```
-
-## An [example](https://github.com/skyflowapi/skyflow-java/blob/beta-release/25.6.2/samples/src/main/java/com/example/detect/ReidentifyTextExample.java) of Reidentify text
-
-```java
-import com.skyflow.enums.DetectEntities;
-import com.skyflow.errors.SkyflowException;
-import com.skyflow.vault.detect.ReidentifyTextRequest;
-import com.skyflow.vault.detect.ReidentifyTextResponse;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Skyflow Reidentify Text Example
- *
- * This example demonstrates how to use the Skyflow SDK to reidentify text data
- * across multiple vaults. It includes:
- * 1. Setting up credentials and vault configurations.
- * 2. Creating a Skyflow client with multiple vaults.
- * 3. Performing reidentify of text with various options.
- * 4. Handling responses and errors.
- */
-
-public class ReidentifyTextExample {
- public static void main(String[] args) throws SkyflowException {
- // Step 1: Initialise the Skyflow client by configuring the credentials & vault config.
-
- // Step 2: Configuring the different options for reidentify
- List maskedEntity = new ArrayList<>();
- maskedEntity.add(DetectEntities.CREDIT_CARD); // Replace with the entity you want to mask
-
- List plainTextEntity = new ArrayList<>();
- plainTextEntity.add(DetectEntities.SSN); // Replace with the entity you want to keep in plain text
-
- try {
- // Step 3: Create a reidentify text request with the configured options
- ReidentifyTextRequest reidentifyTextRequest = ReidentifyTextRequest.builder()
- .text("My SSN is [SSN_IWdexZe] and my card is [CREDIT_CARD_rUzMjdQ].") // Replace with your deidentify text
- .maskedEntities(maskedEntity)
- .plainTextEntities(plainTextEntity)
- .build();
-
- // Step 4: Invoke Reidentify text on the vault
- // Replace `9f27764a10f7946fe56b3258e117` with the acutal vault id
- ReidentifyTextResponse reidentifyTextResponse = skyflowClient.detect("9f27764a10f7946fe56b3258e117").reidentifyText(reidentifyTextRequest);
-
- // Handle the response from the reidentify text request
- System.out.println("Reidentify text Response: " + reidentifyTextResponse);
- } catch (SkyflowException e) {
- System.err.println("Error occurred during reidentify : ");
- e.printStackTrace();
- }
- }
-}
-```
-
-Sample Response:
-
-```json
-{
- "processedText":"My SSN is 123-45-6789 and my card is XXXXX1111."
-}
-```
-
-## Deidentify file
-To deidentify files, use the `deidentifyFile` method. The `DeidentifyFileRequest` class creates a deidentify file request, which includes the file to be deidentified (such as images, PDFs, audio, documents, spreadsheets, or presentations). Additionally, you can provide optional parameters using the DeidentifyFileOptions class to control how entities are detected and deidentified, as well as how the output is generated for different file types.
-
-### Construct an deidentify file request
-
-```java
-import com.skyflow.config.Credentials;
-import com.skyflow.config.VaultConfig;
-import com.skyflow.enums.Env;
-import com.skyflow.enums.LogLevel;
-import com.skyflow.enums.MaskingMethod;
-import com.skyflow.errors.SkyflowException;
-import com.skyflow.vault.detect.DeidentifyFileRequest;
-import com.skyflow.vault.detect.DeidentifyFileResponse;
-
-import java.io.File;
-
-/**
- * This example demonstrates how to build a deidentify file request.
- */
-
-public class DeidentifyFileSchema {
-
- public static void main(String[] args) {
- // Step 1: Initialise the Skyflow client by configuring the credentials & vault config.
-
- // Step 2: Create a deidentify file request with all options
-
- // Create file object
- File file = new File(""); // Replace with the path to the file you want to deidentify
-
- // Create file input using the file object
- FileInput fileInput = FileInput.builder()
- .file(file)
- // .filePath("") // Alternatively, you can use .filePath()
- .build();
-
- // Output configuration
- String outputDirectory = ""; // Replace with the desired output directory to save the deidentified file
-
- // Entities to detect
- // List detectEntities = new ArrayList<>();
- // detectEntities.add(DetectEntities.IP_ADDRESS); // Replace with the entities you want to detect
-
- // Image-specific options
- // Boolean outputProcessedImage = true; // Include processed image in output
- // Boolean outputOcrText = true; // Include OCR text in output
- MaskingMethod maskingMethod = MaskingMethod.BLACKBOX; // Masking method for images
-
- // PDF-specific options
- // Integer pixelDensity = 15; // Pixel density for PDF processing
- // Integer maxResolution = 2000; // Max resolution for PDF
-
- // Audio-specific options
- // Boolean outputProcessedAudio = true; // Include processed audio
- // DetectOutputTranscriptions outputTanscription = DetectOutputTranscriptions.PLAINTEXT_TRANSCRIPTION; // Transcription type
-
- // Audio bleep configuration
- // AudioBleep audioBleep = AudioBleep.builder()
- // .frequency(5D) // Pitch in Hz
- // .startPadding(7D) // Padding at start (seconds)
- // .stopPadding(8D) // Padding at end (seconds)
- // .build();
-
- Integer waitTime = 20; // Max wait time for response (max 64 seconds)
-
- DeidentifyFileRequest deidentifyFileRequest = DeidentifyFileRequest.builder()
- .file(fileInput)
- .waitTime(waitTime)
- .entities(detectEntities)
- .outputDirectory(outputDirectory)
- .maskingMethod(maskingMethod)
- // .outputProcessedImage(outputProcessedImage)
- // .outputOcrText(outputOcrText)
- // .pixelDensity(pixelDensity)
- // .maxResolution(maxResolution)
- // .outputProcessedAudio(outputProcessedAudio)
- // .outputTranscription(outputTanscription)
- // .bleep(audioBleep)
- .build();
-
-
- DeidentifyFileResponse deidentifyFileResponse = skyflowClient.detect("").deidentifyFile(deidentifyFileRequest);
- System.out.println("Deidentify file response: " + deidentifyFileResponse.toString());
- }
-}
-```
-
-## An [example](https://github.com/skyflowapi/skyflow-java/blob/beta-release/25.6.2/samples/src/main/java/com/example/detect/DeidentifyFileExample.java) of Deidentify file
-
-```java
-import java.io.File;
-
-import com.skyflow.enums.MaskingMethod;
-import com.skyflow.errors.SkyflowException;
-import com.skyflow.vault.detect.DeidentifyFileRequest;
-import com.skyflow.vault.detect.DeidentifyFileResponse;
-
-/**
- * Skyflow Deidentify File Example
- *
- * This example demonstrates how to use the Skyflow SDK to deidentify file
- * It has all available options for deidentifying files.
- * Supported file types: images (jpg, png, etc.), pdf, audio (mp3, wav), documents, spreadsheets, presentations, structured text.
- * It includes:
- * 1. Configure credentials
- * 2. Set up vault configuration
- * 3. Create a deidentify file request with all options
- * 4. Call deidentifyFile to deidentify file.
- * 5. Handle response and errors
- */
-public class DeidentifyFileExample {
-
- public static void main(String[] args) throws SkyflowException {
- // Step 1: Initialise the Skyflow client by configuring the credentials & vault config.
- try {
- // Step 2: Create a deidentify file request with all options
-
-
- // Create file object
- File file = new File("sensitive-folder/personal-info.txt"); // Replace with the path to the file you want to deidentify
-
- // Create file input using the file object
- FileInput fileInput = FileInput.builder()
- .file(file)
- // .filePath("") // Alternatively, you can use .filePath()
- .build();
-
- // Output configuration
- String outputDirectory = "deidenfied-file/"; // Replace with the desired output directory to save the deidentified file
-
- // Entities to detect
- // List detectEntities = new ArrayList<>();
- // detectEntities.add(DetectEntities.IP_ADDRESS); // Replace with the entities you want to detect
-
- // Image-specific options
- // Boolean outputProcessedImage = true; // Include processed image in output
- // Boolean outputOcrText = true; // Include OCR text in output
- MaskingMethod maskingMethod = MaskingMethod.BLACKBOX; // Masking method for images
-
- Integer waitTime = 20; // Max wait time for response (max 64 seconds)
-
- DeidentifyFileRequest deidentifyFileRequest = DeidentifyFileRequest.builder()
- .file(fileInput)
- .waitTime(waitTime)
- .outputDirectory(outputDirectory)
- .maskingMethod(maskingMethod)
- .build();
-
- // Step 3: Invoking deidentifyFile
- // Replace `9f27764a10f7946fe56b3258e117` with the acutal vault id
- DeidentifyFileResponse deidentifyFileResponse = skyflowClient.detect("9f27764a10f7946fe56b3258e117").deidentifyFile(deidentifyFileRequest);
- System.out.println("Deidentify file response: " + deidentifyFileResponse.toString());
- } catch (SkyflowException e) {
- System.err.println("Error occurred during deidentify file: ");
- e.printStackTrace();
- }
- }
-}
-
-```
-
-Sample response:
-
-```json
-{
- "file": {
- "name": "deidentified.txt",
- "size": 33,
- "type": "",
- "lastModified": 1751355183039
- },
- "fileBase64": "bXkgY2FyZCBudW1iZXIgaXMgW0NSRURJVF",
- "type": "redacted_file",
- "extension": "txt",
- "wordCount": 11,
- "charCount": 61,
- "sizeInKb": 0,
- "entities": [
- {
- "file": "bmFtZTogW05BTUVfMV0gCm==",
- "type": "entities",
- "extension": "json"
- }
],
- "runId": "undefined",
- "status": "success"
-}
-
-```
-
-**Supported file types:**
-- Documents: `doc`, `docx`, `pdf`
-- PDFs: `pdf`
-- Images: `bmp`, `jpeg`, `jpg`, `png`, `tif`, `tiff`
-- Structured text: `json`, `xml`
-- Spreadsheets: `csv`, `xls`, `xlsx`
-- Presentations: `ppt`, `pptx`
-- Audio: `mp3`, `wav`
-
-**Note:**
-- Transformations cannot be applied to Documents, Images, or PDFs file formats.
-
-- The `waitTime` option must be ≤ 64 seconds; otherwise, an error is thrown.
-
-- If the API takes more than 64 seconds to process the file, it will return only the run ID in the response.
-
-Sample response (when the API takes more than 64 seconds):
-```json
-{
- "file": null,
- "fileBase64": null,
- "type": null,
- "extension": null,
- "wordCount": null,
- "charCount": null,
- "sizeInKb": null,
- "durationInSeconds": null,
- "pageCount": null,
- "slideCount": null,
- "entities": null,
- "runId": "1273a8c6-c498-4293-a9d6-389864cd3a44",
- "status": "IN_PROGRESS",
- "errors": null
-}
-```
-
-## Get run:
-To retrieve the results of a previously started file `deidentification operation`, use the `getDetectRun` method.
-The `GetDetectRunRequest` class is initialized with the `runId` returned from a prior deidentifyFile call.
-This method allows you to fetch the final results of the file processing operation once they are available.
-
-### Construct an get run request
-
-```java
-import com.skyflow.errors.SkyflowException;
-import com.skyflow.vault.detect.DeidentifyFileResponse;
-import com.skyflow.vault.detect.GetDetectRunRequest;
-
-/**
- * Skyflow Get Detect Run Example
- */
-
-public class GetDetectRunSchema {
-
- public static void main(String[] args) {
- try {
- // Step 1: Initialise the Skyflow client by configuring the credentials & vault config.
-
- // Step 2: Create a get detect run request
- GetDetectRunRequest getDetectRunRequest = GetDetectRunRequest.builder()
- .runId("") // Replace with the runId from deidentifyFile call
- .build();
-
- // Step 3: Call getDetectRun to poll for file processing results
- // Replace with your actual vault ID
- DeidentifyFileResponse deidentifyFileResponse = skyflowClient.detect("").getDetectRun(getDetectRunRequest);
- System.out.println("Get Detect Run Response: " + deidentifyFileResponse);
- } catch (SkyflowException e) {
- System.err.println("Error occurred during get detect run: ");
- e.printStackTrace();
- }
- }
-}
-
-```
-
-## An [example](https://github.com/skyflowapi/skyflow-java/blob/beta-release/25.6.2/samples/src/main/java/com/example/detect/GetDetectRunExample.java) of get run
-```java
-import com.skyflow.config.Credentials;
-import com.skyflow.config.VaultConfig;
-import com.skyflow.enums.Env;
-import com.skyflow.enums.LogLevel;
-import com.skyflow.errors.SkyflowException;
-import com.skyflow.vault.detect.DeidentifyFileResponse;
-import com.skyflow.vault.detect.GetDetectRunRequest;
-
-/**
- * Skyflow Get Detect Run Example
- *
- * This example demonstrates how to:
- * 1. Configure credentials
- * 2. Set up vault configuration
- * 3. Create a get detect run request
- * 4. Call getDetectRun to poll for file processing results
- * 5. Handle response and errors
- */
-public class GetDetectRunExample {
- public static void main(String[] args) throws SkyflowException {
- // Step 1: Initialise the Skyflow client by configuring the credentials & vault config.
- try {
-
- // Step 2: Create a get detect run request
- GetDetectRunRequest getDetectRunRequest = GetDetectRunRequest.builder()
- .runId("e0038196-4a20-422b-bad7-e0477117f9bb") // Replace with the runId from deidentifyFile call
- .build();
-
- // Step 3: Call getDetectRun to poll for file processing results
- // Replace `9f27764a10f7946fe56b3258e117` with the acutal vault id
- DeidentifyFileResponse deidentifyFileResponse = skyflowClient.detect("9f27764a10f7946fe56b3258e117").getDetectRun(getDetectRunRequest);
- System.out.println("Get Detect Run Response: " + deidentifyFileResponse);
- } catch (SkyflowException e) {
- System.err.println("Error occurred during get detect run: ");
- e.printStackTrace();
- }
- }
-}
-```
-
-Sample Response:
-
-```json
-{
- "file": "bmFtZTogW05BTET0JfMV0K",
- "type": "redacted_file",
- "extension": "txt",
- "wordCount": 11,
- "charCount": 61,
- "sizeInKb": 0.0,
- "entities": [
+ "errors": [
{
- "file": "gW05BTUVfMV0gCmNhcmQ0K",
- "type": "entities",
- "extension": "json"
- }
- ],
- "runId": "e0038196-4a20-422b-bad7-e0477117f9bb",
- "status": "success"
-}
-
-```
-
-# Connections
-
-Skyflow Connections is a gateway service that uses tokenization to securely send and receive data between your systems and first- or third-party services. The [connections](https://github.com/skyflowapi/skyflow-java/tree/main/src/main/java/com/skyflow/vault/connection) module invokes both inbound and/or outbound connections.
-
-- **Inbound connections**: Act as intermediaries between your client and server, tokenizing sensitive data before it reaches your backend, ensuring downstream services handle only tokenized data.
-- **Outbound connections**: Enable secure extraction of data from the vault and transfer it to third-party services via your backend server, such as processing checkout or card issuance flows.
-
-## Invoke a connection
-
-To invoke a connection, use the `invoke` method of the Skyflow client.
-
-### Construct an invoke connection request
-
-```java
-import com.skyflow.enums.RequestMethod;
-import com.skyflow.errors.SkyflowException;
-import com.skyflow.vault.connection.InvokeConnectionRequest;
-import com.skyflow.vault.connection.InvokeConnectionResponse;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * This example demonstrates how to invoke an external connection using the Skyflow SDK, along with corresponding InvokeConnectionRequest schema.
- *
- */
-public class InvokeConnectionSchema {
- public static void main(String[] args) {
- try {
- // Initialize Skyflow client
- // Step 1: Define the request body parameters
- // These are the values you want to send in the request body
- Map requestBody = new HashMap<>();
- requestBody.put("", "");
- requestBody.put("", "");
-
- // Step 2: Define the request headers
- // Add any required headers that need to be sent with the request
- Map requestHeaders = new HashMap<>();
- requestHeaders.put("", "");
- requestHeaders.put("", "");
-
- // Step 3: Define the path parameters
- // Path parameters are part of the URL and typically used in RESTful APIs
- Map pathParams = new HashMap<>();
- pathParams.put("", "");
- pathParams.put("", "");
-
- // Step 4: Define the query parameters
- // Query parameters are included in the URL after a '?' and are used to filter or modify the response
- Map queryParams = new HashMap<>();
- queryParams.put("", "");
- queryParams.put("", "");
-
- // Step 5: Build the InvokeConnectionRequest using the provided parameters
- InvokeConnectionRequest invokeConnectionRequest = InvokeConnectionRequest.builder()
- .method(RequestMethod.POST) // The HTTP method to use for the request (POST in this case)
- .requestBody(requestBody) // The body of the request
- .requestHeaders(requestHeaders) // The headers to include in the request
- .pathParams(pathParams) // The path parameters for the URL
- .queryParams(queryParams) // The query parameters to append to the URL
- .build();
-
- // Step 6: Invoke the connection using the request
- // Replace "" with the actual connection ID you are using
- InvokeConnectionResponse invokeConnectionResponse = skyflowClient.connection("").invoke(invokeConnectionRequest);
-
- // Step 7: Print the response from the invoked connection
- // This response contains the result of the request sent to the external system
- System.out.println(invokeConnectionResponse);
-
- } catch (SkyflowException e) {
- // Step 8: Handle any exceptions that occur during the connection invocation
- System.out.println("Error occurred: ");
- e.printStackTrace(); // Print the exception stack trace for debugging
- }
- }
-}
-```
-
-`method` supports the following methods:
-
-- GET
-- POST
-- PUT
-- PATCH
-- DELETE
-
-**pathParams, queryParams, requestHeader, requestBody** are the JSON objects represented as HashMaps, that will be sent through the connection integration url.
-
-### An [example](https://github.com/skyflowapi/skyflow-java/blob/main/samples/src/main/java/com/example/connection/InvokeConnectionExample.java) of invokeConnection
-
-```java
-import com.skyflow.Skyflow;
-import com.skyflow.config.ConnectionConfig;
-import com.skyflow.config.Credentials;
-import com.skyflow.enums.LogLevel;
-import com.skyflow.enums.RequestMethod;
-import com.skyflow.errors.SkyflowException;
-import com.skyflow.vault.connection.InvokeConnectionRequest;
-import com.skyflow.vault.connection.InvokeConnectionResponse;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * This example demonstrates how to invoke an external connection using the Skyflow SDK.
- * It configures a connection, sets up the request, and sends a POST request to the external service.
- *
- * 1. Initialize Skyflow client with connection details.
- * 2. Define the request body, headers, and method.
- * 3. Execute the connection request.
- * 4. Print the response from the invoked connection.
- */
-public class InvokeConnectionExample {
- public static void main(String[] args) {
- try {
- // Initialize Skyflow client
- // Step 1: Set up credentials and connection configuration
- // Load credentials from a JSON file (you need to provide the correct path)
- Credentials credentials = new Credentials();
- credentials.setPath("/path/to/credentials.json");
-
- // Define the connection configuration (URL and credentials)
- ConnectionConfig connectionConfig = new ConnectionConfig();
- connectionConfig.setConnectionId(""); // Replace with actual connection ID
- connectionConfig.setConnectionUrl("https://connection.url.com"); // Replace with actual connection URL
- connectionConfig.setCredentials(credentials); // Set credentials for the connection
-
- // Initialize the Skyflow client with the connection configuration
- Skyflow skyflowClient = Skyflow.builder()
- .setLogLevel(LogLevel.DEBUG) // Set log level to DEBUG for detailed logs
- .addConnectionConfig(connectionConfig) // Add connection configuration to client
- .build(); // Build the Skyflow client instance
-
- // Step 2: Define the request body and headers
- // Map for request body parameters
- Map requestBody = new HashMap<>();
- requestBody.put("card_number", "4337-1696-5866-0865"); // Example card number
- requestBody.put("ssn", "524-41-4248"); // Example SSN
-
- // Map for request headers
- Map requestHeaders = new HashMap<>();
- requestHeaders.put("Content-Type", "application/json"); // Set content type for the request
-
- // Step 3: Build the InvokeConnectionRequest with required parameters
- // Set HTTP method to POST, include the request body and headers
- InvokeConnectionRequest invokeConnectionRequest = InvokeConnectionRequest.builder()
- .method(RequestMethod.POST) // HTTP POST method
- .requestBody(requestBody) // Add request body parameters
- .requestHeaders(requestHeaders) // Add headers
- .build(); // Build the request
-
- // Step 4: Invoke the connection and capture the response
- // Replace "" with the actual connection ID
- InvokeConnectionResponse invokeConnectionResponse = skyflowClient.connection("").invoke(invokeConnectionRequest);
-
- // Step 5: Print the response from the connection invocation
- System.out.println(invokeConnectionResponse); // Print the response to the console
-
- } catch (SkyflowException e) {
- // Step 6: Handle any exceptions that occur during the connection invocation
- System.out.println("Error occurred: ");
- e.printStackTrace(); // Print the exception stack trace for debugging
- }
+ "index": 1,
+ "code": 404,
+ "error": "Detokenize failed. Token 6ffb412b-a79d is invalid. Specify a valid token.",
}
-}
-```
-
-Sample response:
-
-```json
-{
- "data": {
- "card_number": "4337-1696-5866-0865",
- "ssn": "524-41-4248"
- },
- "metadata": {
- "requestId": "4a3453b5-7aa4-4373-98d7-cf102b1f6f97"
- }
+ ]
}
```
@@ -2606,11 +688,11 @@ This section covers methods for generating and managing tokens to authenticate A
## Generate a bearer token
-The [Service Account](https://github.com/skyflowapi/skyflow-java/tree/v2/src/main/java/com/skyflow/serviceaccount/util) Java module generates service account tokens using a service account credentials file, which is provided when a service account is created. The tokens generated by this module are valid for 60 minutes and can be used to make API calls to the [Data](https://docs.skyflow.com/record/) and [Management](https://docs.skyflow.com/management/) APIs, depending on the permissions assigned to the service account.
+The [Service Account](https://github.com/skyflowapi/skyflow-java/tree/v3/common/src/main/java/com/skyflow/serviceaccount/util) Java module generates service account tokens using a service account credentials file, which is provided when a service account is created. The tokens generated by this module are valid for 60 minutes and can be used to make API calls to the [Data](https://docs.skyflow.com/api/data/) and [Management](https://docs.skyflow.com/management/) APIs, depending on the permissions assigned to the service account.
The `BearerToken` utility class generates bearer tokens using a credentials JSON file. Alternatively, you can pass the credentials as a string.
-[Example](https://github.com/skyflowapi/skyflow-java/blob/main/samples/src/main/java/com/example/serviceaccount/BearerTokenGenerationExample.java):
+Example:
```java
/**
@@ -2679,7 +761,7 @@ public class BearerTokenGenerationExample {
A service account with the `context_id` identifier generates bearer tokens containing context information, represented as a JWT claim in a Skyflow-generated bearer token. Tokens generated from such service accounts include a `context_identifier` claim, are valid for 60 minutes, and can be used to make API calls to the Data and Management APIs, depending on the service account's permissions.
-[Example](https://github.com/skyflowapi/skyflow-java/blob/main/samples/src/main/java/com/example/serviceaccount/BearerTokenGenerationWithContextExample.java):
+Example:
```java
import com.skyflow.errors.SkyflowException;
@@ -2747,7 +829,7 @@ public class BearerTokenGenerationWithContextExample {
A service account with multiple roles can generate bearer tokens with access limited to a specific role by specifying the appropriate `roleID`. This can be used to limit access to specific roles for services with multiple responsibilities, such as segregating access for billing and analytics. The generated bearer tokens are valid for 60 minutes and can only execute operations permitted by the permissions associated with the designated role.
-[Example](https://github.com/skyflowapi/skyflow-java/blob/main/samples/src/main/java/com/example/serviceaccount/ScopedTokenGenerationExample.java):
+Example:
```java
import com.skyflow.errors.SkyflowException;
@@ -2798,7 +880,6 @@ Notes:
- You can pass either the file path of a service account key credentials file or the service account key credentials as a string to the `setCredentials` method of the `BearerTokenBuilder` class.
- If both a file path and a string are provided, the last method used takes precedence.
-- To generate multiple bearer tokens concurrently using threads, refer to the following [example](https://github.com/skyflowapi/skyflow-java/blob/main/samples/src/main/java/com/example/serviceaccount/BearerTokenGenerationUsingThreadsExample.java).
## Generate Signed Data Tokens
@@ -2807,7 +888,7 @@ with the private key of the service account credentials, which adds an additiona
be detokenized by passing the signed data token and a bearer token generated from service account credentials. The
service account must have appropriate permissions and context to detokenize the signed data tokens.
-[Example](https://github.com/skyflowapi/skyflow-java/blob/main/samples/src/main/java/com/example/serviceaccount/SignedTokenGenerationExample.java):
+Example:
```java
import com.skyflow.errors.SkyflowException;
@@ -2887,7 +968,7 @@ message: Authentication failed. Bearer token is expired. Use a valid bearer toke
If you encounter this kind of error, retry the request. During the retry, the SDK detects that the previous bearer token has expired and generates a new one for the current and subsequent requests.
-#### [Example](https://github.com/skyflowapi/skyflow-java/blob/v2/samples/src/main/java/com/example/serviceaccount/BearerTokenExpiryExample.java):
+#### Example:
```java
package com.example.serviceaccount;
@@ -2965,8 +1046,6 @@ public class DetokenizeExample {
// Building a detokenization request with the token list and configuration
DetokenizeRequest detokenizeRequest = DetokenizeRequest.builder()
.tokens(tokenList) // Adding tokens to the request
- .continueOnError(false) // Stop on error
- .redactionType(RedactionType.PLAIN_TEXT) // Redaction type (e.g., PLAIN_TEXT)
.build();
// Sending the detokenization request and receiving the response
@@ -3058,4 +1137,4 @@ public class ChangeLogLevel {
# Reporting a Vulnerability
-If you discover a potential security issue in this project, please reach out to us at **security@skyflow.com**. Please do not create public GitHub issues or Pull Requests, as malicious actors could potentially view them.
+If you discover a potential security issue in this project, please reach out to us at **security@skyflow.com**. Please do not create public GitHub issues or Pull Requests, as malicious actors could potentially view them.
\ No newline at end of file
diff --git a/common/pom.xml b/common/pom.xml
index d971c1b5..df90bb58 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,14 +5,18 @@
4.0.0
com.skyflow
- skyflow-java
+ skyflow
1.0.0
+ ../pom.xml
common
- 1.0.0
+ 1.0.1
+ ${project.groupId}:${project.artifactId}
+
+ true
8
8
UTF-8
diff --git a/common/src/main/java/com/skyflow/errors/ErrorMessage.java b/common/src/main/java/com/skyflow/errors/ErrorMessage.java
index e3b0bbbe..f4b2ce7b 100644
--- a/common/src/main/java/com/skyflow/errors/ErrorMessage.java
+++ b/common/src/main/java/com/skyflow/errors/ErrorMessage.java
@@ -6,6 +6,7 @@ public enum ErrorMessage {
// Client initialization
VaultIdAlreadyInConfigList("%s0 Validation error. VaultId is present in an existing config. Specify a new vaultId in config."),
VaultIdNotInConfigList("%s0 Validation error. VaultId is missing from the config. Specify the vaultIds from configs."),
+ OnlySingleVaultConfigAllowed("%s0 Validation error. A vault config already exists. Cannot add another vault config."),
ConnectionIdAlreadyInConfigList("%s0 Validation error. ConnectionId is present in an existing config. Specify a connectionId in config."),
ConnectionIdNotInConfigList("%s0 Validation error. ConnectionId is missing from the config. Specify the connectionIds from configs."),
EmptyCredentials("%s0 Validation error. Invalid credentials. Credentials must not be empty."),
@@ -51,6 +52,7 @@ public enum ErrorMessage {
JwtDecodeError("%s0 Validation error. Invalid access token. Verify your credentials."),
MissingAccessToken("%s0 Validation error. Access token not present in the response from bearer token generation. Verify your credentials."),
MissingTokenType("%s0 Validation error. Token type not present in the response from bearer token generation. Verify your credentials."),
+ BearerTokenExpired("%s0 Validation error. Bearer token is invalid or expired. Please provide a valid bearer token."),
// Insert
TableKeyError("%s0 Validation error. 'table' key is missing from the payload. Specify a 'table' key."),
@@ -148,7 +150,16 @@ public enum ErrorMessage {
FailedToSaveProcessedFile("%s0 Validation error. Failed to save the processed file. Ensure the output directory is valid and writable."),
InvalidAudioFileType("%s0 Validation error. The file type is not supported. Specify a valid file type mp3 or wav."),
// Generic
- ErrorOccurred("%s0 API error. Error occurred.")
+ ErrorOccurred("%s0 API error. Error occurred."),
+
+ DetokenizeRequestNull("%s0 Validation error. DetokenizeRequest object is null. Specify a valid DetokenizeRequest object."),
+
+ NullTokenGroupRedactions("%s0 Validation error. TokenGroupRedaction in the list is null. Specify a valid TokenGroupRedactions object."),
+
+ NullRedactionInTokenGroup("%s0 Validation error. Redaction in TokenGroupRedactions is null or empty. Specify a valid redaction."),
+
+ NullTokenGroupNameInTokenGroup("%s0 Validation error. TokenGroupName in TokenGroupRedactions is null or empty. Specify a valid tokenGroupName."),
+ ;
;
private final String message;
diff --git a/common/src/main/java/com/skyflow/generated/rest/ApiClient.java b/common/src/main/java/com/skyflow/generated/auth/rest/ApiClient.java
similarity index 73%
rename from common/src/main/java/com/skyflow/generated/rest/ApiClient.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/ApiClient.java
index f49fc4c3..721942e9 100644
--- a/common/src/main/java/com/skyflow/generated/rest/ApiClient.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/ApiClient.java
@@ -1,11 +1,11 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest;
+package com.skyflow.generated.auth.rest;
-import com.skyflow.generated.rest.core.ClientOptions;
-import com.skyflow.generated.rest.core.Suppliers;
-import com.skyflow.generated.rest.resources.authentication.AuthenticationClient;
+import com.skyflow.generated.auth.rest.core.ClientOptions;
+import com.skyflow.generated.auth.rest.core.Suppliers;
+import com.skyflow.generated.auth.rest.resources.authentication.AuthenticationClient;
import java.util.function.Supplier;
public class ApiClient {
diff --git a/common/src/main/java/com/skyflow/generated/rest/ApiClientBuilder.java b/common/src/main/java/com/skyflow/generated/auth/rest/ApiClientBuilder.java
similarity index 91%
rename from common/src/main/java/com/skyflow/generated/rest/ApiClientBuilder.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/ApiClientBuilder.java
index b361812a..aed3ed24 100644
--- a/common/src/main/java/com/skyflow/generated/rest/ApiClientBuilder.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/ApiClientBuilder.java
@@ -1,10 +1,10 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest;
+package com.skyflow.generated.auth.rest;
-import com.skyflow.generated.rest.core.ClientOptions;
-import com.skyflow.generated.rest.core.Environment;
+import com.skyflow.generated.auth.rest.core.ClientOptions;
+import com.skyflow.generated.auth.rest.core.Environment;
import okhttp3.OkHttpClient;
public final class ApiClientBuilder {
diff --git a/common/src/main/java/com/skyflow/generated/rest/AsyncApiClient.java b/common/src/main/java/com/skyflow/generated/auth/rest/AsyncApiClient.java
similarity index 73%
rename from common/src/main/java/com/skyflow/generated/rest/AsyncApiClient.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/AsyncApiClient.java
index d9163e14..674a9ef9 100644
--- a/common/src/main/java/com/skyflow/generated/rest/AsyncApiClient.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/AsyncApiClient.java
@@ -1,11 +1,11 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest;
+package com.skyflow.generated.auth.rest;
-import com.skyflow.generated.rest.core.ClientOptions;
-import com.skyflow.generated.rest.core.Suppliers;
-import com.skyflow.generated.rest.resources.authentication.AsyncAuthenticationClient;
+import com.skyflow.generated.auth.rest.core.ClientOptions;
+import com.skyflow.generated.auth.rest.core.Suppliers;
+import com.skyflow.generated.auth.rest.resources.authentication.AsyncAuthenticationClient;
import java.util.function.Supplier;
public class AsyncApiClient {
diff --git a/common/src/main/java/com/skyflow/generated/rest/AsyncApiClientBuilder.java b/common/src/main/java/com/skyflow/generated/auth/rest/AsyncApiClientBuilder.java
similarity index 91%
rename from common/src/main/java/com/skyflow/generated/rest/AsyncApiClientBuilder.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/AsyncApiClientBuilder.java
index 8e4b8474..2e30d45a 100644
--- a/common/src/main/java/com/skyflow/generated/rest/AsyncApiClientBuilder.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/AsyncApiClientBuilder.java
@@ -1,10 +1,10 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest;
+package com.skyflow.generated.auth.rest;
-import com.skyflow.generated.rest.core.ClientOptions;
-import com.skyflow.generated.rest.core.Environment;
+import com.skyflow.generated.auth.rest.core.ClientOptions;
+import com.skyflow.generated.auth.rest.core.Environment;
import okhttp3.OkHttpClient;
public final class AsyncApiClientBuilder {
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/ApiClientApiException.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/ApiClientApiException.java
similarity index 97%
rename from common/src/main/java/com/skyflow/generated/rest/core/ApiClientApiException.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/ApiClientApiException.java
index a4487b1e..dc4c008c 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/ApiClientApiException.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/ApiClientApiException.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
import java.util.ArrayList;
import java.util.HashMap;
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/ApiClientException.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/ApiClientException.java
similarity index 89%
rename from common/src/main/java/com/skyflow/generated/rest/core/ApiClientException.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/ApiClientException.java
index 7987eba6..f08afa2e 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/ApiClientException.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/ApiClientException.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
/**
* This class serves as the base exception for all errors in the SDK.
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/ApiClientHttpResponse.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/ApiClientHttpResponse.java
similarity index 95%
rename from common/src/main/java/com/skyflow/generated/rest/core/ApiClientHttpResponse.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/ApiClientHttpResponse.java
index 9c81f1f5..733c056c 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/ApiClientHttpResponse.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/ApiClientHttpResponse.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
import java.util.ArrayList;
import java.util.HashMap;
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/ClientOptions.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/ClientOptions.java
similarity index 99%
rename from common/src/main/java/com/skyflow/generated/rest/core/ClientOptions.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/ClientOptions.java
index e7388551..4dd049dd 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/ClientOptions.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/ClientOptions.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
import java.util.HashMap;
import java.util.Map;
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/DateTimeDeserializer.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/DateTimeDeserializer.java
similarity index 97%
rename from common/src/main/java/com/skyflow/generated/rest/core/DateTimeDeserializer.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/DateTimeDeserializer.java
index 6be10979..a5a2fbe8 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/DateTimeDeserializer.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/DateTimeDeserializer.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/Environment.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/Environment.java
similarity index 92%
rename from common/src/main/java/com/skyflow/generated/rest/core/Environment.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/Environment.java
index c5a294b7..098667c0 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/Environment.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/Environment.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
public final class Environment {
public static final Environment PRODUCTION = new Environment("https://manage.skyflowapis.com");
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/FileStream.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/FileStream.java
similarity index 97%
rename from common/src/main/java/com/skyflow/generated/rest/core/FileStream.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/FileStream.java
index 6b459431..b1aad352 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/FileStream.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/FileStream.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
import java.io.InputStream;
import java.util.Objects;
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/InputStreamRequestBody.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/InputStreamRequestBody.java
similarity index 98%
rename from common/src/main/java/com/skyflow/generated/rest/core/InputStreamRequestBody.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/InputStreamRequestBody.java
index 545f6088..22b17b14 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/InputStreamRequestBody.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/InputStreamRequestBody.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
import java.io.IOException;
import java.io.InputStream;
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/MediaTypes.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/MediaTypes.java
similarity index 84%
rename from common/src/main/java/com/skyflow/generated/rest/core/MediaTypes.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/MediaTypes.java
index 11714cb8..d4374647 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/MediaTypes.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/MediaTypes.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
import okhttp3.MediaType;
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/Nullable.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/Nullable.java
similarity index 98%
rename from common/src/main/java/com/skyflow/generated/rest/core/Nullable.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/Nullable.java
index 5929c12d..efabe806 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/Nullable.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/Nullable.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
import java.util.Optional;
import java.util.function.Function;
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/NullableNonemptyFilter.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/NullableNonemptyFilter.java
similarity index 90%
rename from common/src/main/java/com/skyflow/generated/rest/core/NullableNonemptyFilter.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/NullableNonemptyFilter.java
index 98c33be4..dd32d66c 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/NullableNonemptyFilter.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/NullableNonemptyFilter.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
import java.util.Optional;
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/ObjectMappers.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/ObjectMappers.java
similarity index 96%
rename from common/src/main/java/com/skyflow/generated/rest/core/ObjectMappers.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/ObjectMappers.java
index 3b7894e0..ee160b93 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/ObjectMappers.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/ObjectMappers.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/QueryStringMapper.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/QueryStringMapper.java
similarity index 99%
rename from common/src/main/java/com/skyflow/generated/rest/core/QueryStringMapper.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/QueryStringMapper.java
index e9e18fb9..b35c7174 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/QueryStringMapper.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/QueryStringMapper.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/RequestOptions.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/RequestOptions.java
similarity index 98%
rename from common/src/main/java/com/skyflow/generated/rest/core/RequestOptions.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/RequestOptions.java
index edc6d0ae..b70c02df 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/RequestOptions.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/RequestOptions.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
import java.util.HashMap;
import java.util.Map;
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/ResponseBodyInputStream.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/ResponseBodyInputStream.java
similarity index 97%
rename from common/src/main/java/com/skyflow/generated/rest/core/ResponseBodyInputStream.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/ResponseBodyInputStream.java
index d8df7715..5bb66b4a 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/ResponseBodyInputStream.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/ResponseBodyInputStream.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
import java.io.FilterInputStream;
import java.io.IOException;
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/ResponseBodyReader.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/ResponseBodyReader.java
similarity index 97%
rename from common/src/main/java/com/skyflow/generated/rest/core/ResponseBodyReader.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/ResponseBodyReader.java
index ed894407..e3052b4c 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/ResponseBodyReader.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/ResponseBodyReader.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
import java.io.FilterReader;
import java.io.IOException;
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/RetryInterceptor.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/RetryInterceptor.java
similarity index 98%
rename from common/src/main/java/com/skyflow/generated/rest/core/RetryInterceptor.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/RetryInterceptor.java
index eda7d265..93e86644 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/RetryInterceptor.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/RetryInterceptor.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
import java.io.IOException;
import java.time.Duration;
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/Stream.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/Stream.java
similarity index 98%
rename from common/src/main/java/com/skyflow/generated/rest/core/Stream.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/Stream.java
index f037712a..4a984faa 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/Stream.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/Stream.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
import java.io.Reader;
import java.util.Iterator;
diff --git a/common/src/main/java/com/skyflow/generated/rest/core/Suppliers.java b/common/src/main/java/com/skyflow/generated/auth/rest/core/Suppliers.java
similarity index 93%
rename from common/src/main/java/com/skyflow/generated/rest/core/Suppliers.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/core/Suppliers.java
index 307d5852..d3ab5e53 100644
--- a/common/src/main/java/com/skyflow/generated/rest/core/Suppliers.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/core/Suppliers.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.core;
+package com.skyflow.generated.auth.rest.core;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;
diff --git a/common/src/main/java/com/skyflow/generated/rest/errors/BadRequestError.java b/common/src/main/java/com/skyflow/generated/auth/rest/errors/BadRequestError.java
similarity index 86%
rename from common/src/main/java/com/skyflow/generated/rest/errors/BadRequestError.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/errors/BadRequestError.java
index d4b2d99f..ec08ddf2 100644
--- a/common/src/main/java/com/skyflow/generated/rest/errors/BadRequestError.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/errors/BadRequestError.java
@@ -1,9 +1,9 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.errors;
+package com.skyflow.generated.auth.rest.errors;
-import com.skyflow.generated.rest.core.ApiClientApiException;
+import com.skyflow.generated.auth.rest.core.ApiClientApiException;
import java.util.Map;
import okhttp3.Response;
diff --git a/common/src/main/java/com/skyflow/generated/rest/errors/HttpStatus.java b/common/src/main/java/com/skyflow/generated/auth/rest/errors/HttpStatus.java
similarity index 83%
rename from common/src/main/java/com/skyflow/generated/rest/errors/HttpStatus.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/errors/HttpStatus.java
index dc9aecfe..2e1c45d2 100644
--- a/common/src/main/java/com/skyflow/generated/rest/errors/HttpStatus.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/errors/HttpStatus.java
@@ -1,4 +1,4 @@
-package com.skyflow.generated.rest.errors;
+package com.skyflow.generated.auth.rest.errors;
public enum HttpStatus {
BAD_REQUEST("Bad Request");
diff --git a/common/src/main/java/com/skyflow/generated/rest/errors/NotFoundError.java b/common/src/main/java/com/skyflow/generated/auth/rest/errors/NotFoundError.java
similarity index 86%
rename from common/src/main/java/com/skyflow/generated/rest/errors/NotFoundError.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/errors/NotFoundError.java
index 46291af6..b889e1b0 100644
--- a/common/src/main/java/com/skyflow/generated/rest/errors/NotFoundError.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/errors/NotFoundError.java
@@ -1,9 +1,9 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.errors;
+package com.skyflow.generated.auth.rest.errors;
-import com.skyflow.generated.rest.core.ApiClientApiException;
+import com.skyflow.generated.auth.rest.core.ApiClientApiException;
import java.util.Map;
import okhttp3.Response;
diff --git a/common/src/main/java/com/skyflow/generated/rest/errors/UnauthorizedError.java b/common/src/main/java/com/skyflow/generated/auth/rest/errors/UnauthorizedError.java
similarity index 86%
rename from common/src/main/java/com/skyflow/generated/rest/errors/UnauthorizedError.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/errors/UnauthorizedError.java
index 1e90cfc2..40ea9c25 100644
--- a/common/src/main/java/com/skyflow/generated/rest/errors/UnauthorizedError.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/errors/UnauthorizedError.java
@@ -1,9 +1,9 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.errors;
+package com.skyflow.generated.auth.rest.errors;
-import com.skyflow.generated.rest.core.ApiClientApiException;
+import com.skyflow.generated.auth.rest.core.ApiClientApiException;
import java.util.Map;
import okhttp3.Response;
diff --git a/common/src/main/java/com/skyflow/generated/rest/resources/authentication/AsyncAuthenticationClient.java b/common/src/main/java/com/skyflow/generated/auth/rest/resources/authentication/AsyncAuthenticationClient.java
similarity index 84%
rename from common/src/main/java/com/skyflow/generated/rest/resources/authentication/AsyncAuthenticationClient.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/resources/authentication/AsyncAuthenticationClient.java
index 43ffab73..e75fad24 100644
--- a/common/src/main/java/com/skyflow/generated/rest/resources/authentication/AsyncAuthenticationClient.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/resources/authentication/AsyncAuthenticationClient.java
@@ -1,12 +1,13 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.resources.authentication;
+package com.skyflow.generated.auth.rest.resources.authentication;
+
+import com.skyflow.generated.auth.rest.core.ClientOptions;
+import com.skyflow.generated.auth.rest.core.RequestOptions;
+import com.skyflow.generated.auth.rest.types.V1GetAuthTokenResponse;
+import com.skyflow.generated.auth.rest.resources.authentication.requests.V1GetAuthTokenRequest;
-import com.skyflow.generated.rest.core.ClientOptions;
-import com.skyflow.generated.rest.core.RequestOptions;
-import com.skyflow.generated.rest.resources.authentication.requests.V1GetAuthTokenRequest;
-import com.skyflow.generated.rest.types.V1GetAuthTokenResponse;
import java.util.concurrent.CompletableFuture;
public class AsyncAuthenticationClient {
diff --git a/common/src/main/java/com/skyflow/generated/rest/resources/authentication/AsyncRawAuthenticationClient.java b/common/src/main/java/com/skyflow/generated/auth/rest/resources/authentication/AsyncRawAuthenticationClient.java
similarity index 87%
rename from common/src/main/java/com/skyflow/generated/rest/resources/authentication/AsyncRawAuthenticationClient.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/resources/authentication/AsyncRawAuthenticationClient.java
index 10ad0c01..61ff4335 100644
--- a/common/src/main/java/com/skyflow/generated/rest/resources/authentication/AsyncRawAuthenticationClient.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/resources/authentication/AsyncRawAuthenticationClient.java
@@ -1,22 +1,23 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.resources.authentication;
+package com.skyflow.generated.auth.rest.resources.authentication;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
-import com.skyflow.generated.rest.core.ApiClientApiException;
-import com.skyflow.generated.rest.core.ApiClientException;
-import com.skyflow.generated.rest.core.ApiClientHttpResponse;
-import com.skyflow.generated.rest.core.ClientOptions;
-import com.skyflow.generated.rest.core.MediaTypes;
-import com.skyflow.generated.rest.core.ObjectMappers;
-import com.skyflow.generated.rest.core.RequestOptions;
-import com.skyflow.generated.rest.errors.BadRequestError;
-import com.skyflow.generated.rest.errors.NotFoundError;
-import com.skyflow.generated.rest.errors.UnauthorizedError;
-import com.skyflow.generated.rest.resources.authentication.requests.V1GetAuthTokenRequest;
-import com.skyflow.generated.rest.types.V1GetAuthTokenResponse;
+import com.skyflow.generated.auth.rest.errors.BadRequestError;
+import com.skyflow.generated.auth.rest.errors.NotFoundError;
+import com.skyflow.generated.auth.rest.errors.UnauthorizedError;
+import com.skyflow.generated.auth.rest.resources.authentication.requests.V1GetAuthTokenRequest;
+import com.skyflow.generated.auth.rest.types.V1GetAuthTokenResponse;
+import com.skyflow.generated.auth.rest.core.ApiClientApiException;
+import com.skyflow.generated.auth.rest.core.ApiClientException;
+import com.skyflow.generated.auth.rest.core.ApiClientHttpResponse;
+import com.skyflow.generated.auth.rest.core.ClientOptions;
+import com.skyflow.generated.auth.rest.core.MediaTypes;
+import com.skyflow.generated.auth.rest.core.ObjectMappers;
+import com.skyflow.generated.auth.rest.core.RequestOptions;
+
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
diff --git a/common/src/main/java/com/skyflow/generated/rest/resources/authentication/AuthenticationClient.java b/common/src/main/java/com/skyflow/generated/auth/rest/resources/authentication/AuthenticationClient.java
similarity index 82%
rename from common/src/main/java/com/skyflow/generated/rest/resources/authentication/AuthenticationClient.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/resources/authentication/AuthenticationClient.java
index 662bfb3d..a0ba860a 100644
--- a/common/src/main/java/com/skyflow/generated/rest/resources/authentication/AuthenticationClient.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/resources/authentication/AuthenticationClient.java
@@ -1,12 +1,12 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.resources.authentication;
+package com.skyflow.generated.auth.rest.resources.authentication;
-import com.skyflow.generated.rest.core.ClientOptions;
-import com.skyflow.generated.rest.core.RequestOptions;
-import com.skyflow.generated.rest.resources.authentication.requests.V1GetAuthTokenRequest;
-import com.skyflow.generated.rest.types.V1GetAuthTokenResponse;
+import com.skyflow.generated.auth.rest.core.ClientOptions;
+import com.skyflow.generated.auth.rest.core.RequestOptions;
+import com.skyflow.generated.auth.rest.resources.authentication.requests.V1GetAuthTokenRequest;
+import com.skyflow.generated.auth.rest.types.V1GetAuthTokenResponse;
public class AuthenticationClient {
protected final ClientOptions clientOptions;
diff --git a/common/src/main/java/com/skyflow/generated/rest/resources/authentication/RawAuthenticationClient.java b/common/src/main/java/com/skyflow/generated/auth/rest/resources/authentication/RawAuthenticationClient.java
similarity index 84%
rename from common/src/main/java/com/skyflow/generated/rest/resources/authentication/RawAuthenticationClient.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/resources/authentication/RawAuthenticationClient.java
index c30cf003..f3211ad1 100644
--- a/common/src/main/java/com/skyflow/generated/rest/resources/authentication/RawAuthenticationClient.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/resources/authentication/RawAuthenticationClient.java
@@ -1,22 +1,23 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.resources.authentication;
+package com.skyflow.generated.auth.rest.resources.authentication;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
-import com.skyflow.generated.rest.core.ApiClientApiException;
-import com.skyflow.generated.rest.core.ApiClientException;
-import com.skyflow.generated.rest.core.ApiClientHttpResponse;
-import com.skyflow.generated.rest.core.ClientOptions;
-import com.skyflow.generated.rest.core.MediaTypes;
-import com.skyflow.generated.rest.core.ObjectMappers;
-import com.skyflow.generated.rest.core.RequestOptions;
-import com.skyflow.generated.rest.errors.BadRequestError;
-import com.skyflow.generated.rest.errors.NotFoundError;
-import com.skyflow.generated.rest.errors.UnauthorizedError;
-import com.skyflow.generated.rest.resources.authentication.requests.V1GetAuthTokenRequest;
-import com.skyflow.generated.rest.types.V1GetAuthTokenResponse;
+import com.skyflow.generated.auth.rest.errors.BadRequestError;
+import com.skyflow.generated.auth.rest.errors.NotFoundError;
+import com.skyflow.generated.auth.rest.errors.UnauthorizedError;
+import com.skyflow.generated.auth.rest.types.V1GetAuthTokenResponse;
+import com.skyflow.generated.auth.rest.core.ApiClientApiException;
+import com.skyflow.generated.auth.rest.core.ApiClientException;
+import com.skyflow.generated.auth.rest.core.ApiClientHttpResponse;
+import com.skyflow.generated.auth.rest.core.ClientOptions;
+import com.skyflow.generated.auth.rest.core.MediaTypes;
+import com.skyflow.generated.auth.rest.core.ObjectMappers;
+import com.skyflow.generated.auth.rest.core.RequestOptions;
+import com.skyflow.generated.auth.rest.resources.authentication.requests.V1GetAuthTokenRequest;
+
import java.io.IOException;
import java.util.Map;
import okhttp3.Headers;
diff --git a/common/src/main/java/com/skyflow/generated/rest/resources/authentication/requests/V1GetAuthTokenRequest.java b/common/src/main/java/com/skyflow/generated/auth/rest/resources/authentication/requests/V1GetAuthTokenRequest.java
similarity index 98%
rename from common/src/main/java/com/skyflow/generated/rest/resources/authentication/requests/V1GetAuthTokenRequest.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/resources/authentication/requests/V1GetAuthTokenRequest.java
index 8c4961b1..cd1d22c1 100644
--- a/common/src/main/java/com/skyflow/generated/rest/resources/authentication/requests/V1GetAuthTokenRequest.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/resources/authentication/requests/V1GetAuthTokenRequest.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.resources.authentication.requests;
+package com.skyflow.generated.auth.rest.resources.authentication.requests;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
@@ -11,7 +11,8 @@
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.skyflow.generated.rest.core.ObjectMappers;
+import com.skyflow.generated.auth.rest.core.ObjectMappers;
+
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
diff --git a/common/src/main/java/com/skyflow/generated/rest/types/GooglerpcStatus.java b/common/src/main/java/com/skyflow/generated/auth/rest/types/GooglerpcStatus.java
similarity index 97%
rename from common/src/main/java/com/skyflow/generated/rest/types/GooglerpcStatus.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/types/GooglerpcStatus.java
index d0290573..06a9373c 100644
--- a/common/src/main/java/com/skyflow/generated/rest/types/GooglerpcStatus.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/types/GooglerpcStatus.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.types;
+package com.skyflow.generated.auth.rest.types;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
@@ -11,7 +11,7 @@
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.skyflow.generated.rest.core.ObjectMappers;
+import com.skyflow.generated.auth.rest.core.ObjectMappers;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
diff --git a/common/src/main/java/com/skyflow/generated/rest/types/ProtobufAny.java b/common/src/main/java/com/skyflow/generated/auth/rest/types/ProtobufAny.java
similarity index 96%
rename from common/src/main/java/com/skyflow/generated/rest/types/ProtobufAny.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/types/ProtobufAny.java
index 37555aae..6f5df772 100644
--- a/common/src/main/java/com/skyflow/generated/rest/types/ProtobufAny.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/types/ProtobufAny.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.types;
+package com.skyflow.generated.auth.rest.types;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
@@ -11,7 +11,7 @@
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.skyflow.generated.rest.core.ObjectMappers;
+import com.skyflow.generated.auth.rest.core.ObjectMappers;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
diff --git a/common/src/main/java/com/skyflow/generated/rest/types/V1GetAuthTokenResponse.java b/common/src/main/java/com/skyflow/generated/auth/rest/types/V1GetAuthTokenResponse.java
similarity index 97%
rename from common/src/main/java/com/skyflow/generated/rest/types/V1GetAuthTokenResponse.java
rename to common/src/main/java/com/skyflow/generated/auth/rest/types/V1GetAuthTokenResponse.java
index 9b6be70b..3c10fbd3 100644
--- a/common/src/main/java/com/skyflow/generated/rest/types/V1GetAuthTokenResponse.java
+++ b/common/src/main/java/com/skyflow/generated/auth/rest/types/V1GetAuthTokenResponse.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.skyflow.generated.rest.types;
+package com.skyflow.generated.auth.rest.types;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
@@ -11,7 +11,7 @@
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.skyflow.generated.rest.core.ObjectMappers;
+import com.skyflow.generated.auth.rest.core.ObjectMappers;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
diff --git a/common/src/main/java/com/skyflow/logs/ErrorLogs.java b/common/src/main/java/com/skyflow/logs/ErrorLogs.java
index 3415860c..8f1156fd 100644
--- a/common/src/main/java/com/skyflow/logs/ErrorLogs.java
+++ b/common/src/main/java/com/skyflow/logs/ErrorLogs.java
@@ -66,6 +66,15 @@ public enum ErrorLogs {
EMPTY_OR_NULL_TOKEN_IN_DETOKENIZE_DATA("Invalid %s1 request. Token can not be null or empty in detokenize data at index %s2."),
REDACTION_IS_REQUIRED("Invalid %s1 request. Redaction is required."),
DETOKENIZE_REQUEST_REJECTED("Detokenize request resulted in failure."),
+ DETOKENIZE_REQUEST_NULL("Invalid %s1 request. Detokenize request can not be null."),
+
+ NULL_TOKEN_REDACTION_GROUP_OBJECT("Invalid %s1 request. Token Redaction group object can not be null or empty."),
+
+ NULL_REDACTION_IN_TOKEN_GROUP("Invalid %s1 request. Redaction can not be null in token redaction group"),
+
+ NULL_TOKEN_GROUP_NAME_IN_TOKEN_GROUP("Invalid %s1 request. Token group name can not be null in token redaction group"),
+
+ EMPTY_OR_NULL_REDACTION_IN_TOKEN_GROUP("Invalid %s1 request. Redaction can not be null or empty in token redaction group"),
IDS_IS_REQUIRED("Invalid %s1 request. Ids are required."),
EMPTY_IDS("Invalid %s1 request. Ids can not be empty."),
EMPTY_OR_NULL_ID_IN_IDS("Invalid %s1 request. Id can not be null or empty in ids at index %s2."),
@@ -126,7 +135,10 @@ public enum ErrorLogs {
OUTPUT_DIRECTORY_NOT_FOUND("Invalid %s1 request. The output directory does not exist. Please specify a valid output directory."),
INVALID_PERMISSIONS_FOR_OUTPUT_DIRECTORY("Invalid %s1 request. The output directory is not writable. Please check the permissions or specify a valid output directory."),
EMPTY_FILE_AND_FILE_PATH_IN_DEIDENTIFY_FILE("Invalid %s1 request. The file and file path fields are both empty. Specify a valid file object or file path."),
- ;
+
+ UNEXPECTED_ERROR_DURING_BATCH_PROCESSING("Unexpected error occurred during batch processing. Error: %s1"),
+
+ PROCESSING_ERROR_RESPONSE("Processing error response.");
private final String log;
diff --git a/common/src/main/java/com/skyflow/logs/InfoLogs.java b/common/src/main/java/com/skyflow/logs/InfoLogs.java
index efd81a49..9727e811 100644
--- a/common/src/main/java/com/skyflow/logs/InfoLogs.java
+++ b/common/src/main/java/com/skyflow/logs/InfoLogs.java
@@ -20,7 +20,8 @@ public enum InfoLogs {
GET_SIGNED_DATA_TOKENS_TRIGGERED("getSignedDataTokens method triggered."),
GET_SIGNED_DATA_TOKEN_SUCCESS("Signed data tokens generated."),
REUSE_BEARER_TOKEN("Reusing bearer token."),
- REUSE_API_KEY("Reusing api key."),
+ USE_CLIENT_PROVIDED_BEARER_TOKEN("Using bearer token provided by client."),
+ USE_API_KEY("Using api key."),
GENERATE_BEARER_TOKEN_FROM_CREDENTIALS_TRIGGERED("generateBearerTokenFromCredentials method triggered."),
GENERATE_BEARER_TOKEN_FROM_CREDENTIALS_STRING_TRIGGERED("generateBearerTokenFromCredentialString method triggered."),
GENERATE_SIGNED_TOKENS_FROM_CREDENTIALS_FILE_TRIGGERED("generateSignedTokensFromCredentialsFile method triggered."),
@@ -90,6 +91,8 @@ public enum InfoLogs {
GET_DETECT_RUN_TRIGGERED("Get detect run method triggered."),
VALIDATE_GET_DETECT_RUN_REQUEST("Validating get detect run request."),
REIDENTIFY_TEXT_SUCCESS("Text data re-identified."),
+
+ PROCESSING_BATCHES("Processing batch"),
;
diff --git a/common/src/main/java/com/skyflow/logs/WarningLogs.java b/common/src/main/java/com/skyflow/logs/WarningLogs.java
index 8d49f056..5f80a728 100644
--- a/common/src/main/java/com/skyflow/logs/WarningLogs.java
+++ b/common/src/main/java/com/skyflow/logs/WarningLogs.java
@@ -1,7 +1,11 @@
package com.skyflow.logs;
public enum WarningLogs {
- OVERRIDING_EXISTING_VAULT_CONFIG("New vault config identified. Overriding existing vault config");
+ INVALID_BATCH_SIZE_PROVIDED("Invalid value for batch size provided, switching to default value."),
+ INVALID_CONCURRENCY_LIMIT_PROVIDED("Invalid value for concurrency limit provided, switching to default value."),
+ BATCH_SIZE_EXCEEDS_MAX_LIMIT("Provided batch size exceeds the maximum limit, switching to max limit."),
+ CONCURRENCY_EXCEEDS_MAX_LIMIT("Provided concurrency limit exceeds the maximum limit, switching to max limit.")
+ ;
private final String log;
diff --git a/common/src/main/java/com/skyflow/serviceaccount/util/BearerToken.java b/common/src/main/java/com/skyflow/serviceaccount/util/BearerToken.java
index f2c15a6f..9f0fc0e3 100644
--- a/common/src/main/java/com/skyflow/serviceaccount/util/BearerToken.java
+++ b/common/src/main/java/com/skyflow/serviceaccount/util/BearerToken.java
@@ -4,12 +4,12 @@
import com.skyflow.errors.ErrorCode;
import com.skyflow.errors.ErrorMessage;
import com.skyflow.errors.SkyflowException;
-import com.skyflow.generated.rest.ApiClient;
-import com.skyflow.generated.rest.ApiClientBuilder;
-import com.skyflow.generated.rest.core.ApiClientApiException;
-import com.skyflow.generated.rest.resources.authentication.AuthenticationClient;
-import com.skyflow.generated.rest.resources.authentication.requests.V1GetAuthTokenRequest;
-import com.skyflow.generated.rest.types.V1GetAuthTokenResponse;
+import com.skyflow.generated.auth.rest.ApiClient;
+import com.skyflow.generated.auth.rest.ApiClientBuilder;
+import com.skyflow.generated.auth.rest.core.ApiClientApiException;
+import com.skyflow.generated.auth.rest.resources.authentication.AuthenticationClient;
+import com.skyflow.generated.auth.rest.resources.authentication.requests.V1GetAuthTokenRequest;
+import com.skyflow.generated.auth.rest.types.V1GetAuthTokenResponse;
import com.skyflow.logs.ErrorLogs;
import com.skyflow.logs.InfoLogs;
import com.skyflow.utils.BaseConstants;
diff --git a/common/src/main/java/com/skyflow/utils/BaseConstants.java b/common/src/main/java/com/skyflow/utils/BaseConstants.java
index f38be8e8..0880034f 100644
--- a/common/src/main/java/com/skyflow/utils/BaseConstants.java
+++ b/common/src/main/java/com/skyflow/utils/BaseConstants.java
@@ -7,10 +7,13 @@ public class BaseConstants {
public static final String ORDER_ASCENDING = "ASCENDING";
public static final String ENV_CREDENTIALS_KEY_NAME = "SKYFLOW_CREDENTIALS";
public static final String SECURE_PROTOCOL = "https://";
- public static final String DEV_DOMAIN = ".vault.skyflowapis.dev";
- public static final String STAGE_DOMAIN = ".vault.skyflowapis.tech";
- public static final String SANDBOX_DOMAIN = ".vault.skyflowapis-preview.com";
- public static final String PROD_DOMAIN = ".vault.skyflowapis.com";
+
+ public static final String V2_VAULT_DOMAIN = ".vault.";
+ public static final String V3_VAULT_DOMAIN = ".skyvault.";
+ public static final String DEV_DOMAIN = "skyflowapis.dev";
+ public static final String STAGE_DOMAIN = "skyflowapis.tech";
+ public static final String SANDBOX_DOMAIN = "skyflowapis-preview.com";
+ public static final String PROD_DOMAIN = "skyflowapis.com";
public static final String PKCS8_PRIVATE_HEADER = "-----BEGIN PRIVATE KEY-----";
public static final String PKCS8_PRIVATE_FOOTER = "-----END PRIVATE KEY-----";
public static final String GRANT_TYPE = "urn:ietf:params:oauth:grant-type:jwt-bearer";
diff --git a/common/src/main/java/com/skyflow/utils/BaseUtils.java b/common/src/main/java/com/skyflow/utils/BaseUtils.java
index b51aaaf3..b7cf6bb0 100644
--- a/common/src/main/java/com/skyflow/utils/BaseUtils.java
+++ b/common/src/main/java/com/skyflow/utils/BaseUtils.java
@@ -9,6 +9,7 @@
import com.skyflow.logs.ErrorLogs;
import com.skyflow.logs.InfoLogs;
import com.skyflow.serviceaccount.util.BearerToken;
+import com.skyflow.serviceaccount.util.Token;
import com.skyflow.utils.logger.LogUtil;
import org.apache.commons.codec.binary.Base64;
@@ -22,9 +23,8 @@
import java.security.spec.PKCS8EncodedKeySpec;
public class BaseUtils {
- public static String getVaultURL(String clusterId, Env env) {
- StringBuilder sb = new StringBuilder(BaseConstants.SECURE_PROTOCOL);
- sb.append(clusterId);
+ public static String getVaultURL(String clusterId, Env env, String vaultDomain) {
+ StringBuilder sb = buildBaseUrl(clusterId, vaultDomain);
switch (env) {
case DEV:
sb.append(BaseConstants.DEV_DOMAIN);
@@ -44,23 +44,31 @@ public static String getVaultURL(String clusterId, Env env) {
}
public static String generateBearerToken(Credentials credentials) throws SkyflowException {
+ String bearerToken;
if (credentials.getPath() != null) {
- return BearerToken.builder()
+ bearerToken = BearerToken.builder()
.setCredentials(new File(credentials.getPath()))
.setRoles(credentials.getRoles())
.setCtx(credentials.getContext())
.build()
.getBearerToken();
} else if (credentials.getCredentialsString() != null) {
- return BearerToken.builder()
+ bearerToken = BearerToken.builder()
.setCredentials(credentials.getCredentialsString())
.setRoles(credentials.getRoles())
.setCtx(credentials.getContext())
.build()
.getBearerToken();
} else {
- return credentials.getToken();
+ LogUtil.printInfoLog(InfoLogs.USE_CLIENT_PROVIDED_BEARER_TOKEN.getLog());
+ bearerToken = credentials.getToken();
+ }
+ // check expiry for generated token
+ if (Token.isExpired(bearerToken)) {
+ LogUtil.printErrorLog(ErrorLogs.INVALID_BEARER_TOKEN.getLog());
+ throw new SkyflowException(ErrorCode.INVALID_INPUT.getCode(), ErrorMessage.BearerTokenExpired.getMessage());
}
+ return bearerToken;
}
public static PrivateKey getPrivateKeyFromPem(String pemKey) throws SkyflowException {
@@ -160,4 +168,10 @@ private static PrivateKey parsePkcs8PrivateKey(byte[] pkcs8Bytes) throws Skyflow
return privateKey;
}
+ private static StringBuilder buildBaseUrl(String clusterId, String vaultDomain) {
+ StringBuilder sb = new StringBuilder(BaseConstants.SECURE_PROTOCOL);
+ sb.append(clusterId);
+ sb.append(vaultDomain);
+ return sb;
+ }
}
diff --git a/common/src/main/java/com/skyflow/vault/data/BaseGetRequest.java b/common/src/main/java/com/skyflow/vault/data/BaseGetRequest.java
deleted file mode 100644
index c6d828cc..00000000
--- a/common/src/main/java/com/skyflow/vault/data/BaseGetRequest.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package com.skyflow.vault.data;
-
-import com.skyflow.utils.BaseConstants;
-
-import java.util.ArrayList;
-
-class BaseGetRequest {
- private final BaseGetRequestBuilder builder;
-
- protected BaseGetRequest(BaseGetRequestBuilder builder) {
- this.builder = builder;
- }
-
- public String getTable() {
- return this.builder.table;
- }
-
- public ArrayList getIds() {
- return this.builder.ids;
- }
-
- public Boolean getReturnTokens() {
- return this.builder.returnTokens;
- }
-
- public ArrayList getFields() {
- return this.builder.fields;
- }
-
- public String getOffset() {
- return this.builder.offset;
- }
-
- public String getLimit() {
- return this.builder.limit;
- }
-
- public Boolean getDownloadURL() {
- return this.builder.downloadURL;
- }
-
- public String getColumnName() {
- return this.builder.columnName;
- }
-
- public ArrayList getColumnValues() {
- return this.builder.columnValues;
- }
-
- public String getOrderBy() {
- return this.builder.orderBy;
- }
-
- static class BaseGetRequestBuilder {
- protected String table;
- protected ArrayList ids;
- protected Boolean returnTokens;
- protected ArrayList fields;
- protected String offset;
- protected String limit;
- protected Boolean downloadURL;
- protected String columnName;
- protected ArrayList columnValues;
- protected String orderBy;
-
- protected BaseGetRequestBuilder() {
- this.downloadURL = true;
- this.orderBy = BaseConstants.ORDER_ASCENDING;
- }
-
- public BaseGetRequestBuilder table(String table) {
- this.table = table;
- return this;
- }
-
- public BaseGetRequestBuilder ids(ArrayList ids) {
- this.ids = ids;
- return this;
- }
-
- public BaseGetRequestBuilder returnTokens(Boolean returnTokens) {
- this.returnTokens = returnTokens;
- return this;
- }
-
- public BaseGetRequestBuilder fields(ArrayList fields) {
- this.fields = fields;
- return this;
- }
-
- public BaseGetRequestBuilder offset(String offset) {
- this.offset = offset;
- return this;
- }
-
- public BaseGetRequestBuilder limit(String limit) {
- this.limit = limit;
- return this;
- }
-
- public BaseGetRequestBuilder downloadURL(Boolean downloadURL) {
- this.downloadURL = downloadURL == null || downloadURL;
- return this;
- }
-
- public BaseGetRequestBuilder columnName(String columnName) {
- this.columnName = columnName;
- return this;
- }
-
- public BaseGetRequestBuilder columnValues(ArrayList columnValues) {
- this.columnValues = columnValues;
- return this;
- }
-
- public BaseGetRequestBuilder orderBy(String orderBy) {
- this.orderBy = orderBy == null ? BaseConstants.ORDER_ASCENDING : orderBy;
- return this;
- }
-
- }
-}
diff --git a/common/src/main/java/com/skyflow/vault/data/BaseGetResponse.java b/common/src/main/java/com/skyflow/vault/data/BaseGetResponse.java
deleted file mode 100644
index 7a985fe6..00000000
--- a/common/src/main/java/com/skyflow/vault/data/BaseGetResponse.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.skyflow.vault.data;
-
-import com.google.gson.Gson;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-public class BaseGetResponse {
- private final ArrayList> data;
- private final ArrayList> errors;
-
- public BaseGetResponse(ArrayList> data, ArrayList> errors) {
- this.data = data;
- this.errors = errors;
- }
-
- public ArrayList> getData() {
- return data;
- }
-
- public ArrayList> getErrors() {
- return errors;
- }
-
- @Override
- public String toString() {
- Gson gson = new Gson();
- return gson.toJson(this);
- }
-}
diff --git a/common/src/main/java/com/skyflow/vault/data/BaseInsertRequest.java b/common/src/main/java/com/skyflow/vault/data/BaseInsertRequest.java
index 64e61153..b856492d 100644
--- a/common/src/main/java/com/skyflow/vault/data/BaseInsertRequest.java
+++ b/common/src/main/java/com/skyflow/vault/data/BaseInsertRequest.java
@@ -18,27 +18,12 @@ public ArrayList> getValues() {
return this.builder.values;
}
- public ArrayList> getTokens() {
- return this.builder.tokens;
- }
-
- public Boolean getReturnTokens() {
- return this.builder.returnTokens;
- }
-
- public String getUpsert() {
- return this.builder.upsert;
- }
-
static class BaseInsertRequestBuilder {
protected String table;
protected ArrayList> values;
- protected ArrayList> tokens;
- protected Boolean returnTokens;
protected String upsert;
protected BaseInsertRequestBuilder() {
- this.returnTokens = false;
}
public BaseInsertRequestBuilder table(String table) {
@@ -51,20 +36,6 @@ public BaseInsertRequestBuilder values(ArrayList> values
return this;
}
- public BaseInsertRequestBuilder tokens(ArrayList> tokens) {
- this.tokens = tokens;
- return this;
- }
-
- public BaseInsertRequestBuilder returnTokens(Boolean returnTokens) {
- this.returnTokens = returnTokens != null && returnTokens;
- return this;
- }
-
- public BaseInsertRequestBuilder upsert(String upsert) {
- this.upsert = upsert;
- return this;
- }
}
}
diff --git a/common/src/main/java/com/skyflow/vault/data/BaseInsertResponse.java b/common/src/main/java/com/skyflow/vault/data/BaseInsertResponse.java
deleted file mode 100644
index b3eead69..00000000
--- a/common/src/main/java/com/skyflow/vault/data/BaseInsertResponse.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.skyflow.vault.data;
-
-import com.google.gson.Gson;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-public class BaseInsertResponse {
- private final ArrayList> insertedFields;
- private final ArrayList> errors;
-
- public BaseInsertResponse(ArrayList> insertedFields, ArrayList> errors) {
- this.insertedFields = insertedFields;
- this.errors = errors;
- }
-
- public ArrayList> getInsertedFields() {
- return insertedFields;
- }
-
- public ArrayList> getErrors() {
- return errors;
- }
-
- @Override
- public String toString() {
- Gson gson = new Gson();
- return gson.toJson(this);
- }
-}
diff --git a/common/src/test/java/com/skyflow/config/CredentialsTests.java b/common/test/java/com/skyflow/config/CredentialsTests.java
similarity index 100%
rename from common/src/test/java/com/skyflow/config/CredentialsTests.java
rename to common/test/java/com/skyflow/config/CredentialsTests.java
diff --git a/common/src/test/java/com/skyflow/config/VaultConfigTests.java b/common/test/java/com/skyflow/config/VaultConfigTests.java
similarity index 100%
rename from common/src/test/java/com/skyflow/config/VaultConfigTests.java
rename to common/test/java/com/skyflow/config/VaultConfigTests.java
diff --git a/common/src/test/java/com/skyflow/errors/SkyflowExceptionTest.java b/common/test/java/com/skyflow/errors/SkyflowExceptionTest.java
similarity index 100%
rename from common/src/test/java/com/skyflow/errors/SkyflowExceptionTest.java
rename to common/test/java/com/skyflow/errors/SkyflowExceptionTest.java
diff --git a/common/src/test/java/com/skyflow/serviceaccount/util/BearerTokenTests.java b/common/test/java/com/skyflow/serviceaccount/util/BearerTokenTests.java
similarity index 94%
rename from common/src/test/java/com/skyflow/serviceaccount/util/BearerTokenTests.java
rename to common/test/java/com/skyflow/serviceaccount/util/BearerTokenTests.java
index 3e8a7696..cf5bbcd5 100644
--- a/common/src/test/java/com/skyflow/serviceaccount/util/BearerTokenTests.java
+++ b/common/test/java/com/skyflow/serviceaccount/util/BearerTokenTests.java
@@ -25,7 +25,7 @@ public class BearerTokenTests {
@BeforeClass
public static void setup() {
credentialsFilePath = "./credentials.json";
- invalidJsonFilePath = "./src/test/resources/notJson.txt";
+ invalidJsonFilePath = "./test/resources/notJson.txt";
invalidFilePath = "./src/test/credentials.json";
credentialsString = "{\"key\":\"value\"}";
context = "test_context";
@@ -128,7 +128,7 @@ public void testInvalidCredentialsString() {
@Test
public void testNoPrivateKeyInCredentialsForCredentials() {
- String filePath = "./src/test/resources/noPrivateKeyCredentials.json";
+ String filePath = "./test/resources/noPrivateKeyCredentials.json";
File file = new File(filePath);
try {
BearerToken bearerToken = BearerToken.builder().setCredentials(file).build();
@@ -142,7 +142,7 @@ public void testNoPrivateKeyInCredentialsForCredentials() {
@Test
public void testNoClientIDInCredentialsForCredentials() {
- String filePath = "./src/test/resources/noClientIDCredentials.json";
+ String filePath = "./test/resources/noClientIDCredentials.json";
File file = new File(filePath);
try {
BearerToken bearerToken = BearerToken.builder().setCredentials(file).build();
@@ -156,7 +156,7 @@ public void testNoClientIDInCredentialsForCredentials() {
@Test
public void testNoKeyIDInCredentialsForCredentials() {
- String filePath = "./src/test/resources/noKeyIDCredentials.json";
+ String filePath = "./test/resources/noKeyIDCredentials.json";
File file = new File(filePath);
try {
BearerToken bearerToken = BearerToken.builder().setCredentials(file).build();
@@ -170,7 +170,7 @@ public void testNoKeyIDInCredentialsForCredentials() {
@Test
public void testNoTokenURIInCredentialsForCredentials() {
- String filePath = "./src/test/resources/noTokenURICredentials.json";
+ String filePath = "./test/resources/noTokenURICredentials.json";
File file = new File(filePath);
try {
BearerToken bearerToken = BearerToken.builder().setCredentials(file).build();
@@ -184,7 +184,7 @@ public void testNoTokenURIInCredentialsForCredentials() {
@Test
public void testInvalidPrivateKeyInCredentialsForCredentials() {
- String filePath = "./src/test/resources/invalidPrivateKeyCredentials.json";
+ String filePath = "./test/resources/invalidPrivateKeyCredentials.json";
File file = new File(filePath);
try {
BearerToken bearerToken = BearerToken.builder().setCredentials(file).build();
@@ -211,7 +211,7 @@ public void testInvalidKeySpecInCredentialsForCredentials() {
@Test
public void testInvalidTokenURIInCredentialsForCredentials() throws SkyflowException {
- String filePath = "./src/test/resources/invalidTokenURICredentials.json";
+ String filePath = "./test/resources/invalidTokenURICredentials.json";
File file = new File(filePath);
try {
BearerToken bearerToken = BearerToken.builder().setCredentials(file).build();
diff --git a/common/src/test/java/com/skyflow/serviceaccount/util/SignedDataTokensTests.java b/common/test/java/com/skyflow/serviceaccount/util/SignedDataTokensTests.java
similarity index 95%
rename from common/src/test/java/com/skyflow/serviceaccount/util/SignedDataTokensTests.java
rename to common/test/java/com/skyflow/serviceaccount/util/SignedDataTokensTests.java
index bd46cc9f..dcda716e 100644
--- a/common/src/test/java/com/skyflow/serviceaccount/util/SignedDataTokensTests.java
+++ b/common/test/java/com/skyflow/serviceaccount/util/SignedDataTokensTests.java
@@ -26,7 +26,7 @@ public class SignedDataTokensTests {
@BeforeClass
public static void setup() {
credentialsFilePath = "./credentials.json";
- invalidJsonFilePath = "./src/test/resources/notJson.txt";
+ invalidJsonFilePath = "./test/resources/notJson.txt";
invalidFilePath = "./src/test/credentials.json";
credentialsString = "{\"key\":\"value\"}";
context = "test_context";
@@ -138,7 +138,7 @@ public void testInvalidCredentialsString() {
@Test
public void testNoPrivateKeyInCredentials() {
- String filePath = "./src/test/resources/noPrivateKeyCredentials.json";
+ String filePath = "./test/resources/noPrivateKeyCredentials.json";
File file = new File(filePath);
try {
SignedDataTokens signedTokens = SignedDataTokens.builder().setCredentials(file).build();
@@ -152,7 +152,7 @@ public void testNoPrivateKeyInCredentials() {
@Test
public void testNoClientIDInCredentials() {
- String filePath = "./src/test/resources/noClientIDCredentials.json";
+ String filePath = "./test/resources/noClientIDCredentials.json";
File file = new File(filePath);
try {
SignedDataTokens signedTokens = SignedDataTokens.builder().setCredentials(file).build();
@@ -166,7 +166,7 @@ public void testNoClientIDInCredentials() {
@Test
public void testNoKeyIDInCredentials() {
- String filePath = "./src/test/resources/noKeyIDCredentials.json";
+ String filePath = "./test/resources/noKeyIDCredentials.json";
File file = new File(filePath);
try {
SignedDataTokens signedTokens = SignedDataTokens.builder().setCredentials(file).build();
@@ -180,7 +180,7 @@ public void testNoKeyIDInCredentials() {
@Test
public void testInvalidPrivateKeyInCredentials() {
- String filePath = "./src/test/resources/invalidPrivateKeyCredentials.json";
+ String filePath = "./test/resources/invalidPrivateKeyCredentials.json";
File file = new File(filePath);
try {
SignedDataTokens signedTokens = SignedDataTokens.builder().setCredentials(file).build();
diff --git a/common/src/test/java/com/skyflow/serviceaccount/util/TokenTests.java b/common/test/java/com/skyflow/serviceaccount/util/TokenTests.java
similarity index 100%
rename from common/src/test/java/com/skyflow/serviceaccount/util/TokenTests.java
rename to common/test/java/com/skyflow/serviceaccount/util/TokenTests.java
diff --git a/common/src/test/java/com/skyflow/utils/BaseUtilsTests.java b/common/test/java/com/skyflow/utils/BaseUtilsTests.java
similarity index 100%
rename from common/src/test/java/com/skyflow/utils/BaseUtilsTests.java
rename to common/test/java/com/skyflow/utils/BaseUtilsTests.java
diff --git a/common/src/test/resources/invalidPrivateKeyCredentials.json b/common/test/resources/invalidPrivateKeyCredentials.json
similarity index 100%
rename from common/src/test/resources/invalidPrivateKeyCredentials.json
rename to common/test/resources/invalidPrivateKeyCredentials.json
diff --git a/common/src/test/resources/invalidTokenURICredentials.json b/common/test/resources/invalidTokenURICredentials.json
similarity index 100%
rename from common/src/test/resources/invalidTokenURICredentials.json
rename to common/test/resources/invalidTokenURICredentials.json
diff --git a/common/src/test/resources/noClientIDCredentials.json b/common/test/resources/noClientIDCredentials.json
similarity index 100%
rename from common/src/test/resources/noClientIDCredentials.json
rename to common/test/resources/noClientIDCredentials.json
diff --git a/common/src/test/resources/noKeyIDCredentials.json b/common/test/resources/noKeyIDCredentials.json
similarity index 100%
rename from common/src/test/resources/noKeyIDCredentials.json
rename to common/test/resources/noKeyIDCredentials.json
diff --git a/common/src/test/resources/noPrivateKeyCredentials.json b/common/test/resources/noPrivateKeyCredentials.json
similarity index 100%
rename from common/src/test/resources/noPrivateKeyCredentials.json
rename to common/test/resources/noPrivateKeyCredentials.json
diff --git a/common/src/test/resources/noTokenURICredentials.json b/common/test/resources/noTokenURICredentials.json
similarity index 100%
rename from common/src/test/resources/noTokenURICredentials.json
rename to common/test/resources/noTokenURICredentials.json
diff --git a/common/src/test/resources/notJson.txt b/common/test/resources/notJson.txt
similarity index 100%
rename from common/src/test/resources/notJson.txt
rename to common/test/resources/notJson.txt
diff --git a/pom.xml b/pom.xml
index f36b6778..e94e5f2e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
4.0.0
com.skyflow
- skyflow-java
+ skyflow
1.0.0
pom
@@ -37,6 +37,7 @@
+ true
8
8
4.12.0
@@ -169,7 +170,8 @@
3.2.0
- com.skyflow.generated.rest.*
+ com.skyflow.generated.rest.*:
+ com.skyflow.generated.auth.*:
@@ -178,6 +180,7 @@
jar
+
@@ -256,50 +259,4 @@
https://repo.maven.apache.org/maven2/
-
-
-
- maven-central
-
-
- central
- https://central.sonatype.com/api/v1/publisher/upload
-
-
- central-snapshots
- https://central.sonatype.com/api/v1/publisher/upload
-
-
-
-
-
- org.sonatype.central
- central-publishing-maven-plugin
- 0.4.0
- true
-
- central
- true
- true
-
-
-
-
-
-
- jfrog
-
-
- central
- prekarilabs.jfrog.io-releases
- https://prekarilabs.jfrog.io/artifactory/skyflow-java
-
-
- snapshots
- prekarilabs.jfrog.io-snapshots
- https://prekarilabs.jfrog.io/artifactory/skyflow-java
-
-
-
-
-
+
\ No newline at end of file
diff --git a/samples/pom.xml b/samples/pom.xml
index c48ba302..96f921ee 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -18,7 +18,7 @@
com.skyflow
skyflow-java
- 1.15.0
+ 3.0.0-beta.3
diff --git a/samples/src/main/java/com/example/connection/InvokeConnectionExample.java b/samples/src/main/java/com/example/connection/InvokeConnectionExample.java
deleted file mode 100644
index b2e80924..00000000
--- a/samples/src/main/java/com/example/connection/InvokeConnectionExample.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package com.example.connection;
-
-import com.skyflow.Skyflow;
-import com.skyflow.config.ConnectionConfig;
-import com.skyflow.config.Credentials;
-import com.skyflow.enums.LogLevel;
-import com.skyflow.enums.RequestMethod;
-import com.skyflow.errors.SkyflowException;
-import com.skyflow.vault.connection.InvokeConnectionRequest;
-import com.skyflow.vault.connection.InvokeConnectionResponse;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * This example demonstrates how to use the Skyflow SDK to invoke API connections.
- * It includes:
- * 1. Setting up credentials and connection configurations.
- * 2. Creating a Skyflow client with multiple connections.
- * 3. Sending a POST request with request body and headers.
- * 4. Sending a GET request with path and query parameters.
- */
-public class InvokeConnectionExample {
- public static void main(String[] args) throws SkyflowException {
- // Step 1: Set up credentials for API authentication
- Credentials credentials = new Credentials();
- credentials.setApiKey(""); // Replace with the actual API key
-
- // Step 2: Configure the first connection
- ConnectionConfig primaryConnectionConfig = new ConnectionConfig();
- primaryConnectionConfig.setConnectionId(""); // Replace with first connection ID
- primaryConnectionConfig.setConnectionUrl(""); // Replace with first connection URL
- primaryConnectionConfig.setCredentials(credentials); // Assign credentials
-
- // Step 3: Configure the second connection
- ConnectionConfig secondaryConnectionConfig = new ConnectionConfig();
- secondaryConnectionConfig.setConnectionId(""); // Replace with second connection ID
- secondaryConnectionConfig.setConnectionUrl(""); // Replace with second connection URL
-
- // Step 4: Set up credentials for the Skyflow client
- Credentials skyflowCredentials = new Credentials();
- skyflowCredentials.setCredentialsString(""); // Replace with the credentials string
-
- // Step 5: Create a Skyflow client with connection configurations
- Skyflow skyflowClient = Skyflow.builder()
- .setLogLevel(LogLevel.ERROR) // Set log level to ERROR
- .addConnectionConfig(primaryConnectionConfig) // Add the first connection
- .addConnectionConfig(secondaryConnectionConfig) // Add the second connection
- .addSkyflowCredentials(skyflowCredentials) // Provide Skyflow credentials
- .build();
-
- // Example 1: Sending a POST request to the first connection
- try {
- // Set up request body and headers
- Map requestBody = new HashMap<>();
- requestBody.put("", ""); // Replace with actual column name and value
- requestBody.put("", ""); // Replace with another column name and value
-
- Map requestHeaders = new HashMap<>();
- requestHeaders.put("", ""); // Replace with actual header name and value
- requestHeaders.put("", ""); // Replace with another header name and value
-
- // Build and send the POST request
- InvokeConnectionRequest invokeConnectionRequest1 = InvokeConnectionRequest.builder()
- .method(RequestMethod.POST) // HTTP method set to POST
- .requestBody(requestBody) // Include request body
- .requestHeaders(requestHeaders) // Include request headers
- .build();
-
- InvokeConnectionResponse invokeConnectionResponse1 = skyflowClient.connection().invoke(invokeConnectionRequest1);
- System.out.println("Invoke Connection Response (POST): " + invokeConnectionResponse1);
- } catch (SkyflowException e) {
- System.out.println("Error while invoking connection (POST):" + e);
- }
-
- // Example 2: Sending a GET request to the second connection
- try {
- // Set up path and query parameters
- Map pathParams = new HashMap<>();
- pathParams.put("", ""); // Replace with actual path parameter
- pathParams.put("", ""); // Replace with another path parameter
-
- Map queryParams = new HashMap<>();
- queryParams.put("", ""); // Replace with actual query parameter
- queryParams.put("", ""); // Replace with another query parameter
-
- // Build and send the GET request
- InvokeConnectionRequest invokeConnectionRequest2 = InvokeConnectionRequest.builder()
- .method(RequestMethod.GET) // HTTP method set to GET
- .pathParams(pathParams) // Include path parameters
- .queryParams(queryParams) // Include query parameters
- .build();
-
- InvokeConnectionResponse invokeConnectionResponse2 = skyflowClient
- .connection("").invoke(invokeConnectionRequest2);
- System.out.println("Invoke Connection Response (GET): " + invokeConnectionResponse2);
- } catch (SkyflowException e) {
- System.out.println("Error while invoking connection (GET):" + e);
- }
- }
-}
diff --git a/samples/src/main/java/com/example/detect/DeidentifyFileExample.java b/samples/src/main/java/com/example/detect/DeidentifyFileExample.java
deleted file mode 100644
index 7f573d33..00000000
--- a/samples/src/main/java/com/example/detect/DeidentifyFileExample.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package com.example.detect;
-
-import java.io.File;
-
-import com.skyflow.Skyflow;
-import com.skyflow.config.Credentials;
-import com.skyflow.config.VaultConfig;
-import com.skyflow.enums.Env;
-import com.skyflow.enums.LogLevel;
-import com.skyflow.enums.MaskingMethod;
-import com.skyflow.errors.SkyflowException;
-import com.skyflow.vault.detect.DeidentifyFileRequest;
-import com.skyflow.vault.detect.DeidentifyFileResponse;
-import com.skyflow.vault.detect.FileInput;
-
-/**
- * Skyflow Deidentify File Example
- *
- * This example demonstrates how to use the Skyflow SDK to deidentify file
- * It has all available options for deidentifying files.
- * Supported file types: images (jpg, png, etc.), pdf, audio (mp3, wav), documents, spreadsheets, presentations, structured text.
- * It includes:
- * 1. Configure credentials
- * 2. Set up vault configuration
- * 3. Create a deidentify file request with all options
- * 4. Call deidentifyFile to deidentify file.
- * 5. Handle response and errors
- */
-public class DeidentifyFileExample {
-
- public static void main(String[] args) throws SkyflowException {
- // Step 1: Set up credentials for the first vault configuration
- Credentials credentials = new Credentials();
- credentials.setPath(""); // Replace with the path to the credentials file
-
- // Step 2: Configure the vault config
- VaultConfig vaultConfig = new VaultConfig();
- vaultConfig.setVaultId(""); // Replace with the ID of the vault
- vaultConfig.setClusterId(""); // Replace with the cluster ID of the vault
- vaultConfig.setEnv(Env.PROD); // Set the environment (e.g., DEV, STAGE, PROD)
- vaultConfig.setCredentials(credentials); // Associate the credentials with the vault
-
- // Step 3: Create a Skyflow client
- Skyflow skyflowClient = Skyflow.builder()
- .setLogLevel(LogLevel.DEBUG) // Enable debugging for detailed logs
- .addVaultConfig(vaultConfig) // Add the vault configuration
- .build();
-
- try {
-
- // Step 4: Create a deidentify file request with all options
-
- // Create file object
- File file = new File("") // Alternatively, you can use .filePath()
- .build();
-
- // Output configuration
- String outputDirectory = ""; // Replace with the desired output directory to save the deidentified file
-
- // Entities to detect
- // List detectEntities = new ArrayList<>();
- // detectEntities.add(DetectEntities.IP_ADDRESS); // Replace with the entities you want to detect
-
- // Image-specific options
- // Boolean outputProcessedImage = true; // Include processed image in output
- // Boolean outputOcrText = true; // Include OCR text in output
- MaskingMethod maskingMethod = MaskingMethod.BLACKBOX; // Masking method for images
-
- // PDF-specific options
- // Integer pixelDensity = 15; // Pixel density for PDF processing
- // Integer maxResolution = 2000; // Max resolution for PDF
-
- // Audio-specific options
- // Boolean outputProcessedAudio = true; // Include processed audio
- // DetectOutputTranscriptions outputTanscription = DetectOutputTranscriptions.PLAINTEXT_TRANSCRIPTION; // Transcription type
-
- // Audio bleep configuration
- // AudioBleep audioBleep = AudioBleep.builder()
- // .frequency(5D) // Pitch in Hz
- // .startPadding(7D) // Padding at start (seconds)
- // .stopPadding(8D) // Padding at end (seconds)
- // .build();
-
- Integer waitTime = 20; // Max wait time for response (max 64 seconds)
-
- DeidentifyFileRequest deidentifyFileRequest = DeidentifyFileRequest.builder()
- .file(fileInput)
- .waitTime(waitTime)
- // .entities(detectEntities)
- .outputDirectory(outputDirectory)
- .maskingMethod(maskingMethod)
- // .outputProcessedImage(outputProcessedImage)
- // .outputOcrText(outputOcrText)
- // .pixelDensity(pixelDensity)
- // .maxResolution(maxResolution)
- // .outputProcessedAudio(outputProcessedAudio)
- // .outputTranscription(outputTanscription)
- // .bleep(audioBleep)
- .build();
-
-
- DeidentifyFileResponse deidentifyFileResponse = skyflowClient.detect(vaultConfig.getVaultId()).deidentifyFile(deidentifyFileRequest);
- System.out.println("Deidentify file response: " + deidentifyFileResponse.toString());
- } catch (SkyflowException e) {
- System.err.println("Error occurred during deidentify file: ");
- e.printStackTrace();
- }
- }
-}
\ No newline at end of file
diff --git a/samples/src/main/java/com/example/detect/DeidentifyTextExample.java b/samples/src/main/java/com/example/detect/DeidentifyTextExample.java
deleted file mode 100644
index 837dde00..00000000
--- a/samples/src/main/java/com/example/detect/DeidentifyTextExample.java
+++ /dev/null
@@ -1,142 +0,0 @@
-package com.example.detect;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.skyflow.Skyflow;
-import com.skyflow.config.Credentials;
-import com.skyflow.config.VaultConfig;
-import com.skyflow.enums.DetectEntities;
-import com.skyflow.enums.Env;
-import com.skyflow.enums.LogLevel;
-import com.skyflow.errors.SkyflowException;
-import com.skyflow.vault.detect.DeidentifyTextRequest;
-import com.skyflow.vault.detect.DeidentifyTextResponse;
-import com.skyflow.vault.detect.TokenFormat;
-
-/**
- * Skyflow Deidentify Text Example
- *
- * This example demonstrates how to use the Skyflow SDK to deidentify text data
- * across multiple vaults. It includes:
- * 1. Setting up credentials and vault configurations.
- * 2. Creating a Skyflow client with multiple vaults.
- * 3. Performing deidentify of text with various options.
- * 4. Handling responses and errors.
- */
-
-public class DeidentifyTextExample {
- public static void main(String[] args) throws SkyflowException {
-
- // Step 1: Set up credentials for the first vault configuration
- Credentials credentials = new Credentials();
- credentials.setPath(""); // Replace with the path to the credentials file
-
- // Step 2: Configure the first vault (Blitz)
- VaultConfig blitzConfig = new VaultConfig();
- blitzConfig.setVaultId(""); // Replace with the ID of the first vault
- blitzConfig.setClusterId(""); // Replace with the cluster ID of the first vault
- blitzConfig.setEnv(Env.DEV); // Set the environment (e.g., DEV, STAGE, PROD)
- blitzConfig.setCredentials(credentials); // Associate the credentials with the vault
-
- // Step 3: Configure the second vault (Stage)
- VaultConfig stageConfig = new VaultConfig();
- stageConfig.setVaultId("