server_app.py 文件源码

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

项目:diycrate 作者: jheld 项目源码 文件源码
def new_access():
    bottle_app.oauth = setup_oauth(r_c, conf_obj, store_tokens_callback)
    secret_keys = r_c.get('secret_keys')
    if not secret_keys:
        secret_keys = []
    else:
        secret_keys = json.loads(str(secret_keys, encoding='utf-8', errors='strict'))
    if str(bottle.request.POST.get('diycrate_secret_key')) not in secret_keys:
        raise ValueError('No matching secret key; we are being secure!')
    return json.dumps([el.decode(encoding='utf-8', errors='strict') if isinstance(el, bytes) else el for el in bottle_app.oauth.refresh(bottle.request.POST.get('access_token'))])


# Create our own sub-class of Bottle's ServerAdapter
# so that we can specify SSL. Using just server='cherrypy'
# uses the default cherrypy server, which doesn't use SSL
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号