Skip to content

Commit 898ccbb

Browse files
committed
chore: merge branch 'release/v3.0.0'
2 parents cacd9fb + 63aa7f7 commit 898ccbb

21 files changed

Lines changed: 129 additions & 93 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
test:
3232
services:
3333
kms:
34-
image: cosmian/kms:4.2.0
34+
image: cosmian/kms:4.3.3
3535
env:
3636
COSMIAN_SERVER_URL: http://localhost:9998
3737
KMS_PUBLIC_PATH: /tmp
@@ -86,7 +86,7 @@ jobs:
8686
extension: so
8787
destination: linux-x86-64
8888
os: ubuntu-20.04
89-
kms-version: 4.2.0
89+
kms-version: 4.3.3
9090
copy_fresh_build: false
9191
copy_regression_files: |
9292
cp ./cloudproof_python/non_regression_vector.json src/test/resources/cover_crypt/non_regression/python_non_regression_vector.json
@@ -98,7 +98,7 @@ jobs:
9898
with:
9999
branch: develop
100100
target: wasm32-unknown-unknown
101-
kms-version: 4.2.0
101+
kms-version: 4.3.3
102102
copy_fresh_build: false
103103
copy_regression_files: |
104104
cp ./cloudproof_python/non_regression_vector.json tests/data/cover_crypt/non_regression/python_non_regression_vector.json

CHANGELOG.md

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

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

