Puts the results of WS-Security headers processing in the message context. Some actions like Signature
Confirmation require this.
431955
@SuppressWarnings("unchecked")
    private void updateContextWithResults(final MessageContext messageContext, final WSHandlerResult result) {
        List<WSHandlerResult> handlerResults;
        if ((handlerResults = (List<WSHandlerResult>) messageContext.getProperty(WSHandlerConstants.RECV_RESULTS)) == null) {
            handlerResults = new ArrayList<WSHandlerResult>();
            messageContext.setProperty(WSHandlerConstants.RECV_RESULTS, handlerResults);
        }
        handlerResults.add(0, result);
        messageContext.setProperty(WSHandlerConstants.RECV_RESULTS, handlerResults);
    }
1212192
def __standardize_result(status, message, data=None, debug_msg=None):
    '''
    
    '''
    result = {
        'status': status,
        'message': message
    }

    if data is not None:
        result['return'] = data

    if debug_msg is not None and debug:
        result['debug'] = debug_msg

    return result
698218
def stringify_headers headers
      headers.inject({}) do |result, (key, value)|
        if key.is_a? Symbol
          key = key.to_s.split(/_/).map { |w| w.capitalize }.join('-')
        end
        if 'CONTENT-TYPE' == key.upcase
          target_value = value.to_s
          result[key] = MIME::Types.type_for_extension target_value
        elsif 'ACCEPT' == key.upcase
          # Accept can be composed of several comma-separated values
          if value.is_a? Array
            target_values = value
          else
            target_values = value.to_s.split ','
          end
          result[key] = target_values.map { |ext| MIME::Types.type_for_extension(ext.to_s.strip) }.join(', ')
        else
          result[key] = value.to_s
        end
        result
      end
    end
478754
def _generate_result(self, res_type, channel, result):
        """"""
        schema = self.api.ws_result_schema()
        schema.context['channel'] = channel
        schema.context['response_type'] = res_type
        self.callback(schema.load(result), self.context)
885601
@Override
	public void processMessage(final WebSocketMessage webSocketData) {

		setDoTransactionNotifications(true);

		final SecurityContext securityContext = getWebSocket().getSecurityContext();

		try {

			final String name      = webSocketData.getNodeDataStringValue("name");
			final String rawData   = webSocketData.getNodeDataStringValue("fileData");

			final File newFile = FileHelper.createFileBase64(securityContext, rawData, null);

			newFile.setProperties(securityContext, new PropertyMap(AbstractNode.name, name));

		} catch (Throwable t) {

			String msg = t.toString();

			// return error message
			getWebSocket().send(MessageBuilder.status().code(400).message("Could not upload file: ".concat((msg != null) ? msg : "")).build(), true);

		}
	}
568874
def process_results(self, paragraph):
        """"""
        if 'result' in paragraph and paragraph['result']['msg']:
            msg = paragraph['result']['msg']
            self.output_options[paragraph['result']['type']](msg)
246574
def sanitize_http_headers(client, event):
    
    # request headers
    try:
        headers = event["context"]["request"]["headers"]
        event["context"]["request"]["headers"] = varmap(_sanitize, headers)
    except (KeyError, TypeError):
        pass

    # response headers
    try:
        headers = event["context"]["response"]["headers"]
        event["context"]["response"]["headers"] = varmap(_sanitize, headers)
    except (KeyError, TypeError):
        pass

    return event
1373923
def parse_results_header(cls, header):
        
        header = IORMetricsExtractor.RE_MULTIPLE_SPACES.sub(' ', header)
        header = header.split(' ')
        return header
274867
protected final void validateSamlProtocolResponse(final Response response, final SAML2MessageContext context,
                                                      final SignatureTrustEngine engine) {

        validateSuccess(response.getStatus());

        validateSignatureIfItExists(response.getSignature(), context, engine);

        validateIssueInstant(response.getIssueInstant());

        AuthnRequest request = null;
        final SAMLMessageStore messageStorage = context.getSAMLMessageStore();
        if (messageStorage != null && response.getInResponseTo() != null) {
            final Optional<XMLObject> xmlObject = messageStorage.get(response.getInResponseTo());
            if (!xmlObject.isPresent()) {
                throw new SAMLInResponseToMismatchException("InResponseToField of the Response doesn't correspond to sent message "
                    + response.getInResponseTo());
            } else if (xmlObject.get() instanceof AuthnRequest) {
                request = (AuthnRequest) xmlObject.get();
            } else {
                throw new SAMLInResponseToMismatchException("Sent request was of different type than the expected AuthnRequest "
                    + response.getInResponseTo());
            }
        }

        verifyEndpoint(context.getSAMLEndpointContext().getEndpoint(), response.getDestination());
        if (request != null) {
            verifyRequest(request, context);
        }

        validateIssuerIfItExists(response.getIssuer(), context);
    }
