51Degrees Pipeline for Python

tests.test_javascriptbuilder_object_name Namespace Reference

Detailed Description

The client side object's name can be set in the builder's settings
(obj_name) or per request (query.fod-js-object-name). The name is written
into the script as a variable name, a session storage key and a property
name, so these tests check that a different name works, and that a name
which is not a JavaScript identifier is never written into the script.

The script is checked with "node --check" and run in Node with a minimal
stand in for a browser (object_name_harness.js). Both need Node on the path,
which every GitHub hosted runner has.

Classes

class  JavaScriptBuilderObjectNameTests
class  JavaScriptBuilderObjectNameSettingTests

Functions

 _render (settings=None, evidence=None, logger=None)
 _write (script)
 _node (*args)
 _declared_names (script)

Variables

list REFUSED_NAMES
list ALLOWED_NAMES
 NODE = shutil.which("node")
 HARNESS = os.path.join(os.path.dirname(__file__), "object_name_harness.js")

Function Documentation

◆ _declared_names()

_declared_names ( script)
protected

◆ _node()

_node ( * args)
protected

◆ _render()

_render ( settings = None,
evidence = None,
logger = None )
protected
Render the script for one request and return it.

◆ _write()

_write ( script)
protected

Variable Documentation

◆ ALLOWED_NAMES

list tests.test_javascriptbuilder_object_name.ALLOWED_NAMES
Initial value:
= [
"self", "frames", "parent", "opener", "length", "windows", "Window",
"cachesX"]

◆ HARNESS

tests.test_javascriptbuilder_object_name.HARNESS = os.path.join(os.path.dirname(__file__), "object_name_harness.js")

◆ NODE

tests.test_javascriptbuilder_object_name.NODE = shutil.which("node")

◆ REFUSED_NAMES

list tests.test_javascriptbuilder_object_name.REFUSED_NAMES
Initial value:
= [
"eval", "arguments", "window", "document", "top", "name", "status",
"history", "navigator", "closed", "location", "frameElement",
"isSecureContext", "crossOriginIsolated", "trustedTypes", "crypto",
"indexedDB", "localStorage", "sessionStorage", "caches", "cookieStore",
"speechSynthesis", "styleMedia", "crashReport", "credentialless",
"customElements", "documentPictureInPicture", "fence", "launchQueue",
"originAgentCluster"]