Skip to content

Commit eda9cdc

Browse files
committed
build: rebase with develop
2 parents 1f5ef28 + be3d02f commit eda9cdc

24 files changed

+537
-400
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
build_in_docker:
5050
services:
5151
kms:
52-
image: ghcr.io/cosmian/kms:4.9.1
52+
image: ghcr.io/cosmian/kms:4.10.0
5353
ports:
5454
- 9998:9998
5555
findex_cloud:
@@ -161,7 +161,7 @@ jobs:
161161
with:
162162
branch: develop
163163
target: wasm32-unknown-unknown
164-
kms-version: 4.9.1
164+
kms-version: 4.10.0
165165
findex-cloud-version: 0.3.1
166166
copy_fresh_build: false
167167
copy_regression_files: |
@@ -174,7 +174,7 @@ jobs:
174174
with:
175175
branch: develop
176176
target: x86_64-unknown-linux-gnu
177-
kms-version: 4.9.1
177+
kms-version: 4.10.0
178178
findex-cloud-version: 0.3.1
179179
copy_fresh_build: false
180180
copy_regression_files: |

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ repos:
3737
- id: markdownlint-fix
3838
args: [--disable=MD004, --disable=MD013, --disable=MD024, --disable=MD041]
3939

40+
- repo: https://github.com/tcort/markdown-link-check
41+
rev: v3.11.2
42+
hooks:
43+
- id: markdown-link-check
44+
args: [-q]
45+
4046
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
4147
rev: 0.2.2
4248
hooks:

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [7.0.0] - 2023-12-11
6+
7+
### Features
8+
9+
- Support of Findex v6
10+
- Use persistent instance in Findex without cloud
11+
- Overload Findex constructor to simplify instantiation
12+
- Covercrypt edit policy capability
13+
514
## [6.0.0] - 2023-06-01
615

