-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* removed un-neceesary import * added test for keyring * version 0.6.0 * testing keyring * added ubuntu scripts * added root * removed ubuntu * don't test keyring with ubuntu * version 0.6.0, toml update * removed special ubuntu workflow
- Loading branch information
1 parent
488774c
commit ab16936
Showing
7 changed files
with
82 additions
and
29 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
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 +1 @@ | ||
__version__ = "0.5.3" | ||
__version__ = "0.6.0" |
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 |
---|---|---|
@@ -1,8 +1,23 @@ | ||
[tool.poetry] | ||
name = "mentaws" | ||
version = "0.5.3" | ||
version = "0.6.0" | ||
description = "moMENTary AWS credentials" | ||
authors = ["keithrozario <[email protected]>"] | ||
repository = "https://github.com/keithrozario/mentaws" | ||
homepage = "https://github.com/keithrozario/mentaws" | ||
classifiers=[ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Natural Language :: English", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
] | ||
readme = "README.MD" | ||
license = "MIT" | ||
keywords = ["aws", "mentaws", "tokens", "credentials", "temporary"] | ||
|
||
|
||
[tool.poetry.dependencies] | ||
python = "^3.6" | ||
|
@@ -24,3 +39,6 @@ mts = "mentaws.main:main" | |
[build-system] | ||
requires = ["poetry>=0.12"] | ||
build-backend = "poetry.masonry.api" | ||
|
||
[tool.poetry.urls] | ||
"Bug Tracker" = "https://github.com/keithrozario/mentaws/issues" |
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,38 @@ | ||
import platform | ||
|
||
import keyring | ||
from cryptography.fernet import Fernet, InvalidToken | ||
from mentaws import cryptographic_operations | ||
|
||
app_name = "mentaws" | ||
key_name = "test_key" | ||
|
||
def test_keyring_on_os(): | ||
|
||
""" | ||
Can't test on Linux with Github actions because installing backend is quite complex | ||
""" | ||
|
||
if not platform.system() == "Linux": | ||
key = cryptographic_operations.gen_key() | ||
assert len(key) == 44 | ||
|
||
assert cryptographic_operations.setup_key(app_name=app_name, key_name=key_name) == True | ||
|
||
encryption_key = cryptographic_operations.get_key(app_name=app_name, key_name=key_name) | ||
assert isinstance(encryption_key, Fernet) | ||
|
||
def test_encrypt_decrypt(): | ||
|
||
""" | ||
Can't test on Linux with Github actions because installing backend is quite complex | ||
""" | ||
|
||
if not platform.system() == "Linux": | ||
test_string = "abc12345dsfafsafdfsdf3-12934019u423oyrewkbf1!@#%^IU^&(&%&*)_()_)()((*&*%$^%#$@#?>:{}|" | ||
|
||
key = cryptographic_operations.get_key(app_name=app_name, key_name=key_name) | ||
encrypted_string = key.encrypt(test_string.encode('utf-8')).decode('utf-8') | ||
|
||
decrypted_string = key.decrypt(encrypted_string.encode('utf-8')) | ||
assert decrypted_string.decode('utf-8') == test_string |