def get_all_certificates(restrict_path=None, **kwargs):
    """
    Use STS to fetch all of the SSL certificates from a given account
    :param restrict_path: If provided, only return certificates with a matching Path value.
    """
    certificates = []
    account_number = kwargs.get("account_number")
    metrics.send(
        "get_all_certificates",
        "counter",
        1,
        metric_tags={"account_number": account_number},
    )

    while True:
        response = _get_certificates(**kwargs)
        metadata = response["ServerCertificateMetadataList"]

        for m in metadata:
            if restrict_path and m["Path"] != restrict_path:
                continue
            certificates.append(
                _get_certificate(
                    m["ServerCertificateName"],
                    client=kwargs["client"]
                )
            )

        if not response.get("Marker"):
            return _filter_ignored_certificates(certificates, **kwargs)
        else:
            kwargs.update(dict(Marker=response["Marker"]))

    Use STS to fetch all of the SSL certificates from a given account
    :param restrict_path: If provided, only return certificates with a matching Path value.
    
lemur/plugins/lemur_aws/iam.py