config.py 文件源码

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

项目:meeting_room_project 作者: Wynndow 项目源码 文件源码
def create_credentials():
        scopes = ['https://www.googleapis.com/auth/admin.directory.resource.calendar',
                  'https://www.googleapis.com/auth/calendar']
        client_secret_dict = ast.literal_eval(os.environ['MR_CLIENT_SECRET_JSON'])
        credentials = ServiceAccountCredentials.from_json_keyfile_dict(
            client_secret_dict, scopes=scopes).create_delegated(os.environ['MR_DELEGATED_ACCOUNT'])
        http = credentials.authorize(Http())
        directory = build('admin', 'directory_v1', http=http)
        calendar = build('calendar', 'v3', http=http)
        return directory, calendar
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号