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
评论列表
文章目录