5+
---
6+
7+
## [3.0.0] - 2023-03-08
8+
9+
### Features
10+
11+
- Support cover_crypt v11.0 (#20)
12+
- Update to Findex 3.0 (#21)
13+
14+
---
15+
516
## [2.0.1] - 2023-02-27
617

718
### Documentation

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Cloudproof Encryption Python Library
1+
# Cloudproof Python Library
22

33
[![PyPI version](https://badge.fury.io/py/cloudproof_py.svg)](https://badge.fury.io/py/cloudproof_py)
44
![Build status](https://github.com/Cosmian/cloudproof_python/actions/workflows/ci.yml/badge.svg)
@@ -88,5 +88,6 @@ This table shows the minimum version correspondence between the various componen
8888

8989
| `cloudproof_py` | CoverCrypt | Findex | KMS |
9090
| --------------- | ---------- | ----------- | ----- |
91+
| >=3.0.0 | 11.0.0 | 3.0.0 | 4.3.3 |
9192
| >=2.0.0 | 10.0.0 | 2.0.1,2.1.0 | 4.2.0 |
9293
| >=1.0.0 | 8.0.1 | 2.0.0 | - |

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
99

1010
project = "CloudProof_Py"
11-
copyright = "2022, Cosmian Tech"
11+
copyright = "2023, Cosmian Tech"
1212
author = "Cosmian Tech"
1313

1414
# -- General configuration ---------------------------------------------------

examples/cli_demo/main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
import json
33
import sqlite3
44
from secrets import token_bytes
5-
from termcolor import colored
65

76
from findex_db import FindexSQLite
7+
from termcolor import colored
8+
89
from cloudproof_py import cover_crypt, findex
910

1011
sql_create_users_table = """CREATE TABLE IF NOT EXISTS users (
@@ -17,7 +18,6 @@
1718
region BLOB NOT NULL,
1819
employeeNumber BLOB NOT NULL,
1920
security BLOB NOT NULL
20-
2121
);"""
2222

2323
sql_create_entry_table = """CREATE TABLE IF NOT EXISTS entry_table (
@@ -124,8 +124,8 @@
124124
findex_interface = FindexSQLite(conn)
125125

126126
# Mapping of the users database UID to the corresponding keywords (firstname, lastname, etc)
127-
mapping_indexed_values_to_keywords = {
128-
findex.IndexedValue.from_location(user_id): [
127+
mapping_indexed_values_to_keywords: findex.typing.IndexedValuesAndKeywords = {
128+
findex.Location.from_bytes(user_id): [
129129
keyword.lower() for keyword in user.values()
130130
]
131131
for user_id, user in zip(user_db_uids, users)
@@ -173,7 +173,7 @@
173173
if len(found_users) == 0:
174174
print(colored("No user found!", "red", attrs=["bold"]))
175175
continue
176-
found_users_uids = found_users[keyword]
176+
found_users_uids = [bytes(location) for location in found_users[keyword]]
177177

178178
# 2. Query user database
179179
str_uids = ",".join("?" * len(found_users_uids))

examples/cli_demo/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
cloudproof-py==2.0
1+
cloudproof-py==3.0
22
termcolor==2.1.1
33
types-termcolor==1.1.6
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cloudproof-py==2.0
1+
cloudproof-py==3.0

examples/findex_upsert_search/main.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# -*- coding: utf-8 -*-
22
import argparse
3-
from typing import Dict, List, Union
3+
from typing import Union
44

55
from findex_dict import FindexDict
66
from findex_redis import FindexRedis
77
from findex_sqlite import FindexSQLite
88

9-
from cloudproof_py.findex import MasterKey, Label, IndexedValue, Findex, utils
9+
from cloudproof_py.findex import Findex, Keyword, Label, Location, MasterKey, utils
10+
from cloudproof_py.findex.typing import IndexedValuesAndKeywords, ProgressResults
1011

1112
# Simple database containing the firstname and lastname of each user.
1213
# Each line has a corresponding UID: 1, 2 or 3.
@@ -36,10 +37,10 @@ def main(backend: str = "Dict"):
3637
findex_interface = FindexDict()
3738

3839
# Create the index
39-
indexed_values_and_keywords = {}
40+
indexed_values_and_keywords: IndexedValuesAndKeywords = {}
4041
for uid, keywords in data.items():
4142
# Convert database UIDs to IndexedValue expected by Findex
42-
location = IndexedValue.from_location(uid.encode("utf-8"))
43+
location = Location.from_string(uid)
4344
# This location has 2 keywords associated: the firstname and lastname
4445
indexed_values_and_keywords[location] = keywords
4546

@@ -61,8 +62,8 @@ def main(backend: str = "Dict"):
6162
# Keywords can point to Locations but also to other Keywords, thus generating a graph.
6263

6364
# Create the alias `Joe` for `John`
64-
alias_graph = {
65-
IndexedValue.from_keyword(b"John"): ["Joe"],
65+
alias_graph: IndexedValuesAndKeywords = {
66+
Keyword.from_string("John"): ["Joe"],
6667
}
6768
findex_interface.upsert(alias_graph, master_key, label)
6869

@@ -91,7 +92,7 @@ def main(backend: str = "Dict"):
9192

9293
print("Search using the `progress_callback`: ")
9394

94-
def echo_progress_callback(res: Dict[str, List[IndexedValue]]) -> bool:
95+
def echo_progress_callback(res: ProgressResults) -> bool:
9596
print("\t Partial results:", res)
9697
return True
9798

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
cloudproof-py==2.0
1+
cloudproof-py==3.0
22
redis>=4.3
33
types_redis>=4.3

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@ cloudproof_py = ["py.typed", "*.pyi"]
77

88
[project]
99
name = "cloudproof_py"
10-
version = "2.0.1"
10+
version = "3.0.0"
1111
authors = [{ name = "Cosmian Tech", email = "tech@cosmian.com" }]
1212
description = "Python library for Cosmian Cloud Proof"
1313
readme = "README.md"
1414
requires-python = ">=3.7"
1515
classifiers = [
1616
"Programming Language :: Python :: 3",
17-
"License :: OSI Approved :: MIT License",
1817
"Operating System :: OS Independent",
1918
]
20-
dependencies = ["cover-crypt >= 10.0.0, < 11.0.0", "findex >= 2.0.1, < 3.0.0", "cosmian-kms >= 4.2.0, < 5.0.0"]
19+
dependencies = ["cover-crypt >= 11.0.0, < 12.0.0", "findex >= 3.0.0, < 4.0.0", "cosmian-kms >= 4.3.3, < 5.0.0"]
2120

2221
[project.urls]
2322
"Homepage" = "https://github.com/Cosmian/cloudproof_python"

0 commit comments

Comments
 (0)