Skip to content

Commit 848e6ad

Browse files
Merge pull request #429 from skyflowapi/flowvault-release/26.9.1
SK-3113 Flowvault release/26.9.1
2 parents d0dea2f + 0f8263c commit 848e6ad

47 files changed

Lines changed: 4330 additions & 246 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎common/src/main/java/com/skyflow/errors/ErrorMessage.java‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,21 +90,25 @@ public enum ErrorMessage {
9090
InsufficientTokensPassedForTokenModeEnableStrict("%s0 Validation error. 'tokenMode' is set to 'ENABLE_STRICT', but some fields are missing tokens. Specify tokens for all fields."),
9191
BatchInsertPartialSuccess("%s0 Insert operation completed with partial success."),
9292
BatchInsertFailure("%s0 Insert operation failed."),
93-
RecordSizeExceedError("%s0 Maximum number of records exceeded. The limit is 10000."),
93+
RecordSizeExceedError("%s0 Maximum number of records exceeded. The limit is 100000."),
9494

9595
// Detokenize
9696
InvalidDetokenizeData("%s0 Validation error. Invalid detokenize data. Specify valid detokenize data."),
9797
EmptyDetokenizeData("%s0 Validation error. Invalid data tokens. Specify at least one data token."),
9898
EmptyTokenInDetokenizeData("%s0 Validation error. Invalid data tokens. Specify a valid data token."),
99-
TokensSizeExceedError("%s0 Maximum number of tokens exceeded. The limit is 10000."),
99+
TokensSizeExceedError("%s0 Maximum number of tokens exceeded. The limit is 100000."),
100+
101+
// Delete
102+
DeleteRequestNull("%s0 Validation error. DeleteRequest object is null. Specify a valid DeleteRequest object."),
100103

101104
// Delete Tokens
102105
DeleteTokensRequestNull("%s0 Validation error. DeleteTokensRequest object is null. Specify a valid DeleteTokensRequest object."),
103106
EmptyDeleteTokensData("%s0 Validation error. Tokens list is empty. Specify at least one token to delete."),
104107
EmptyTokenInDeleteTokensData("%s0 Validation error. Invalid token in delete tokens request. Specify a valid token."),
105-
DeleteTokensSizeExceedError("%s0 Maximum number of tokens exceeded. The limit is 10000."),
108+
DeleteTokensSizeExceedError("%s0 Maximum number of tokens exceeded. The limit is 100000."),
106109

107110
// Get
111+
GetRequestNull("%s0 Validation error. GetRequest object is null. Specify a valid GetRequest object."),
108112
IdsKeyError("%s0 Validation error. 'ids' key is missing from the payload. Specify an 'ids' key."),
109113
EmptyIds("%s0 Validation error. 'ids' can't be empty. Specify at least one id."),
110114
EmptyIdInIds("%s0 Validation error. Invalid id in 'ids'. Specify a valid id."),
@@ -141,8 +145,13 @@ public enum ErrorMessage {
141145
SkyflowIdKeyError("%s0 Validation error. 'skyflow_id' is missing from the data payload. Specify a 'skyflow_id'."),
142146
InvalidSkyflowIdType("%s0 Validation error. Invalid type for 'skyflow_id' in data payload. Specify 'skyflow_id' as a string."),
143147
EmptySkyflowId("%s0 Validation error. 'skyflow_id' can't be empty. Specify a skyflow id."),
148+
UpdateRequestNull("%s0 Validation error. UpdateRequest object is null. Specify a valid UpdateRequest object."),
149+
UpdateRecordNull("%s0 Validation error. UpdateRequestRecord object in the list is null. Specify a valid UpdateRequestRecord object."),
150+
RecordSkyflowIdKeyError("%s0 Validation error. 'skyflowId' key is missing from the record. Specify a 'skyflowId' key."),
151+
EmptySkyflowIdInRecord("%s0 Validation error. 'skyflowId' can't be empty in the record. Specify a valid skyflow ID."),
144152

145153
// Query
154+
QueryRequestNull("%s0 Validation error. QueryRequest object is null. Specify a valid QueryRequest object."),
146155
QueryKeyError("%s0 Validation error. 'query' key is missing from the payload. Specify a 'query' key."),
147156
EmptyQuery("%s0 Validation error. 'query' can't be empty. Specify a query"),
148157

@@ -156,7 +165,7 @@ public enum ErrorMessage {
156165
EmptyValueInTokenizeRecord("%s0 Validation error. Value in TokenizeRecord is null or empty. Specify a valid value."),
157166
EmptyTokenGroupNamesInTokenizeRecord("%s0 Validation error. TokenGroupNames in TokenizeRecord is null or empty. Specify at least one token group name."),
158167
EmptyTokenGroupNameInTokenizeRecord("%s0 Validation error. Token group name in TokenizeRecord is null or empty. Specify a valid token group name."),
159-
TokenizeDataSizeExceedError("%s0 Maximum number of tokenize records exceeded. The limit is 10000."),
168+
TokenizeDataSizeExceedError("%s0 Maximum number of tokenize records exceeded. The limit is 100000."),
160169
MissingIndexInBulkTokenizeRecord("%s0 Validation error. Index in BulkTokenizeRequestRecord is null. Specify an index for every record."),
161170
DuplicateIndexInBulkTokenizeRecord("%s0 Validation error. Duplicate index in BulkTokenizeRequestRecord. Specify a unique index for every record."),
162171

‎common/src/main/java/com/skyflow/logs/ErrorLogs.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ public enum ErrorLogs {
6262
RECORDS_IS_REQUIRED("Invalid %s1 request. Records are required."),
6363
EMPTY_RECORDS("Invalid %s1 request. Records can not be empty."),
6464
INVALID_RECORD("Invalid %s1 request. Invalid record. Specify a valid record."),
65-
RECORD_SIZE_EXCEED("Maximum number of records exceeded. The limit is 10000."),
66-
TOKENS_SIZE_EXCEED("Maximum number of tokens exceeded. The limit is 10000."),
65+
RECORD_SIZE_EXCEED("Maximum number of records exceeded. The limit is 100000."),
66+
TOKENS_SIZE_EXCEED("Maximum number of tokens exceeded. The limit is 100000."),
6767
EMPTY_OR_NULL_VALUE_IN_VALUES("Invalid %s1 request. Value can not be null or empty in values for key \"%s2\"."),
6868
EMPTY_OR_NULL_KEY_IN_VALUES("Invalid %s1 request. Key can not be null or empty in values"),
6969
NULL_VALUE_ENTRY_IN_VALUES("Invalid %s1 request. Value entry in 'values' can not be null at index %s2."),
@@ -144,15 +144,15 @@ public enum ErrorLogs {
144144
EMPTY_VALUE_IN_TOKENIZE_RECORD("Invalid %s1 request. Value in TokenizeRecord can not be null or empty."),
145145
EMPTY_TOKEN_GROUP_NAMES_IN_TOKENIZE_RECORD("Invalid %s1 request. TokenGroupNames in TokenizeRecord can not be null or empty."),
146146
EMPTY_TOKEN_GROUP_NAME_IN_TOKENIZE_RECORD("Invalid %s1 request. Token group name in TokenizeRecord can not be null or empty at index %s2."),
147-
TOKENIZE_DATA_SIZE_EXCEED("Maximum number of tokenize records exceeded. The limit is 10000."),
147+
TOKENIZE_DATA_SIZE_EXCEED("Maximum number of tokenize records exceeded. The limit is 100000."),
148148
MISSING_INDEX_IN_BULK_TOKENIZE_RECORD("Invalid %s1 request. Index in BulkTokenizeRequestRecord can not be null at position %s2."),
149149
DUPLICATE_INDEX_IN_BULK_TOKENIZE_RECORD("Invalid %s1 request. Duplicate index %s2 in BulkTokenizeRequestRecord."),
150150
DELETE_REQUEST_NULL("Invalid %s1 request. Delete request can not be null."),
151151
DELETE_REQUEST_REJECTED("Delete request resulted in failure."),
152152
DELETE_TOKENS_REQUEST_NULL("Invalid %s1 request. DeleteTokens request can not be null."),
153153
EMPTY_DELETE_TOKENS_DATA("Invalid %s1 request. Delete tokens data can not be empty."),
154154
EMPTY_OR_NULL_TOKEN_IN_DELETE_TOKENS_DATA("Invalid %s1 request. Token can not be null or empty in delete tokens data at index %s2."),
155-
DELETE_TOKENS_SIZE_EXCEED("Maximum number of tokens exceeded. The limit is 10000."),
155+
DELETE_TOKENS_SIZE_EXCEED("Maximum number of tokens exceeded. The limit is 100000."),
156156
DELETE_TOKENS_REQUEST_REJECTED("DeleteTokens request resulted in failure."),
157157

158158
// invoke connection interface
Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,11 @@
11
package com.skyflow.vault.data;
22

3-
import java.util.ArrayList;
4-
53
public class BaseGetRequest {
6-
private final BaseGetRequestBuilder builder;
7-
84
protected BaseGetRequest(BaseGetRequestBuilder builder) {
9-
this.builder = builder;
10-
}
11-
12-
public String getTable() {
13-
return this.builder.table;
14-
}
15-
16-
public ArrayList<String> getIds() {
17-
return this.builder.ids;
18-
}
19-
20-
public ArrayList<String> getFields() {
21-
return this.builder.fields;
225
}
236

247
static class BaseGetRequestBuilder {
25-
protected String table;
26-
protected ArrayList<String> ids;
27-
protected ArrayList<String> fields;
28-
298
protected BaseGetRequestBuilder() {
309
}
31-
32-
public BaseGetRequestBuilder table(String table) {
33-
this.table = table;
34-
return this;
35-
}
36-
37-
public BaseGetRequestBuilder ids(ArrayList<String> ids) {
38-
this.ids = ids;
39-
return this;
40-
}
41-
42-
public BaseGetRequestBuilder fields(ArrayList<String> fields) {
43-
this.fields = fields;
44-
return this;
45-
}
4610
}
4711
}

‎common/src/test/java/com/skyflow/errors/SkyflowExceptionTest.java‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,22 @@ public void testNonJsonBodyFallsBackToRawBodyAsMessage() {
192192
Assert.assertEquals("plain text error response", ex.getMessage());
193193
}
194194

195+
@Test
196+
public void testJsonBodyWithGenericApiErrorEnvelopeStillWorks() {
197+
Map<String, List<String>> headers = new HashMap<>();
198+
String json = "{\"error\":{\"grpc_code\":5,\"http_code\":404,"
199+
+ "\"message\":\"Invalid request. Vault not found for vaultID: vault123. "
200+
+ "Specify a valid vaultID.\",\"http_status\":\"Not Found\",\"details\":[]}}";
201+
SkyflowException ex = new SkyflowException(404, new RuntimeException("fail"), headers, json);
202+
Assert.assertEquals("Invalid request. Vault not found for vaultID: vault123. "
203+
+ "Specify a valid vaultID.", ex.getMessage());
204+
Assert.assertEquals(Integer.valueOf(5), ex.getGrpcCode());
205+
Assert.assertEquals("Not Found", ex.getHttpStatus());
206+
Assert.assertEquals(404, ex.getHttpCode());
207+
Assert.assertNotNull(ex.getDetails());
208+
Assert.assertEquals(0, ex.getDetails().size());
209+
}
210+
195211
@Test
196212
public void testNullBodyNullCauseMessageFallsBackToErrorOccurred() {
197213
Map<String, List<String>> headers = new HashMap<>();

0 commit comments

Comments
 (0)