MCPcopy Index your code
hub / github.com/authlib/authlib / _render

Method _render

authlib/oauth1/rfc5849/client_auth.py:111–123  ·  view source on GitHub ↗
(self, uri, headers, body, oauth_params)

Source from the content-addressed store, hash-verified

109 return oauth_params
110
111 def _render(self, uri, headers, body, oauth_params):
112 if self.signature_type == SIGNATURE_TYPE_HEADER:
113 headers = prepare_headers(oauth_params, headers, realm=self.realm)
114 elif self.signature_type == SIGNATURE_TYPE_BODY:
115 if CONTENT_TYPE_FORM_URLENCODED in headers.get("Content-Type", ""):
116 decoded_body = extract_params(body) or []
117 body = prepare_form_encoded_body(oauth_params, decoded_body)
118 headers["Content-Type"] = CONTENT_TYPE_FORM_URLENCODED
119 elif self.signature_type == SIGNATURE_TYPE_QUERY:
120 uri = prepare_request_uri_query(oauth_params, uri)
121 else:
122 raise ValueError("Unknown signature type specified.")
123 return uri, headers, body
124
125 def sign(self, method, uri, headers, body):
126 """Sign the HTTP request, add OAuth parameters and signature.

Callers 1

signMethod · 0.95

Calls 5

extract_paramsFunction · 0.90
prepare_headersFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected