Skip to content

Commit f61d2dd

Browse files
Hugo Rosenkranz-CostaManuthor
authored andcommitted
feat: update to findex 5.0.0
1 parent 3429e47 commit f61d2dd

6 files changed

Lines changed: 21 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.
66

77
### Features
88

9+
- Update to findex 5.0.0
910
- Support KMS v4.5.0 with tagging support
1011

1112
## [4.0.2] - 2023-07-17

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ The library is available under a dual licensing scheme Affero GPL/v3 and commerc
2424

2525
The library is based on:
2626

27-
- [CoverCrypt](https://github.com/Cosmian/cover_crypt) algorithm which allows
27+
- [Covercrypt](https://github.com/Cosmian/cover_crypt) algorithm which allows
2828
creating ciphertexts for a set of attributes and issuing user keys with access
29-
policies over these attributes. `CoverCrypt` offers Post-Quantum resistance.
29+
policies over these attributes. `Covercrypt` offers Post-Quantum resistance.
3030

3131
- [Findex](https://github.com/Cosmian/findex) which is a cryptographic protocol designed to securely make search queries on
3232
an untrusted cloud server. Thanks to its encrypted indexes, large databases can
@@ -48,7 +48,7 @@ Please [check the online documentation](https://docs.cosmian.com/cloudproof_encr
4848

4949
An interactive CLI demo combining policy-based encryption with searchable keywords.
5050

51-
Users data from `./examples/cli_demo/data.json` are encrypted using CoverCrypt and indexed via Findex.
51+
Users data from `./examples/cli_demo/data.json` are encrypted using Covercrypt and indexed via Findex.
5252

5353
Try the demo:
5454

@@ -88,15 +88,15 @@ The generated documentation will be in `./docs/_build/html`.
8888

8989
## Versions Correspondence
9090

91-
This library depends on [CoverCrypt](https://github.com/Cosmian/cover_crypt) and [Findex](https://github.com/Cosmian/findex).
91+
This library depends on [Covercrypt](https://github.com/Cosmian/cover_crypt) and [Findex](https://github.com/Cosmian/findex).
9292

9393
This table shows the minimum version correspondence between the various components.
9494

95-
| `cloudproof_py` | CoverCrypt | Findex | KMS |
95+
| `cloudproof_py` | Covercrypt | Findex | KMS |
9696
| --------------- | ---------- | ----------- | ----- |
97-
| >=4.1.0 | 11.0.0 | 4.0.0,4.0.1 | 4.5.0 |
98-
| >=4.0.2 | 11.0.0 | 4.0.0,4.0.1 | 4.4.3 |
99-
| >=4.0.1 | 11.0.0 | 4.0.0,4.0.1 | 4.4.2 |
97+
| >=4.1.0 | 12.0.0 | 5.0.0 | 4.5.0 |
98+
| >=4.0.2 | 11.0.0 | 4.0.1 | 4.4.3 |
99+
| >=4.0.1 | 11.0.0 | 4.0.1 | 4.4.2 |
100100
| >=4.0.0 | 11.0.0 | 4.0.0,4.0.1 | 4.3.3 |
101101
| >=3.0.0 | 11.0.0 | 3.0.0 | 4.3.3 |
102102
| >=2.0.0 | 10.0.0 | 2.0.1,2.1.0 | 4.2.0 |

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ classifiers = [
1919
dependencies = [
2020
"cloudproof-anonymization >= 0.1.0, < 1.0.0",
2121
"cover-crypt >= 11.0.0, < 12.0.0",
22-
"findex >= 4.0.0, < 5.0.0",
22+
"findex >= 5.0.0, < 6.0.0",
2323
"cosmian-kms >= 4.5.0, < 5.0.0",
2424
"cloudproof-fpe >= 0.1.0, < 1.0.0",
2525
]

src/cloudproof_py/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# -*- coding: utf-8 -*-
2+
import importlib.metadata
3+
4+
__version__ = importlib.metadata.version(__package__ or __name__)

src/cloudproof_py/findex/Findex.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def upsert(
3636
label: Label,
3737
additions: IndexedValuesAndKeywords,
3838
deletions: IndexedValuesAndKeywords,
39-
) -> None:
39+
) -> Set[Keyword]:
4040
"""Upserts the given relations between `IndexedValue` and `Keyword` into Findex tables.
4141
4242
Args:
@@ -47,7 +47,7 @@ def upsert(
4747
deletions (Dict[Location | Keyword, List[Keyword | str]]):
4848
map of `IndexedValue` to a list of `Keyword` to delete from the index
4949
"""
50-
self.findex_core.upsert_wrapper(master_key, label, additions, deletions)
50+
return self.findex_core.upsert_wrapper(master_key, label, additions, deletions)
5151

5252
@abstractmethod
5353
def fetch_entry_table(

tests/test_findex.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import sqlite3
55
import unittest
66
from base64 import b64decode
7-
from typing import Dict, List, Optional, Set, Tuple, Sequence
7+
from typing import Dict, List, Optional, Sequence, Set, Tuple
88

99
from cloudproof_py.findex import Findex, Keyword, Label, Location, MasterKey
1010
from cloudproof_py.findex.typing import IndexedValuesAndKeywords, ProgressResults
@@ -228,7 +228,10 @@ def test_sqlite_upsert_graph(self) -> None:
228228
indexed_values_and_keywords: IndexedValuesAndKeywords = {
229229
Location.from_bytes(key): value for key, value in self.users.items()
230230
}
231-
self.interface.upsert(self.mk, self.label, indexed_values_and_keywords, {})
231+
inserted_kw = self.interface.upsert(
232+
self.mk, self.label, indexed_values_and_keywords, {}
233+
)
234+
self.assertEqual(len(inserted_kw), 5)
232235

233236
res = self.interface.search(self.mk, self.label, ["Sheperd"])
234237
self.assertEqual(len(res["Sheperd"]), 2)

0 commit comments

Comments
 (0)