Skip to content

Commit dadd255

Browse files
author
Chris Steipp
committed
Make compatible with Netflix master
1 parent bd4f879 commit dadd255

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

blessclient/bless_lambda.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,7 @@ def getCert(self, payload):
4949
except ValueError:
5050
# On a 404, boto tries to decode any body as json
5151
raise LambdaInvocationException('Invalid message format in Lambda response')
52-
return response['Payload'].read()
52+
payload = json.loads(response['Payload'].read())
53+
if 'certificate' not in payload:
54+
raise LambdaInvocationException('No certificate in response.')
55+
return payload['certificate']

blessclient/client.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ def bless(region, nocache, showgui, hostname, bless_config):
540540
payload = {
541541
'bastion_user': username,
542542
'bastion_user_ip': my_ip,
543-
'remote_username': username,
543+
'remote_usernames': username,
544544
'bastion_ips': bless_config.get_aws_config()['bastion_ips'],
545545
'command': '*',
546546
'public_key_to_sign': public_key,
@@ -549,7 +549,7 @@ def bless(region, nocache, showgui, hostname, bless_config):
549549

550550
logging.debug("Got back cert: {}".format(cert))
551551

552-
if cert[:30] != '"[email protected] ':
552+
if cert[:29] != '[email protected] ':
553553
error_msg = json.loads(cert)
554554
if ('errorType' in error_msg
555555
and error_msg['errorType'] == 'KMSAuthValidationError'
@@ -577,7 +577,7 @@ def bless(region, nocache, showgui, hostname, bless_config):
577577

578578
ssh_agent_remove_bless(identity_file)
579579
with open(cert_file, 'w') as cert_file:
580-
cert_file.write(cert[1:len(cert) - 3])
580+
cert_file.write(cert)
581581
ssh_agent_add_bless(identity_file)
582582

583583
bless_cache.set('certip', my_ip)

0 commit comments

Comments
 (0)