gsuite.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:streamalert 作者: airbnb 项目源码 文件源码
def _load_credentials(cls, keydata):
        """Load ServiceAccountCredentials from Google service account JSON keyfile

        Args:
            keydata (dict): The loaded keyfile data from a Google service account
                JSON file

        Returns:
            oauth2client.service_account.ServiceAccountCredentials: Instance of
                service account credentials for this discovery service
        """
        try:
            creds = ServiceAccountCredentials.from_json_keyfile_dict(
                keydata, scopes=cls._SCOPES)
        except (ValueError, KeyError):
            # This has the potential to raise errors. See: https://tinyurl.com/y8q5e9rm
            LOGGER.exception('Could not generate credentials from keyfile for %s',
                             cls.type())
            return False

        return creds
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号