Skip to content

Commit

Permalink
chore: Merge branch 'release/v4.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuthor committed Dec 11, 2023
2 parents d39446f + 07ad236 commit d5c15a4
Show file tree
Hide file tree
Showing 36 changed files with 1,460 additions and 1,066 deletions.
97 changes: 22 additions & 75 deletions .github/workflows/ci.yml
Expand Up @@ -4,7 +4,7 @@ name: Build and test
on: [push]

jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -14,112 +14,58 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install flake8
- name: Linter
run: |
flake8 --max-line-length=100 --ignore E501
- name: Build package
run: |
python -m build
- uses: actions/upload-artifact@v3
with:
name: cloudproof_py_dist
path: ./dist
retention-days: 1
test:
services:
kms:
image: ghcr.io/cosmian/kms:4.5.0
env:
COSMIAN_SERVER_URL: http://localhost:9998
KMS_PUBLIC_PATH: /tmp
KMS_PRIVATE_PATH: /tmp
KMS_SHARED_PATH: /tmp
ports:
- 9998:9998
findex_cloud:
image: ghcr.io/cosmian/findex_cloud:0.1.0
ports:
- 8080:8080
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: cloudproof_py_dist
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mypy types-termcolor>=1.1 types_redis>=4.3 requests>=2.28 types-requests>=2.28
scripts/ci_install_pyo3_builds.sh
pip install cloudproof_py*.whl
- name: Type-check
run: |
mypy src/cloudproof_py/anonymization/
mypy src/cloudproof_py/cover_crypt/
mypy src/cloudproof_py/findex/
mypy src/cloudproof_py/fpe/
mypy tests/
mypy examples/cli_demo
mypy examples/findex_upsert_search
mypy examples/cover_crypt
- name: Run tests
run: |
python tests/non_regression_cover_crypt.py --test --write
python tests/findex_cloud.py
python -m unittest tests/test*.py
- name: Upload non-regression test vectors
uses: actions/upload-artifact@v3
with:
name: cloudproof_python
path: |
./tests/data/export/non_regression_vector.json
./tests/data/export/sqlite.db
retention-days: 1
if-no-files-found: error
cloudproof_python:
uses: Cosmian/reusable_workflows/.github/workflows/cloudproof_python.yml@develop
with:
branch: ${{ github.head_ref }}
target: x86_64-unknown-linux-gnu
kms-version: 4.10.0
findex-cloud-version: 0.3.1
copy_fresh_build: false
regression_files: |
./tests/data/export/non_regression_vector.json
./tests/data/export/sqlite.db
cloudproof_java:
needs: test
needs: cloudproof_python
uses: Cosmian/reusable_workflows/.github/workflows/cloudproof_java_in_docker.yml@develop
with:
branch: v6.0.0
branch: develop
target: x86_64-unknown-linux-gnu
extension: so
destination: linux-x86-64
os: ubuntu-20.04
kms-version: 4.5.0
findex-cloud-version: 0.1.0
kms-version: 4.10.0
findex-cloud-version: 0.3.1
copy_fresh_build: false
copy_regression_files: |
cp ./cloudproof_python/non_regression_vector.json src/test/resources/cover_crypt/non_regression/python_non_regression_vector.json
cp ./cloudproof_python/sqlite.db src/test/resources/findex/non_regression/python_sqlite.db
cloudproof_js:
needs: test
needs: cloudproof_python
uses: Cosmian/reusable_workflows/.github/workflows/cloudproof_js.yml@develop
with:
branch: develop
target: wasm32-unknown-unknown
kms-version: 4.5.0
findex-cloud-version: 0.1.0
kms-version: 4.10.0
findex-cloud-version: 0.3.1
copy_fresh_build: false
copy_regression_files: |
cp ./cloudproof_python/non_regression_vector.json tests/data/cover_crypt/non_regression/python_non_regression_vector.json
cp ./cloudproof_python/sqlite.db tests/data/findex/non_regression/python_sqlite.db
cloudproof_flutter:
needs:
- test
- cloudproof_python
uses: Cosmian/reusable_workflows/.github/workflows/cloudproof_flutter.yml@develop
with:
branch: v7.0.0
branch: develop
target: x86_64-unknown-linux-gnu
extension: so
copy_fresh_build: false
Expand All @@ -129,6 +75,7 @@ jobs:
cleanup:
needs:
- lint
- cloudproof_flutter
- cloudproof_java
- cloudproof_js
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -72,3 +72,6 @@ docs/_build/
# Pyenv
.env/
.python-version

# Findex test base
./tests/data/export/sqlite.db
44 changes: 41 additions & 3 deletions .pre-commit-config.yaml
Expand Up @@ -45,6 +45,12 @@ repos:
- id: prettier
types_or: [css, javascript, jsx, markdown, bash, java, sh]

