Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/beta-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
uses: ./.github/workflows/shared-build-and-deploy.yml
with:
ref: ${{ github.ref_name }}
server-id: ossrh
server-id: central
profile: maven-central
tag: 'beta'
secrets:
server-username: ${{ secrets.OSSRH_USERNAME }}
server-password: ${{ secrets.OSSRH_PASSWORD }}
server-username: ${{ secrets.CENTRAL_PUBLISHER_PORTAL_USERNAME }}
server-password: ${{ secrets.CENTRAL_PUBLISHER_PORTAL_PASSWORD }}
gpg-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
skyflow-credentials: ${{ secrets.SKYFLOW_CREDENTIALS }} >> .env
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
uses: ./.github/workflows/shared-build-and-deploy.yml
with:
ref: ${{ github.ref_name }}
server-id: ossrh
server-id: central
profile: maven-central
tag: 'public'
secrets:
server-username: ${{ secrets.OSSRH_USERNAME }}
server-password: ${{ secrets.OSSRH_PASSWORD }}
server-username: ${{ secrets.CENTRAL_PUBLISHER_PORTAL_USERNAME }}
server-password: ${{ secrets.CENTRAL_PUBLISHER_PORTAL_PASSWORD }}
gpg-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
skyflow-credentials: ${{ secrets.SKYFLOW_CREDENTIALS }} >> .env
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/shared-build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ jobs:
fetch-depth: 0

- name: Set up maven or jfrog repository
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: "1.8"
java-version: "11"
distribution: "adopt"
server-id: ${{ inputs.server-id }}
server-username: SERVER_USERNAME
Expand Down
46 changes: 21 additions & 25 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.skyflow</groupId>
<artifactId>skyflow-java</artifactId>
<version>2.0.0-beta.2</version>
<version>2.0.0-beta.3</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down Expand Up @@ -45,12 +45,6 @@
</properties>

