예제 #1
0
    def __init__(self, protocol, host, port, uri, session_token=None):
        self.__host = host
        self.__port = port
        url = create_product_url(protocol, host, port, uri)
        self.transport = THttpClient.THttpClient(url)
        self.protocol = TJSONProtocol.TJSONProtocol(self.transport)
        self.client = codeCheckerAuthentication.Client(self.protocol)

        if session_token:
            headers = {'Cookie': SESSION_COOKIE_NAME + '=' + session_token}
            self.transport.setCustomHeaders(headers)
예제 #2
0
 def __init__(self, proto, host, port, uri, auto_handle_connection=True,
              session_token=None):
     # Import only if necessary; some tests may not add this to PYTHONPATH.
     from codechecker_api.Authentication_v6 import codeCheckerAuthentication
     from codechecker_client.credential_manager import SESSION_COOKIE_NAME
     url = create_product_url(proto, host, port, '/v' + VERSION + uri)
     transport = THttpClient.THttpClient(url)
     protocol = TJSONProtocol.TJSONProtocol(transport)
     client = codeCheckerAuthentication.Client(protocol)
     if session_token:
         headers = {'Cookie': SESSION_COOKIE_NAME + '=' + session_token}
         transport.setCustomHeaders(headers)
     super(CCAuthHelper, self).__init__(transport,
                                        client, auto_handle_connection)
예제 #3
0
    def __init__(self, protocol, host, port, uri, session_token=None):
        super().__init__(protocol, host, port, uri, session_token)

        self.client = codeCheckerAuthentication.Client(self.protocol)