-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Actualize eng demos with 0.96 #75
Open
Zhaars
wants to merge
3
commits into
master
Choose a base branch
from
zhars/actualize_eng_demos
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ it to a database, and decrypts the data when the app reads it from the database. | |
Script reads data from `data.json` where stored array of entries as data examples. | ||
|
||
```bash | ||
docker exec -it cockroachdb_python_1 python3 extended_example.py --host=acra-server --port=9393 --data=data.json | ||
docker exec -it cockroachdb_python_1 python3 extended_example.py --host=acra-server --port=9393 --data=extended_example_data.json | ||
|
||
$: | ||
data: [{'token_i32': 1234, 'token_i64': 645664, 'token_str': '078-05-1111', 'token_bytes': 'byt13es', 'token_email': '[email protected]', 'data': 'John Wed, Senior Relationshop Manager', 'masking': '$112000', 'searchable': '[email protected]'}, {'token_i32': 1235, 'token_i64': 645665, 'token_str': '078-05-1112', 'token_bytes': 'byt13es2', 'token_email': '[email protected]', 'data': 'April Cassini, Marketing Manager', 'masking': '$168000', 'searchable': '[email protected]'}, {'token_i32': 1236, 'token_i64': 645667, 'token_str': '078-05-1117', 'token_bytes': 'byt13es3', 'token_email': '[email protected]', 'data': 'George Clooney, Famous Actor', 'masking': '$780000', 'searchable': '[email protected]'}] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM cockroachdb/cockroach:v21.2.3 | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
RUN chmod +x /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
version: 0.95.0 | ||
version: 0.96.0 | ||
|
||
encryptor_config_file: "/config/extended_encryptor_config.yaml" | ||
encryptor_config_file: "/config/extended_example_encryptor_config.yaml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
files=( | ||
"/certs/node.key" | ||
"/certs/client.root.key" | ||
) | ||
|
||
# explicitly specify permissions for mounted key files | ||
for file in "${files[@]}"; do | ||
chmod 600 "$file" | ||
done | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,10 +28,10 @@ By default in this demo, Acra configured to work with MySQL database. | |
|
||
### 3.1 Data Encryption(Write) | ||
|
||
Let's write some data to DB using the [`extended_example.py`](https://github.com/cossacklabs/acra/blob/master/examples/python/extended_example.py) script: | ||
Let's write some data to DB using the [`example_type_awareness.py`](https://github.com/cossacklabs/acra/blob/master/examples/python/extended_example.py) script: | ||
|
||
```bash | ||
docker exec -it python-mysql-postgresql_python_1 python3 extended_example.py --host=acra-server --port=9393 --data=data.json | ||
docker exec -it python-mysql-postgresql_python_1 python3 example_type_awareness.py --host=acra-server --port=9393 --data=type_awareness_data.json | ||
|
||
$: | ||
data: [{'token_i32': 1234, 'token_i64': 645664, 'token_str': '078-05-1111', 'token_bytes': 'byt13es', 'token_email': '[email protected]', 'data': 'John Wed, Senior Relationshop Manager', 'masking': '$112000', 'searchable': '[email protected]'}, {'token_i32': 1235, 'token_i64': 645665, 'token_str': '078-05-1112', 'token_bytes': 'byt13es2', 'token_email': '[email protected]', 'data': 'April Cassini, Marketing Manager', 'masking': '$168000', 'searchable': '[email protected]'}, {'token_i32': 1236, 'token_i64': 645667, 'token_str': '078-05-1117', 'token_bytes': 'byt13es3', 'token_email': '[email protected]', 'data': 'George Clooney, Famous Actor', 'masking': '$780000', 'searchable': '[email protected]'}] | ||
|
@@ -42,7 +42,7 @@ data: [{'token_i32': 1234, 'token_i64': 645664, 'token_str': '078-05-1111', 'tok | |
To read and decrypt data the same script could be used but with `--print` param provided: | ||
|
||
```bash | ||
docker exec -it python-mysql-postgresql_python_1 python3 extended_example.py --host=acra-server --port=9393 --print | ||
docker exec -it python-mysql-postgresql_python_1 python3 example_type_awareness.py --host=acra-server --port=9393 --print | ||
``` | ||
|
||
You should see the output that contains all decrypted data: | ||
|
@@ -96,7 +96,7 @@ docker restart python-mysql-postgresql_acra-server_1 | |
### 4.1 Data Encryption(Write) | ||
|
||
```bash | ||
docker exec -it python-mysql-postgresql_python_1 python3 extended_example.py --host=acra-server --port=9393 --data=data.json --postgresql | ||
docker exec -it python-mysql-postgresql_python_1 python3 example_type_awareness.py --host=acra-server --port=9393 --data=type_awareness_data.json --postgresql | ||
|
||
$: | ||
data: [{'token_i32': 1234, 'token_i64': 645664, 'token_str': '078-05-1111', 'token_bytes': 'byt13es', 'token_email': '[email protected]', 'data': 'John Wed, Senior Relationshop Manager', 'masking': '$112000', 'searchable': '[email protected]'}, {'token_i32': 1235, 'token_i64': 645665, 'token_str': '078-05-1112', 'token_bytes': 'byt13es2', 'token_email': '[email protected]', 'data': 'April Cassini, Marketing Manager', 'masking': '$168000', 'searchable': '[email protected]'}, {'token_i32': 1236, 'token_i64': 645667, 'token_str': '078-05-1117', 'token_bytes': 'byt13es3', 'token_email': '[email protected]', 'data': 'George Clooney, Famous Actor', 'masking': '$780000', 'searchable': '[email protected]'}] | ||
|
@@ -107,7 +107,7 @@ data: [{'token_i32': 1234, 'token_i64': 645664, 'token_str': '078-05-1111', 'tok | |
To read and decrypt data the same script could be used but with `--print` param provided: | ||
|
||
```bash | ||
docker exec -it python-mysql-postgresql_python_1 python3 extended_example.py --host=acra-server --port=9393 --print --postgresql | ||
docker exec -it python-mysql-postgresql_python_1 python3 example_type_awareness.py --host=acra-server --port=9393 --print --postgresql | ||
``` | ||
|
||
You should see the output that contains all decrypted data: | ||
|
@@ -166,7 +166,7 @@ Select `View/Edit Data > All rows` and now you can see content of the table. Dow | |
|
||
## 6. Show me the code! | ||
|
||
Take a look at the complete code of [`extended_example.py`](https://github.com/cossacklabs/acra/blob/master/examples/python/extended_example.py). | ||
Take a look at the complete code of [`example_type_awareness.py`](https://github.com/cossacklabs/acra/blob/master/examples/python/example_type_awareness.py). | ||
|
||
Let's see how many code lines are necessary to encrypt some data using Acra. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
version: 0.95.0 | ||
version: 0.96.0 | ||
mysql_enable: true | ||
db_host: mysql | ||
db_port: 3306 | ||
encryptor_config_file: "/config/extended_encryptor_config.yaml" | ||
encryptor_config_file: "/config/example_type_awareness_encryptor_config.yaml" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version: 0.95.0 | ||
version: 0.96.0 | ||
|
||
encryptor_config_file: "/config/searchable.yaml" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
version: 0.95.0 | ||
version: 0.96.0 | ||
|
||
encryptor_config_file: "/config/encryptor_config.yaml" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's leave comment here that we need custom docker file to explicitly set proper permissions to the key file due to docker doesn't mount it properly on all systems?