コード例 #1
0
def test_get_cert_from_arn(app):
    from lemur.plugins.lemur_aws.iam import upload_cert, get_cert_from_arn
    cert = Certificate(EXTERNAL_VALID_STR)
    upload_cert('123456789012', cert, PRIVATE_KEY_STR)
    body, chain = get_cert_from_arn(
        'arn:aws:iam::123456789012:server-certificate/tttt2.netflixtest.net-NetflixInc-20150624-20150625'
    )
    assert body.replace('\n', '') == EXTERNAL_VALID_STR.replace('\n', '')
コード例 #2
0
def test_get_cert_from_arn(app):
    from lemur.plugins.lemur_aws.iam import upload_cert, get_cert_from_arn
    upload_cert('123456789012', 'testCert', EXTERNAL_VALID_STR.decode('utf-8'),
                PRIVATE_KEY_STR.decode('utf-8'))
    body, chain = get_cert_from_arn(
        'arn:aws:iam::123456789012:server-certificate/testCert')
    assert body.replace('\n',
                        '') == EXTERNAL_VALID_STR.decode('utf-8').replace(
                            '\n', '')
コード例 #3
0
ファイル: plugin.py プロジェクト: wyaeld/lemur
 def get_certificates(self, options, **kwargs):
     certs = []
     arns = iam.get_all_server_certs(
         self.get_option('accountNumber', options))
     for arn in arns:
         cert_body, cert_chain = iam.get_cert_from_arn(arn)
         cert_name = iam.get_name_from_arn(arn)
         cert = dict(body=cert_body, chain=cert_chain, name=cert_name)
         certs.append(cert)
     return certs
コード例 #4
0
ファイル: plugin.py プロジェクト: rtdean/lemur
 def get_certificates(self, options, **kwargs):
     certs = []
     arns = iam.get_all_server_certs(find_value('accountNumber', options))
     for arn in arns:
         cert_body, cert_chain = iam.get_cert_from_arn(arn)
         cert_name = iam.get_name_from_arn(arn)
         cert = dict(public_certificate=cert_body,
                     intermediate_certificate=cert_chain,
                     name=cert_name)
         certs.append(cert)
     return certs
コード例 #5
0
ファイル: plugin.py プロジェクト: ejcx/lemur
 def get_certificates(self, options, **kwargs):
     certs = []
     arns = iam.get_all_server_certs(self.get_option('accountNumber', options))
     for arn in arns:
         cert_body, cert_chain = iam.get_cert_from_arn(arn)
         cert_name = iam.get_name_from_arn(arn)
         cert = dict(
             body=cert_body,
             chain=cert_chain,
             name=cert_name
         )
         certs.append(cert)
     return certs
コード例 #6
0
ファイル: plugin.py プロジェクト: bossadvisors/lemur
 def get_certificates(self, options, **kwargs):
     certs = []
     arns = iam.get_all_server_certs(find_value('accountNumber', options))
     for arn in arns:
         cert_body, cert_chain = iam.get_cert_from_arn(arn)
         cert_name = iam.get_name_from_arn(arn)
         cert = dict(
             public_certificate=cert_body,
             intermediate_certificate=cert_chain,
             name=cert_name
         )
         certs.append(cert)
     return certs
コード例 #7
0
ファイル: test_iam.py プロジェクト: EADPCloudSeattle/lemur
def test_get_cert_from_arn(app):
    from lemur.plugins.lemur_aws.iam import upload_cert, get_cert_from_arn
    upload_cert('123456789012', 'testCert', EXTERNAL_VALID_STR.decode('utf-8'), PRIVATE_KEY_STR.decode('utf-8'))
    body, chain = get_cert_from_arn('arn:aws:iam::123456789012:server-certificate/testCert')
    assert body.replace('\n', '') == EXTERNAL_VALID_STR.decode('utf-8').replace('\n', '')
コード例 #8
0
ファイル: test_iam.py プロジェクト: bossadvisors/lemur
def test_get_cert_from_arn(app):
    from lemur.plugins.lemur_aws.iam import upload_cert, get_cert_from_arn
    cert = Certificate(EXTERNAL_VALID_STR)
    upload_cert('123456789012', cert, PRIVATE_KEY_STR)
    body, chain = get_cert_from_arn('arn:aws:iam::123456789012:server-certificate/tttt2.netflixtest.net-NetflixInc-20150624-20150625')
    assert body.replace('\n', '') == EXTERNAL_VALID_STR.replace('\n', '')