774997
def _process_server_headers(
        self, key: Union[str, bytes], headers: httputil.HTTPHeaders
    ) -> None:
        
        assert headers["Upgrade"].lower() == "websocket"
        assert headers["Connection"].lower() == "upgrade"
        accept = self.compute_accept_value(key)
        assert headers["Sec-Websocket-Accept"] == accept

        extensions = self._parse_extensions_header(headers)
        for ext in extensions:
            if ext[0] == "permessage-deflate" and self._compression_options is not None:
                self._create_compressors("client", ext[1])
            else:
                raise ValueError("unsupported extension %r", ext)

        self.selected_subprotocol = headers.get("Sec-WebSocket-Protocol", None)
261291
private void onSignInResult(int rstCode, SignInHuaweiId result) {
        HMSAgentLog.i("signIn:callback=" + StrUtils.objDesc(handler) +" retCode=" + rstCode);
        if (handler != null) {
            new Handler(Looper.getMainLooper()).post(new CallbackResultRunnable<SignInHuaweiId>(handler, rstCode, result));
            handler = null;
        }
        signInResultForDispose = null;
        retryTimes = MAX_RETRY_TIMES;
    }
202831
def process_request(self, request):
        
        use_jwt_cookie_requested = request.META.get(USE_JWT_COOKIE_HEADER)
        header_payload_cookie = request.COOKIES.get(jwt_cookie_header_payload_name())
        signature_cookie = request.COOKIES.get(jwt_cookie_signature_name())

        if not use_jwt_cookie_requested:
            metric_value = 'not-requested'
        elif header_payload_cookie and signature_cookie:
            # Reconstitute JWT auth cookie if split cookies are available and jwt cookie
            # authentication was requested by the client.
            request.COOKIES[jwt_cookie_name()] = '{}{}{}'.format(
                header_payload_cookie,
                JWT_DELIMITER,
                signature_cookie,
            )
            metric_value = 'success'
        elif header_payload_cookie or signature_cookie:
            # Log unexpected case of only finding one cookie.
            if not header_payload_cookie:
                log_message, metric_value = self._get_missing_cookie_message_and_metric(
                    jwt_cookie_header_payload_name()
                )
            if not signature_cookie:
                log_message, metric_value = self._get_missing_cookie_message_and_metric(
                    jwt_cookie_signature_name()
                )
            log.warning(log_message)
        else:
            metric_value = 'missing-both'

        monitoring.set_custom_metric('request_jwt_cookie', metric_value)
240855
def _handle_result(self):
        
        result = self.inbox.get()
        if result.success:
            if self._verbosity >= VERB_PROGRESS:
                sys.stderr.write("\nuploaded chunk {} \n".format(result.index))
            self.results.append((result.index, result.md5))
            self._pending_chunks -= 1
        else:
            raise result.traceback
751641
def post_result_data(self, client, check, output, status):
        
        data = {
            'source': client,
            'name': check,
            'output': output,
            'status': status,
        }
        self._request('POST', '/results', data=json.dumps(data))
        return True
1070456
def callback(self, result, message):
        
        self.results.put(result)
        message.ack()
1192206
def pre_process_method_headers(method, headers):
    '''
        
    '''
    method = method.lower()

    # Standard WSGI supported headers
    _wsgi_headers = ["content_length", "content_type", "query_string",
                     "remote_addr", "remote_host", "remote_user",
                     "request_method", "server_name", "server_port"]

    _transformed_headers = {}

    # For every header, replace - to _, prepend http_ if necessary and convert
    # to upper case.
    for header, value in headers.items():

        header = header.replace("-", "_")
        header = "http_{header}".format(
            header=header) if header.lower() not in _wsgi_headers else header
        _transformed_headers.update({header.upper(): value})

    return method, _transformed_headers
1020269
protected function handleS3PromisesResult($s3_results)
    {
        foreach ($s3_results as $promise) {
            if ($promise['state'] !== 'fulfilled') {
                $code = HttpStatusCodes::HTTP_SERVICE_UNAVAILABLE;
                if (array_key_exists('value', $promise)) {
                    $response = $promise['value'];
                    $code = $response->getStatusCode();
                }
                throw new FilestackException("Errored uploading to s3", $code);
            }
        }
    }