<dependencies>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.12.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
Expand Down Expand Up @@ -126,9 +120,10 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit-version}</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
Expand All @@ -141,12 +136,6 @@
<version>2.0.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.13.2</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -185,7 +174,14 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<version>3.2.5</version>
<configuration>
<useModulePath>false</useModulePath>
<includes>
<include>**/*Test.java</include>
<include>**/*Tests.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
Expand Down Expand Up @@ -263,25 +259,25 @@
<id>maven-central</id>
<distributionManagement>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url>
<id>central</id>
<url>https://central.sonatype.com/api/v1/publisher/upload</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
<id>central-snapshots</id>
<url>https://central.sonatype.com/api/v1/publisher/upload</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.4.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<publishingServerId>central</publishingServerId>
<tokenAuth>true</tokenAuth>
<autoPublish>true</autoPublish>
</configuration>
</plugin>
</plugins>
Expand Down
14 changes: 2 additions & 12 deletions src/main/java/com/skyflow/VaultClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,6 @@ protected DeidentifyPdfRequest getDeidentifyPdfRequest(DeidentifyFileRequest req
Optional<List<EntityType>> entityUniqueCounter = Optional.empty();
Optional<List<String>> allowRegex = Optional.ofNullable(request.getAllowRegexList());
Optional<List<String>> restrictRegex = Optional.ofNullable(request.getRestrictRegexList());
Optional<Transformations> transformations = Optional.ofNullable(getTransformations(request.getTransformations()));

if (tokenFormat != null) {
if (tokenFormat.getEntityOnly() != null && !tokenFormat.getEntityOnly().isEmpty()) {
Expand Down Expand Up @@ -540,13 +539,12 @@ protected DeidentifyPdfRequest getDeidentifyPdfRequest(DeidentifyFileRequest req
return DeidentifyPdfRequest.builder()
.vaultId(vaultId)
.file(file)
.density(request.getPixelDensity() != null ? request.getPixelDensity().intValue() : null)
.maxResolution(request.getMaxResolution() != null ? request.getMaxResolution().intValue() : null)
.density(request.getPixelDensity() != null ? request.getPixelDensity().doubleValue() : null)
.maxResolution(request.getMaxResolution() != null ? request.getMaxResolution().doubleValue() : null)
.entityTypes(mappedEntityTypes)
.tokenType(tokenType)
.allowRegex(allowRegex)
.restrictRegex(restrictRegex)
.transformations(transformations)
.build();
}

Expand All @@ -558,7 +556,6 @@ protected DeidentifyImageRequest getDeidentifyImageRequest(DeidentifyFileRequest
Optional<List<EntityType>> entityUniqueCounter = Optional.empty();
Optional<List<String>> allowRegex = Optional.ofNullable(request.getAllowRegexList());
Optional<List<String>> restrictRegex = Optional.ofNullable(request.getRestrictRegexList());
Optional<Transformations> transformations = Optional.ofNullable(getTransformations(request.getTransformations()));

TokenTypeWithoutVault tokenType = buildTokenType(tokenFormat, entityTypes, entityUniqueCounter);

Expand All @@ -580,7 +577,6 @@ protected DeidentifyImageRequest getDeidentifyImageRequest(DeidentifyFileRequest
.tokenType(tokenType)
.allowRegex(allowRegex)
.restrictRegex(restrictRegex)
.transformations(transformations)
.outputProcessedImage(request.getOutputProcessedImage())
.outputOcrText(request.getOutputOcrText())
.build();
Expand All @@ -594,7 +590,6 @@ protected DeidentifyPresentationRequest getDeidentifyPresentationRequest(Deident
Optional<List<EntityType>> entityUniqueCounter = Optional.empty();
Optional<List<String>> allowRegex = Optional.ofNullable(request.getAllowRegexList());
Optional<List<String>> restrictRegex = Optional.ofNullable(request.getRestrictRegexList());
Optional<Transformations> transformations = Optional.ofNullable(getTransformations(request.getTransformations()));

TokenTypeWithoutVault tokenType = buildTokenType(tokenFormat, entityTypes, entityUniqueCounter);

Expand All @@ -610,7 +605,6 @@ protected DeidentifyPresentationRequest getDeidentifyPresentationRequest(Deident
.tokenType(tokenType)
.allowRegex(allowRegex)
.restrictRegex(restrictRegex)
.transformations(transformations)
.build();
}

Expand All @@ -622,7 +616,6 @@ protected DeidentifySpreadsheetRequest getDeidentifySpreadsheetRequest(Deidentif
Optional<List<EntityType>> entityUniqueCounter = Optional.empty();
Optional<List<String>> allowRegex = Optional.ofNullable(request.getAllowRegexList());
Optional<List<String>> restrictRegex = Optional.ofNullable(request.getRestrictRegexList());
Optional<Transformations> transformations = Optional.ofNullable(getTransformations(request.getTransformations()));

TokenTypeWithoutVault tokenType = buildTokenType(tokenFormat, entityTypes, entityUniqueCounter);

Expand All @@ -638,7 +631,6 @@ protected DeidentifySpreadsheetRequest getDeidentifySpreadsheetRequest(Deidentif
.tokenType(tokenType)
.allowRegex(allowRegex)
.restrictRegex(restrictRegex)
.transformations(transformations)
.build();
}

Expand Down Expand Up @@ -678,7 +670,6 @@ protected DeidentifyDocumentRequest getDeidentifyDocumentRequest(DeidentifyFileR
Optional<List<EntityType>> entityUniqueCounter = Optional.empty();
Optional<List<String>> allowRegex = Optional.ofNullable(request.getAllowRegexList());
Optional<List<String>> restrictRegex = Optional.ofNullable(request.getRestrictRegexList());
Optional<Transformations> transformations = Optional.ofNullable(getTransformations(request.getTransformations()));

TokenTypeWithoutVault tokenType = buildTokenType(tokenFormat, entityTypes, entityUniqueCounter);

Expand All @@ -694,7 +685,6 @@ protected DeidentifyDocumentRequest getDeidentifyDocumentRequest(DeidentifyFileR
.tokenType(tokenType)
.allowRegex(allowRegex)
.restrictRegex(restrictRegex)
.transformations(transformations)
.build();
}

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/skyflow/enums/DeidentifyFileStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

public enum DeidentifyFileStatus {
IN_PROGRESS("IN_PROGRESS"),
SUCCESS("SUCCESS");
FAILED("FAILED"),
SUCCESS("SUCCESS"),
UNKNOWN("UNKNOWN");

private final String value;

Expand Down
9 changes: 8 additions & 1 deletion src/main/java/com/skyflow/enums/DetectEntities.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ public enum DetectEntities {
CREDIT_CARD_EXPIRATION("credit_card_expiration"),
CVV("cvv"),
DATE("date"),
DAY("day"),
DATE_INTERVAL("date_interval"),
DOB("dob"),
DOSE("dose"),
DRIVER_LICENSE("driver_license"),
DRUG("drug"),
DURATION("duration"),
EFFECT("effect"),
EMAIL_ADDRESS("email_address"),
EVENT("event"),
FILENAME("filename"),
FINANCIAL_METRIC("financial_metric"),
GENDER_SEXUALITY("gender_sexuality"),
GENDER("gender"),
HEALTHCARE_NUMBER("healthcare_number"),
INJURY("injury"),
IP_ADDRESS("ip_address"),
Expand All @@ -40,30 +42,35 @@ public enum DetectEntities {
MEDICAL_CODE("medical_code"),
MEDICAL_PROCESS("medical_process"),
MONEY("money"),
MONTH("month"),
NAME("name"),
NAME_FAMILY("name_family"),
NAME_GIVEN("name_given"),
NAME_MEDICAL_PROFESSIONAL("name_medical_professional"),
NUMERICAL_PII("numerical_pii"),
OCCUPATION("occupation"),
ORGANIZATION("organization"),
ORGANIZATION_ID("organization_id"),
ORGANIZATION_MEDICAL_FACILITY("organization_medical_facility"),
ORIGIN("origin"),
PASSPORT_NUMBER("passport_number"),
PASSWORD("password"),
PHONE_NUMBER("phone_number"),
PROJECT("project"),
PHYSICAL_ATTRIBUTE("physical_attribute"),
POLITICAL_AFFILIATION("political_affiliation"),
PRODUCT("product"),
RELIGION("religion"),
ROUTING_NUMBER("routing_number"),
SEXUALITY("sexuality"),
SSN("ssn"),
STATISTICS("statistics"),
TIME("time"),
TREND("trend"),
URL("url"),
USERNAME("username"),
VEHICLE_ID("vehicle_id"),
YEAR("year"),
ZODIAC_SIGN("zodiac_sign");

private final String detectEntities;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/skyflow/errors/ErrorMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public enum ErrorMessage {
FailedToEncodeFile("%s0 Validation error. Failed to encode the file. Ensure the file is in a supported format and try again."),
FailedToDecodeFileFromResponse("%s0 Failed to decode the file from the response. Ensure the response is valid and try again."),
EmptyFileAndFilePathInDeIdentifyFile("%s0 Validation error. Both file and filePath are empty. Specify either file object or filePath, not both."),
VaultTokenFormatIsNotAllowedForFiles("%s0 Validation error. Vault token format is not allowed for deidentify file request."),
PollingForResultsFailed("%s0 API error. Polling for results failed. Unable to retrieve the deidentified file"),
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."),
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/skyflow/generated/rest/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import com.skyflow.generated.rest.resources.audit.AuditClient;
import com.skyflow.generated.rest.resources.authentication.AuthenticationClient;
import com.skyflow.generated.rest.resources.binlookup.BinLookupClient;
import com.skyflow.generated.rest.resources.deprecated.DeprecatedClient;
import com.skyflow.generated.rest.resources.files.FilesClient;
import com.skyflow.generated.rest.resources.guardrails.GuardrailsClient;
import com.skyflow.generated.rest.resources.query.QueryClient;
import com.skyflow.generated.rest.resources.records.RecordsClient;
import com.skyflow.generated.rest.resources.strings.StringsClient;
Expand All @@ -31,7 +31,7 @@ public class ApiClient {

protected final Supplier<AuthenticationClient> authenticationClient;

protected final Supplier<DeprecatedClient> deprecatedClient;
protected final Supplier<GuardrailsClient> guardrailsClient;

protected final Supplier<StringsClient> stringsClient;

Expand All @@ -45,7 +45,7 @@ public ApiClient(ClientOptions clientOptions) {
this.tokensClient = Suppliers.memoize(() -> new TokensClient(clientOptions));
this.queryClient = Suppliers.memoize(() -> new QueryClient(clientOptions));
this.authenticationClient = Suppliers.memoize(() -> new AuthenticationClient(clientOptions));
this.deprecatedClient = Suppliers.memoize(() -> new DeprecatedClient(clientOptions));
this.guardrailsClient = Suppliers.memoize(() -> new GuardrailsClient(clientOptions));
this.stringsClient = Suppliers.memoize(() -> new StringsClient(clientOptions));
this.filesClient = Suppliers.memoize(() -> new FilesClient(clientOptions));
}
Expand Down Expand Up @@ -74,8 +74,8 @@ public AuthenticationClient authentication() {
return this.authenticationClient.get();
}

public DeprecatedClient deprecated() {
return this.deprecatedClient.get();
public GuardrailsClient guardrails() {
return this.guardrailsClient.get();
}

public StringsClient strings() {
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/skyflow/generated/rest/AsyncApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import com.skyflow.generated.rest.resources.audit.AsyncAuditClient;
import com.skyflow.generated.rest.resources.authentication.AsyncAuthenticationClient;
import com.skyflow.generated.rest.resources.binlookup.AsyncBinLookupClient;
import com.skyflow.generated.rest.resources.deprecated.AsyncDeprecatedClient;
import com.skyflow.generated.rest.resources.files.AsyncFilesClient;
import com.skyflow.generated.rest.resources.guardrails.AsyncGuardrailsClient;
import com.skyflow.generated.rest.resources.query.AsyncQueryClient;
import com.skyflow.generated.rest.resources.records.AsyncRecordsClient;
import com.skyflow.generated.rest.resources.strings.AsyncStringsClient;
Expand All @@ -31,7 +31,7 @@ public class AsyncApiClient {

protected final Supplier<AsyncAuthenticationClient> authenticationClient;

protected final Supplier<AsyncDeprecatedClient> deprecatedClient;
protected final Supplier<AsyncGuardrailsClient> guardrailsClient;

protected final Supplier<AsyncStringsClient> stringsClient;

Expand All @@ -45,7 +45,7 @@ public AsyncApiClient(ClientOptions clientOptions) {
this.tokensClient = Suppliers.memoize(() -> new AsyncTokensClient(clientOptions));
this.queryClient = Suppliers.memoize(() -> new AsyncQueryClient(clientOptions));
this.authenticationClient = Suppliers.memoize(() -> new AsyncAuthenticationClient(clientOptions));
this.deprecatedClient = Suppliers.memoize(() -> new AsyncDeprecatedClient(clientOptions));
this.guardrailsClient = Suppliers.memoize(() -> new AsyncGuardrailsClient(clientOptions));
this.stringsClient = Suppliers.memoize(() -> new AsyncStringsClient(clientOptions));
this.filesClient = Suppliers.memoize(() -> new AsyncFilesClient(clientOptions));
}
Expand Down Expand Up @@ -74,8 +74,8 @@ public AsyncAuthenticationClient authentication() {
return this.authenticationClient.get();
}

public AsyncDeprecatedClient deprecated() {
return this.deprecatedClient.get();
public AsyncGuardrailsClient guardrails() {
return this.guardrailsClient.get();
}

public AsyncStringsClient strings() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public Map<String, List<String>> headers() {
return this.headers;
}

@java.lang.Override
@Override
public String toString() {
return "ApiClientApiException{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " + body
+ "}";
Expand Down
Loading
Loading