Parse the request of the git credential API from stdin.

    Returns:
        A dictionary with all key-value pairs of the request
423254
def parse_request() -> Dict[str, str]:
    
    in_lines = sys.stdin.readlines()
    LOGGER.debug('Received request "%s"', in_lines)

    request = {}
    for line in in_lines:
        # skip empty lines to be a bit resilient against protocol errors
        if not line.strip():
            continue

        parts = line.split('=', 1)
        assert len(parts) == 2
        request[parts[0].strip()] = parts[1].strip()

    return request
628410
def _post_parse_request(self, request, client_id='', **kwargs):
        

        request = RefreshAccessTokenRequest(**request.to_dict())

        try:
            keyjar = self.endpoint_context.keyjar
        except AttributeError:
            keyjar = ""

        request.verify(keyjar=keyjar, opponent_id=client_id)

        if "client_id" not in request:  # Optional for refresh access token request
            request["client_id"] = client_id

        logger.debug("%s: %s" % (request.__class__.__name__, sanitize(request)))

        return request
1210425
function parseListRequest(req){
  var reqObj = {};
  reqObj.originalUrl = req.originalUrl;
  reqObj.uid = req.params.guid;
  reqObj.env = req.params.environment;
  reqObj.domain = req.params.domain;
  return reqObj;
}
104253
def parse_authentication_request(self, request_body, http_headers=None):
        # type: (str, Optional[Mapping[str, str]]) -> oic.oic.message.AuthorizationRequest
        

        auth_req = AuthorizationRequest().deserialize(request_body)

        for validator in self.authentication_request_validators:
            validator(auth_req)

        logger.debug('parsed authentication_request: %s', auth_req)
        return auth_req
739573
def GetPublicCert(self):
    

    cert_url = self.google_api_url + 'publicKeys'

    resp, content = self.http.request(cert_url)
    if resp.status == 200:
      return simplejson.loads(content)
    else:
      raise errors.GitkitServerError('Error response for cert url: %s' %
                                     content)
1273387
def parse_url_to_dict(url):
    
    p = urlparse(url)

    return {
        'scheme': p.scheme,
        'netloc': p.netloc,
        'path': p.path,
        'params': p.params,
        'query': p.query,
        'fragment': p.fragment,
        'username': p.username,
        'password': p.password,
        'hostname': p.hostname,
        'port': p.port
    }
846362
def _extract_key_info(self, request):
        
        from scrapy.utils.request import request_fingerprint

        key_generator = request.meta.get('qiniu_key_generator')
        if key_generator:
            tmp = key_generator(request.url)
            bucket = tmp['bucket'] or self.bucket
            key = tmp['key']
        else:
            bucket = self.bucket
            key = '%s%s' % (self.key_prefix, request_fingerprint(request))

        return {'bucket': bucket, 'key': key}
913060
def get_credentials(cls, consumer_key, code):
        '''
        

        '''
        headers = {
            'X-Accept': 'application/json',
        }
        url = 'https://getpocket.com/v3/oauth/authorize'
        payload = {
            'consumer_key': consumer_key,
            'code': code,
        }

        return cls._make_request(url, payload, headers)[0]
157080
def parse_auth(header):
    
    try:
        method, data = header.split(None, 1)
        if method.lower() == 'basic':
            name, pwd = base64.b64decode(data).split(':', 1)
            return name, pwd
    except (KeyError, ValueError, TypeError):
        return None
1000567
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'credential_id') and self.credential_id is not None:
            _dict['credential_id'] = self.credential_id
        if hasattr(self, 'status') and self.status is not None:
            _dict['status'] = self.status
        return _dict
