51Degrees Pipeline for Python

fiftyone_pipeline_core.web Namespace Reference

Functions

 request_line_path (request)
 The path of the request line as the server received it, when the server says what that was, and otherwise the path Flask decoded.
 webevidence (request)
 Get evidence from a web request (gets headers, cookies, session values, query parameters and the fields of a posted form, and the request itself as server.http-request).
 set_response_header (flowData, response)
 Set UACH response header in web response (sets Accept-CH header in response).
 javascript_response (pipeline, request, max_age_seconds=CLIENT_SIDE_MAX_AGE_SECONDS)
 Process a request for the client-side JavaScript and answer with the JavaScript the pipeline's JavaScriptBuilder writes, with the cache headers the web integration specification sets.
 json_response (pipeline, request, max_age_seconds=CLIENT_SIDE_MAX_AGE_SECONDS)
 Process a request from the client-side JavaScript and answer with the JSON the pipeline's JSONBundler writes, with the same cache headers as javascript_response.
 _client_side_response (pipeline, request, content, content_type, max_age_seconds)
 _uses (pipeline, key)
 _opaque_tag (pipeline, evidence)
 _if_none_match_matches (if_none_match, opaque_tag)
 _entity_tags (value)
 _vary (pipeline, request)

Variables

int CLIENT_SIDE_MAX_AGE_SECONDS = 1800
str _CACHE_CONTROL_AFTER_ERRORS = "private, no-cache"
 _REVALIDATION_HEADERS
 _ENTITY_TAG = re.compile(r'(W/)?"([\x21\x23-\x7e\x80-\xff]*)"')
 _FIELD_NAME = re.compile(r"[!#$%&'*+.^_`|~0-9a-z-]+\Z")
str _OWS = " \t"

Function Documentation

◆ _client_side_response()

_client_side_response ( pipeline,
request,
content,
content_type,
max_age_seconds )
protected

◆ _entity_tags()

_entity_tags ( value)
protected

◆ _if_none_match_matches()

_if_none_match_matches ( if_none_match,
opaque_tag )
protected

◆ _opaque_tag()

_opaque_tag ( pipeline,
evidence )
protected

◆ _uses()

_uses ( pipeline,
key )
protected

◆ _vary()

_vary ( pipeline,
request )
protected

◆ javascript_response()

javascript_response ( pipeline,
request,
max_age_seconds = CLIENT_SIDE_MAX_AGE_SECONDS )

Process a request for the client-side JavaScript and answer with the JavaScript the pipeline's JavaScriptBuilder writes, with the cache headers the web integration specification sets.

The ETag is a weak entity tag, W/"...", hashed from the evidence the request supplied that the pipeline's elements accept. A GET or HEAD request whose If-None-Match header matches it, by the weak comparison of RFC 9110 section 13.1.2, gets a 304 without being processed, so a browser keeps a good copy while processing fails. A request by any other method whose If-None-Match matches, such as a POST to the JSON endpoint, gets 412 Precondition Failed. An If-None-Match that is neither "*" nor a list of entity tags matches nothing. Otherwise the response carries 'Cache-Control: max-age=1800, private', or the max age given, and the ETag, or 'Cache-Control: private, no-cache' and no ETag when processing recorded errors. Both carry a Vary header naming the headers the pipeline's elements accept, whether or not the request carried them.

@type pipeline: Pipeline

Parameters
pipelineA pipeline holding the JavaScriptBuilder @type request: Request
requestThe request for the JavaScript @type max_age_seconds: int
max_age_secondsHow long the browser may keep the response @rtype Response
Returns
The response to send

◆ json_response()

json_response ( pipeline,
request,
max_age_seconds = CLIENT_SIDE_MAX_AGE_SECONDS )

Process a request from the client-side JavaScript and answer with the JSON the pipeline's JSONBundler writes, with the same cache headers as javascript_response.

@type pipeline: Pipeline

Parameters
pipelineA pipeline holding the JSONBundler @type request: Request
requestThe request from the client-side JavaScript @type max_age_seconds: int
max_age_secondsHow long the browser may keep the response @rtype Response
Returns
The response to send

◆ request_line_path()

request_line_path ( request)

The path of the request line as the server received it, when the server says what that was, and otherwise the path Flask decoded.

◆ set_response_header()

set_response_header ( flowData,
response )

Set UACH response header in web response (sets Accept-CH header in response).

@type response: Response

Parameters
responseA Response object
response_header_dictDictionary containing response header key and values to be set @rtype response
Returns
A response object containing headers with non null values in response

◆ webevidence()

webevidence ( request)

Get evidence from a web request (gets headers, cookies, session values, query parameters and the fields of a posted form, and the request itself as server.http-request).

@type request: Request

Parameters
requestA Request object @rtype dict
Returns
A dictionary of web evidence that can be using in flowdata.evidence.add_from_dict()

Variable Documentation

◆ _CACHE_CONTROL_AFTER_ERRORS

str fiftyone_pipeline_core.web._CACHE_CONTROL_AFTER_ERRORS = "private, no-cache"
protected

◆ _ENTITY_TAG

fiftyone_pipeline_core.web._ENTITY_TAG = re.compile(r'(W/)?"([\x21\x23-\x7e\x80-\xff]*)"')
protected

◆ _FIELD_NAME

fiftyone_pipeline_core.web._FIELD_NAME = re.compile(r"[!#$%&'*+.^_`|~0-9a-z-]+\Z")
protected

◆ _OWS

str fiftyone_pipeline_core.web._OWS = " \t"
protected

◆ _REVALIDATION_HEADERS

fiftyone_pipeline_core.web._REVALIDATION_HEADERS
protected
Initial value:
= frozenset((
"cache-control", "if-match", "if-modified-since", "if-none-match",
"if-range", "if-unmodified-since", "pragma"))

◆ CLIENT_SIDE_MAX_AGE_SECONDS

int fiftyone_pipeline_core.web.CLIENT_SIDE_MAX_AGE_SECONDS = 1800