MCPcopy
hub / github.com/authlib/authlib / _parse_oauth_params

Function _parse_oauth_params

authlib/oauth1/rfc5849/wrapper.py:109–129  ·  view source on GitHub ↗
(query_params, body_params, auth_params)

Source from the content-addressed store, hash-verified

107
108
109def _parse_oauth_params(query_params, body_params, auth_params):
110 oauth_params_set = [
111 (SIGNATURE_TYPE_QUERY, list(_filter_oauth(query_params))),
112 (SIGNATURE_TYPE_BODY, list(_filter_oauth(body_params))),
113 (SIGNATURE_TYPE_HEADER, list(_filter_oauth(auth_params))),
114 ]
115 oauth_params_set = [params for params in oauth_params_set if params[1]]
116 if len(oauth_params_set) > 1:
117 found_types = [p[0] for p in oauth_params_set]
118 raise DuplicatedOAuthProtocolParameterError(
119 '"oauth_" params must come from only 1 signature type '
120 "but were found in {}".format(",".join(found_types))
121 )
122
123 if oauth_params_set:
124 signature_type = oauth_params_set[0][0]
125 oauth_params = dict(oauth_params_set[0][1])
126 else:
127 signature_type = None
128 oauth_params = {}
129 return signature_type, oauth_params

Callers 1

__init__Method · 0.85

Calls 2

_filter_oauthFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…