- repo: https://github.com/asottile/reorder_python_imports
rev: v3.12.0
hooks:
- id: reorder-python-imports
args: [--py3-plus]

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
Expand All @@ -57,10 +63,36 @@ repos:
args: ["--max-line-length=100", "--ignore", "E501"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.3.0'
rev: v1.7.0
hooks:
- id: mypy
additional_dependencies: [types_termcolor==1.1.6, types_redis==4.3.21.6, types-requests==2.28.11.15, types-urllib3==1.26.25.8]
- id: mypy
alias: mypy_no_demo
# args: [--strict, --ignore-missing-imports]
args: [--ignore-missing-imports]
exclude: examples/cli_demo
additional_dependencies:
[
types_termcolor==1.1.6,
types_redis==4.3.21.6,
types-requests==2.28.11.15,
types-urllib3==1.26.25.8,
]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.0
hooks:
- id: mypy
alias: mypy_no_impl_examples
# args: [--strict, --ignore-missing-imports]
args: [--ignore-missing-imports]
exclude: examples/findex_upsert_search
additional_dependencies:
[
types_termcolor==1.1.6,
types_redis==4.3.21.6,
types-requests==2.28.11.15,
types-urllib3==1.26.25.8,
]

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.34.0
Expand All @@ -75,6 +107,12 @@ repos:
--disable=MD046,
]

- repo: https://github.com/tcort/markdown-link-check
rev: v3.11.2
hooks:
- id: markdown-link-check
args: [-q]

- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
rev: v1.1.2
hooks:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,13 @@

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

## [4.2.0] - 2023-11-22

### Features

- Add policy edition example and tests ([#36])
- Support findex v6

## [4.1.0] - 2023-08-28

### Features
Expand Down
23 changes: 12 additions & 11 deletions README.md
@@ -1,7 +1,7 @@
# Cloudproof Python Library

[![PyPI version](https://badge.fury.io/py/cloudproof_py.svg)](https://badge.fury.io/py/cloudproof_py)
![Build status](https://github.com/Cosmian/cloudproof_python/actions/workflows/ci.yml/badge.svg)
![Build status](https://github.com/Cosmian/cloudproof_python/actions/workflows/ci.yml/badge.svg?branch=main)

The library provides a Python API to the **Cloudproof Encryption** product of the [Cosmian Ubiquitous Encryption platform](https://cosmian.com).

Expand Down Expand Up @@ -42,7 +42,7 @@ pip install cloudproof_py
```

Code examples are available in [./examples](./examples) to get you started.
Please [check the online documentation](https://docs.cosmian.com/cloudproof_encryption/use_cases_benefits/) for more details on using the CloudProof APIs.
Please [check the online documentation](https://docs.cosmian.com/) for more details on using the CloudProof APIs.

## Demo

Expand Down Expand Up @@ -92,12 +92,13 @@ This library depends on [Covercrypt](https://github.com/Cosmian/cover_crypt) and

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

| `cloudproof_py` | Covercrypt | Findex | KMS |
| --------------- | ---------- | ----------- | ----- |
| >=4.1.0 | 12.0.0 | 5.0.0 | 4.5.0 |
| >=4.0.2 | 11.0.0 | 4.0.1 | 4.4.3 |
| >=4.0.1 | 11.0.0 | 4.0.1 | 4.4.2 |
| >=4.0.0 | 11.0.0 | 4.0.0,4.0.1 | 4.3.3 |
| >=3.0.0 | 11.0.0 | 3.0.0 | 4.3.3 |
| >=2.0.0 | 10.0.0 | 2.0.1,2.1.0 | 4.2.0 |
| >=1.0.0 | 8.0.1 | 2.0.0 | - |
| `cloudproof_py` | Covercrypt | Findex | KMS |
| --------------- | ---------- | ----------- | ------ |
| >=4.2.0 | 13.0.0 | 6.0.0 | 4.10.0 |
| >=4.1.0 | 12.0.0 | 5.0.0 | 4.5.0 |
| >=4.0.2 | 11.0.0 | 4.0.1 | 4.4.3 |
| >=4.0.1 | 11.0.0 | 4.0.1 | 4.4.2 |
| >=4.0.0 | 11.0.0 | 4.0.0,4.0.1 | 4.3.3 |
| >=3.0.0 | 11.0.0 | 3.0.0 | 4.3.3 |
| >=2.0.0 | 10.0.0 | 2.0.1,2.1.0 | 4.2.0 |
| >=1.0.0 | 8.0.1 | 2.0.0 | - |
18 changes: 18 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,18 @@
---
version: "3.4"
services:
kms:
container_name: kms
image: ghcr.io/cosmian/kms:4.10.0
ports:
- 9998:9998

findex_cloud:
image: ghcr.io/cosmian/findex_cloud:0.3.1
ports:
- 8080:8080

redis:
image: redis:latest
ports:
- 6379:6379
1 change: 0 additions & 1 deletion docs/conf.py
Expand Up @@ -3,7 +3,6 @@
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

Expand Down

0 comments on commit d5c15a4

Please sign in to comment.