MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / _apply_auth_params

Method _apply_auth_params

sdks/python/src/e2a/v1/generated/api_client.py:660–689  ·  view source on GitHub ↗

Updates the request parameters based on a single auth_setting :param headers: Header parameters dict to be updated. :param queries: Query parameters tuple list to be updated. :resource_path: A string representation of the HTTP request resource path. :method: A string

(
        self,
        headers,
        queries,
        resource_path,
        method,
        body,
        auth_setting
    )

Source from the content-addressed store, hash-verified

658 )
659
660 def _apply_auth_params(
661 self,
662 headers,
663 queries,
664 resource_path,
665 method,
666 body,
667 auth_setting
668 ) -> None:
669 """Updates the request parameters based on a single auth_setting
670
671 :param headers: Header parameters dict to be updated.
672 :param queries: Query parameters tuple list to be updated.
673 :resource_path: A string representation of the HTTP request resource path.
674 :method: A string representation of the HTTP request method.
675 :body: A object representing the body of the HTTP request.
676 The object type is the return value of sanitize_for_serialization().
677 :param auth_setting: auth settings for the endpoint
678 """
679 if auth_setting['in'] == 'cookie':
680 headers['Cookie'] = auth_setting['value']
681 elif auth_setting['in'] == 'header':
682 if auth_setting['type'] != 'http-signature':
683 headers[auth_setting['key']] = auth_setting['value']
684 elif auth_setting['in'] == 'query':
685 queries.append((auth_setting['key'], auth_setting['value']))
686 else:
687 raise ApiValueError(
688 'Authentication token must be in `query` or `header`'
689 )
690
691 def __deserialize_file(self, response):
692 """Deserializes body to file

Callers 1

Calls 1

ApiValueErrorClass · 0.90

Tested by

no test coverage detected