-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve .env.example for devs, better default secrets
- Loading branch information
1 parent
d90d64d
commit 997a675
Showing
8 changed files
with
56 additions
and
33 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
ADMYRAL_DISABLE_NSJAIL=true # outside of docker, we don't use nsjail | ||
# outside of docker, we don't use nsjail | ||
ADMYRAL_DISABLE_NSJAIL=true | ||
|
||
# used for generating migrations | ||
MIGRATION_DATABASE_URL=sqlite+aiosqlite:///.admyral/migration.db |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from admyral.utils.crypto import encrypt_aes256_gcm, decrypt_aes256_gcm, _generate_hs256 | ||
|
||
|
||
TEST_SECRET = bytes.fromhex("834f01cf391c972f1e6def3d7f315f8194bb10048e5cf282aa4cba63b239d8fb") | ||
|
||
|
||
def test_encrypt_decrypt(): | ||
msg = "this is my encrypted message - hello world!" | ||
ciphertext = encrypt_aes256_gcm(TEST_SECRET, "this is my encrypted message - hello world!") | ||
deciphered = decrypt_aes256_gcm(TEST_SECRET, ciphertext) | ||
assert deciphered == msg | ||
|
||
|
||
def test_hs256(): | ||
h = _generate_hs256(TEST_SECRET, "this is my securely hashed message - hello world!") | ||
assert h is not None |