1271789
def parse_reqtype(self):
        """"""

        if self.job_args['os_auth_version'] == 'v1.0':
            return dict()
        else:
            setup = {
                'username': self.job_args.get('os_user')
            }

            # Check if any prefix items are set. A prefix should be a
            #  dictionary with keys matching the os_* credential type.
            prefixes = self.job_args.get('os_prefix')

            if self.job_args.get('os_token') is not None:
                auth_body = {
                    'auth': {
                        'token': {
                            'id': self.job_args.get('os_token')
                        }
                    }
                }
                if not self.job_args.get('os_tenant'):
                    raise exceptions.AuthenticationProblem(
                        'To use token auth you must specify the tenant id. Set'
                        ' the tenant ID with [ --os-tenant ]'
                    )
            elif self.job_args.get('os_password') is not None:
                setup['password'] = self.job_args.get('os_password')
                if prefixes:
                    prefix = prefixes.get('os_password')
                    if not prefix:
                        raise NotImplementedError(
                            'the `password` method is not implemented for this'
                            ' auth plugin'
                        )
                else:
                    prefix = 'passwordCredentials'
                auth_body = {
                    'auth': {
                        prefix: setup
                    }
                }
            elif self.job_args.get('os_apikey') is not None:
                setup['apiKey'] = self.job_args.get('os_apikey')
                if prefixes:
                    prefix = prefixes.get('os_apikey')
                    if not prefix:
                        raise NotImplementedError(
                            'the `apikey` method is not implemented for this'
                            ' auth plugin'
                        )
                else:
                    prefix = 'apiKeyCredentials'
                auth_body = {
                    'auth': {
                        prefix: setup
                    }
                }
            else:
                raise exceptions.AuthenticationProblem(
                    'No Password, APIKey, or Token Specified'
                )

            if self.job_args.get('os_tenant'):
                auth = auth_body['auth']
                auth['tenantName'] = self.job_args.get('os_tenant')

            LOG.debug('AUTH Request body: [ %s ]', auth_body)
            return auth_body
102382
def read_validate_params(self, request):
        
        self.client = self.client_authenticator.by_identifier_secret(request)

        self.password = request.post_param("password")
        self.username = request.post_param("username")

        self.scope_handler.parse(request=request, source="body")

        return True
341723
def parse_request(self, request, parameters, fake_method=None):
        '''
        
        '''
        return (fake_method or request.method,
                request.build_absolute_uri(),
                request.META,
                (dict(request.POST.iteritems())
                    if request.method == 'POST'
                    else parameters))
1049614
def _parse_request(self):
        '''
        
        '''
        self.req_method = 'unknown'
        self.req_params = {}
        self.req_rpc_version = '2.0'
        self.req_id = 0
        self.data = self.rfile.read(int(self.headers.get('content-length')))
        data_dict = json.loads(self.data)
        self.req_method = data_dict['method']
        self.req_params = decode_data(data_dict['params'])
        self.req_rpc_version = data_dict['jsonrpc']
        self.req_id = data_dict['id']
117164
def to_dict(self):
        
        data = {
            'id': self.id,
            'referenceId': self.reference_id,
            'type': self.type,
            'displayName': self.display_name,
            'remoteUrl': self.remote_url}
        for key in data.keys():
            if data[key] == None:
                data.pop(key)
        return data
120060
def parse_extras(self):
        # type: () -> None
        

        extras = None
        if "@" in self.line or self.is_vcs or self.is_url:
            line = "{0}".format(self.line)
            uri = URI.parse(line)
            name = uri.name
            if name:
                self._name = name
            if uri.host and uri.path and uri.scheme:
                self.line = uri.to_string(
                    escape_password=False, direct=False, strip_ssh=uri.is_implicit_ssh
                )
            else:
                self.line, extras = pip_shims.shims._strip_extras(self.line)
        else:
            self.line, extras = pip_shims.shims._strip_extras(self.line)
        extras_set = set()  # type: Set[STRING_TYPE]
        if extras is not None:
            extras_set = set(parse_extras(extras))
        if self._name:
            self._name, name_extras = pip_shims.shims._strip_extras(self._name)
            if name_extras:
                name_extras = set(parse_extras(name_extras))
                extras_set |= name_extras
        if extras_set is not None:
            self.extras = tuple(sorted(extras_set))
715494
def find_credential(self, url):
        
        for repository, cred in self.creds_by_repository.items():
            if url.startswith(repository):
                return cred