MCPcopy Create free account
hub / github.com/EasyIME/PIME / _oauth_parse_response

Function _oauth_parse_response

python/python3/tornado/auth.py:1175–1186  ·  view source on GitHub ↗
(body: bytes)

Source from the content-addressed store, hash-verified

1173
1174
1175def _oauth_parse_response(body: bytes) -> Dict[str, Any]:
1176 # I can't find an officially-defined encoding for oauth responses and
1177 # have never seen anyone use non-ascii. Leave the response in a byte
1178 # string for python 2, and use utf8 on python 3.
1179 body_str = escape.native_str(body)
1180 p = urllib.parse.parse_qs(body_str, keep_blank_values=False)
1181 token = dict(key=p["oauth_token"][0], secret=p["oauth_token_secret"][0])
1182
1183 # Add the extra parameters the Provider included to the token
1184 special = ("oauth_token", "oauth_token_secret")
1185 token.update((k, p[k][0]) for k in p if k not in special)
1186 return token

Callers 2

_on_request_tokenMethod · 0.85

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected