-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allowing BLESS lambda to accept ed25519 keys, completing https://gith… (
#74) * Allowing BLESS lambda to accept ed25519 keys, completing #71 . Thanks @jnewbigin .
- Loading branch information
1 parent
f1e2a30
commit ba55021
Showing
2 changed files
with
21 additions
and
3 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 |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
from bless.aws_lambda.bless_lambda import lambda_handler | ||
from tests.ssh.vectors import EXAMPLE_RSA_PUBLIC_KEY, RSA_CA_PRIVATE_KEY_PASSWORD, \ | ||
EXAMPLE_ED25519_PUBLIC_KEY | ||
EXAMPLE_ED25519_PUBLIC_KEY, EXAMPLE_ECDSA_PUBLIC_KEY | ||
|
||
|
||
class Context(object): | ||
|
@@ -21,6 +21,15 @@ class Context(object): | |
"bastion_user_ip": "127.0.0.1" | ||
} | ||
|
||
VALID_TEST_REQUEST_ED2551 = { | ||
"remote_usernames": "user", | ||
"public_key_to_sign": EXAMPLE_ED25519_PUBLIC_KEY, | ||
"command": "ssh user@server", | ||
"bastion_ips": "127.0.0.1", | ||
"bastion_user": "user", | ||
"bastion_user_ip": "127.0.0.1" | ||
} | ||
|
||
VALID_TEST_REQUEST_USERNAME_VALIDATION_EMAIL_REMOTE_USERNAMES_USERADD = { | ||
"remote_usernames": "user,anotheruser", | ||
"public_key_to_sign": EXAMPLE_RSA_PUBLIC_KEY, | ||
|
@@ -60,7 +69,7 @@ class Context(object): | |
|
||
INVALID_TEST_REQUEST_KEY_TYPE = { | ||
"remote_usernames": "user", | ||
"public_key_to_sign": EXAMPLE_ED25519_PUBLIC_KEY, | ||
"public_key_to_sign": EXAMPLE_ECDSA_PUBLIC_KEY, | ||
"command": "ssh user@server", | ||
"bastion_ips": "127.0.0.1", | ||
"bastion_user": "user", | ||
|
@@ -153,6 +162,14 @@ def test_basic_local_request(): | |
assert output['certificate'].startswith('[email protected] ') | ||
|
||
|
||
def test_basic_local_request_ed2551(): | ||
output = lambda_handler(VALID_TEST_REQUEST_ED2551, context=Context, | ||
ca_private_key_password=RSA_CA_PRIVATE_KEY_PASSWORD, | ||
entropy_check=False, | ||
config_file=os.path.join(os.path.dirname(__file__), 'bless-test.cfg')) | ||
assert output['certificate'].startswith('[email protected] ') | ||
|
||
|
||
def test_basic_local_unused_kmsauth_request(): | ||
output = lambda_handler(VALID_TEST_REQUEST_KMSAUTH, context=Context, | ||
ca_private_key_password=RSA_CA_PRIVATE_KEY_PASSWORD, | ||
|