Skip to content

Commit

Permalink
Merge pull request #8 from synfinatic/multiple-user-certs-in-s3
Browse files Browse the repository at this point in the history
Multiple user certs in s3
  • Loading branch information
bobveznat committed Aug 21, 2014
2 parents f073c76 + 46cca6d commit e27342f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions scripts/sign_key
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,13 @@ if __name__ == '__main__':

# Sign the key
cert_contents = ca.sign_public_user_key(
public_path, username, starts_in, expires_in,
public_path, username, starts_in, expires_in,
reason, principal)

print
print 'Public key signed, certificate available for download here:'
print ca.upload_public_key_cert(username, cert_contents, url_expires)
print ca.upload_public_key_cert(username, environment, cert_contents,
url_expires)

if delete_public_key:
os.remove(public_path)
5 changes: 3 additions & 2 deletions ssh_ca/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ def upload_public_key(self, username, key_contents):
k = self.ssh_bucket.new_key('keys/%s' % (username,))
k.set_contents_from_string(key_contents, replace=True)

def upload_public_key_cert(self, username, cert_contents, expires=7200):
k = self.ssh_bucket.new_key('certs/%s-cert.pub' % (username,))
def upload_public_key_cert(self, username, env, cert_contents,
expires=7200):
k = self.ssh_bucket.new_key('certs/%s-%s-cert.pub' % (username, env))
k.set_contents_from_string(
cert_contents,
headers={'Content-Type': 'text/plain'},
Expand Down

0 comments on commit e27342f

Please sign in to comment.