716
### Features

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![workflow](https://github.com/Cosmian/cloudproof_java/actions/workflows/maven.yml/badge.svg)
44

5-
The Cloudproof Java library provides a Java-friendly API to [Cosmian's Cloudproof Encryption](https://docs.cosmian.com/cloudproof_encryption/use_cases_benefits/).
5+
The Cloudproof Java library provides a Java-friendly API to [Cosmian's Cloudproof Encryption](https://docs.cosmian.com/).
66

77
Cloudproof Encryption secures data repositories and applications in the cloud with advanced application-level encryption and encrypted search.
88

@@ -37,7 +37,7 @@ securely be outsourced without compromising usability.
3737

3838
## Getting started
3939

40-
Please [check the online documentation](https://docs.cosmian.com/cloudproof_encryption/use_cases_benefits/) for details on using the CloudProof APIs
40+
Please [check the online documentation](https://docs.cosmian.com/) for details on using the CloudProof APIs
4141

4242
In addition, please have a look at the following tests for implementation examples:
4343

@@ -105,6 +105,7 @@ From the version 5.0.0, `cloudproof_java` depends on [cloudproof_rust](https://g
105105
|----------|------------|---------------------|
106106
| 5.0.0 | 4.3.3 | 1.0.0 |
107107
| 6.0.0 | 4.3.3 | 2.0.1 |
108+
| 7.0.0 | 4.10.0 | 2.4.0 |
108109

109110
## Using in Java projects
110111

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ services:
1313
- PGDATA=/tmp/postgres2
1414
kms:
1515
container_name: kms
16-
image: ghcr.io/cosmian/kms:4.9.1
16+
image: ghcr.io/cosmian/kms:4.10.0
1717
ports:
1818
- 9998:9998
1919
depends_on:

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.cosmian</groupId>
77
<artifactId>cloudproof_java</artifactId>
8-
<version>6.0.0</version>
8+
<version>7.0.0</version>
99

1010
<name>cloudproof_java</name>
1111
<description>The Cloudproof Java Lib secures data repositories in the cloud with attributes-based access control encryption and encrypted search</description>

scripts/get_native_libraries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ def download_native_libraries(version: str) -> bool:
6464
if __name__ == '__main__':
6565
RET = download_native_libraries('v2.4.0')
6666
if RET is False and getenv('GITHUB_ACTIONS'):
67-
download_native_libraries('last_build/fix/ffi_unwrap_return_code')
67+
download_native_libraries('last_build/fix/rename_findex_traits')

src/main/java/com/cosmian/jna/findex/ChainTableDatabase.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ public interface ChainTableDatabase {
3838
* @param uidsAndValues a {@link Map} of {@link Uid32} to {@link ChainTableValue}
3939
* @throws CloudproofException if anything goes wrong
4040
*/
41-
public void insert(Map<Uid32, ChainTableValue> uidsAndValues)
42-
throws CloudproofException;
41+
public void insert(Map<Uid32, ChainTableValue> uidsAndValues) throws CloudproofException;
4342

4443
/**
4544
* Delete the lines indexed by the given UIDs {@link Uid32} from the Chain Table.
@@ -49,8 +48,7 @@ public void insert(Map<Uid32, ChainTableValue> uidsAndValues)
4948
* @param uids a {@link List} of {@link Uid32}
5049
* @throws CloudproofException if anything goes wrong
5150
*/
52-
public void delete(List<Uid32> uids)
53-
throws CloudproofException;
51+
public void delete(List<Uid32> uids) throws CloudproofException;
5452

5553
/**
5654
* Return the appropriate fetch callback (with input/output serialization).

src/main/java/com/cosmian/jna/findex/FilterLocations.java renamed to src/main/java/com/cosmian/jna/findex/DataFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
import java.util.List;
44

5-
import com.cosmian.jna.findex.ffi.FindexNativeWrapper.FilterLocationsCallback;
5+
import com.cosmian.jna.findex.ffi.FindexNativeWrapper.DataFilterCallback;
66
import com.cosmian.jna.findex.serde.Leb128Reader;
77
import com.cosmian.jna.findex.serde.Leb128Writer;
88
import com.cosmian.jna.findex.structs.Location;
99
import com.cosmian.utils.CloudproofException;
1010
import com.sun.jna.Pointer;
1111
import com.sun.jna.ptr.IntByReference;
1212

13-
public interface FilterLocations extends FilterLocationsCallback {
13+
public interface DataFilter extends DataFilterCallback {
1414

1515
/**
1616
* Filter the given locations.

src/main/java/com/cosmian/jna/findex/EntryTableDatabase.java

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.cosmian.jna.findex.ffi.FindexNativeWrapper.DeleteCallback;
1010
import com.cosmian.jna.findex.ffi.FindexNativeWrapper.DumpTokensCallback;
1111
import com.cosmian.jna.findex.ffi.FindexNativeWrapper.FetchCallback;
12+
import com.cosmian.jna.findex.ffi.FindexNativeWrapper.InsertCallback;
1213
import com.cosmian.jna.findex.ffi.FindexNativeWrapper.UpsertCallback;
1314
import com.cosmian.jna.findex.serde.Leb128Reader;
1415
import com.cosmian.jna.findex.serde.Tuple;
@@ -63,6 +64,17 @@ public interface EntryTableDatabase {
6364
public Map<Uid32, EntryTableValue> upsert(Map<Uid32, EntryTableValues> uidsAndValues)
6465
throws CloudproofException;
6566

67+
/**
68+
* Insert the given lines in the Chain Table.
69+
* <p>
70+
* Implementation of this method is only required to perform additions, deletions or compact operations on the
71+
* index.
72+
*
73+
* @param uidsAndValues a {@link Map} of {@link Uid32} to {@link EntryTableValue}
74+
* @throws CloudproofException if anything goes wrong
75+
*/
76+
public void insert(Map<Uid32, EntryTableValue> uidsAndValues) throws CloudproofException;
77+
6678
/**
6779
* Delete the lines with the given UIDs.
6880
*
@@ -156,6 +168,40 @@ public int callback(Pointer outputs,
156168
};
157169
}
158170

171+
/**
172+
* Return the appropriate insert callback (with input/output serialization).
173+
*/
174+
default InsertCallback insertCallback() {
175+
return new InsertCallback() {
176+
@Override
177+
public int callback(Pointer items,
178+
int itemsLength) {
179+
try {
180+
//
181+
// Read `items` until `itemsLength`
182+
//
183+
byte[] itemsBytes = new byte[itemsLength];
184+
items.read(0, itemsBytes, 0, itemsLength);
185+
186+
//
187+
// Deserialize the chain table items
188+
//
189+
Map<Uid32, EntryTableValue> uidsAndValues =
190+
Leb128Reader.deserializeMap(Uid32.class, EntryTableValue.class, itemsBytes);
191+
192+
//
193+
// Insert in database
194+
//
195+
insert(uidsAndValues);
196+
197+
return 0;
198+
} catch (CloudproofException e) {
199+
return FindexCallbackException.record(e);
200+
}
201+
}
202+
};
203+
}
204+
159205
/**
160206
* Return the appropriate upsert callback (with input/output serialization).
161207
*/

0 commit comments

Comments
 (0)