bare-script 5.1.16__tar.gz → 5.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bare_script-5.1.16/src/bare_script.egg-info → bare_script-5.2.0}/PKG-INFO +1 -1
- {bare_script-5.1.16 → bare_script-5.2.0}/pyproject.toml +1 -1
- {bare_script-5.1.16 → bare_script-5.2.0}/src/bare_script/include.py +86 -0
- {bare_script-5.1.16 → bare_script-5.2.0}/src/bare_script/include_source.py +362 -182
- {bare_script-5.1.16 → bare_script-5.2.0}/src/bare_script/library.py +32 -1
- {bare_script-5.1.16 → bare_script-5.2.0}/src/bare_script/options.py +32 -12
- {bare_script-5.1.16 → bare_script-5.2.0}/src/bare_script/runtime_c.c +6 -1
- bare_script-5.2.0/src/bare_script/wsgi.py +252 -0
- {bare_script-5.1.16 → bare_script-5.2.0/src/bare_script.egg-info}/PKG-INFO +1 -1
- {bare_script-5.1.16 → bare_script-5.2.0}/src/bare_script.egg-info/SOURCES.txt +1 -0
- {bare_script-5.1.16 → bare_script-5.2.0}/LICENSE +0 -0
- {bare_script-5.1.16 → bare_script-5.2.0}/README.md +0 -0
- {bare_script-5.1.16 → bare_script-5.2.0}/setup.cfg +0 -0
- {bare_script-5.1.16 → bare_script-5.2.0}/setup.py +0 -0
- {bare_script-5.1.16 → bare_script-5.2.0}/src/bare_script/__init__.py +0 -0
- {bare_script-5.1.16 → bare_script-5.2.0}/src/bare_script/__main__.py +0 -0
- {bare_script-5.1.16 → bare_script-5.2.0}/src/bare_script/bare.py +0 -0
- {bare_script-5.1.16 → bare_script-5.2.0}/src/bare_script/runtime.py +0 -0
- {bare_script-5.1.16 → bare_script-5.2.0}/src/bare_script/value.py +0 -0
- {bare_script-5.1.16 → bare_script-5.2.0}/src/bare_script.egg-info/dependency_links.txt +0 -0
- {bare_script-5.1.16 → bare_script-5.2.0}/src/bare_script.egg-info/entry_points.txt +0 -0
- {bare_script-5.1.16 → bare_script-5.2.0}/src/bare_script.egg-info/requires.txt +0 -0
- {bare_script-5.1.16 → bare_script-5.2.0}/src/bare_script.egg-info/top_level.txt +0 -0
|
@@ -14,6 +14,7 @@ execute_script(
|
|
|
14
14
|
{
|
|
15
15
|
'statements': [
|
|
16
16
|
{'include': {'includes': [
|
|
17
|
+
{'url': 'barescriptLint.bare', 'system': True},
|
|
17
18
|
{'url': 'barescriptModel.bare', 'system': True},
|
|
18
19
|
{'url': 'base64.bare', 'system': True},
|
|
19
20
|
{'url': 'data.bare', 'system': True},
|
|
@@ -21,6 +22,7 @@ execute_script(
|
|
|
21
22
|
{'url': 'dataTable.bare', 'system': True},
|
|
22
23
|
{'url': 'elementModel.bare', 'system': True},
|
|
23
24
|
{'url': 'gzip.bare', 'system': True},
|
|
25
|
+
{'url': 'hash.bare', 'system': True},
|
|
24
26
|
{'url': 'markdown.bare', 'system': True},
|
|
25
27
|
{'url': 'markdownElements.bare', 'system': True},
|
|
26
28
|
{'url': 'markdownParser.bare', 'system': True},
|
|
@@ -66,6 +68,28 @@ def _include_options():
|
|
|
66
68
|
return {'globals': _INCLUDE_GLOBALS}
|
|
67
69
|
|
|
68
70
|
|
|
71
|
+
#
|
|
72
|
+
# barescriptLint.bare
|
|
73
|
+
#
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def barescript_lint_unbound_globals(model, globals_=None):
|
|
77
|
+
"""
|
|
78
|
+
Compute the unbound global variables of a BareScript script or expression model - the global
|
|
79
|
+
variables and functions it uses that it does not define
|
|
80
|
+
|
|
81
|
+
:param model: The `BareScript model <https://craigahobbs.github.io/bare-script/model/#var.vName='BareScript'>`__ or
|
|
82
|
+
`expression model <https://craigahobbs.github.io/bare-script/model/#var.vName='Expression'>`__
|
|
83
|
+
:type model: dict
|
|
84
|
+
:param globals_: The bound global variables dict (name to value), such as the host's built-in functions
|
|
85
|
+
:type globals_: dict or None
|
|
86
|
+
:return: The sorted list of unbound global variable names
|
|
87
|
+
:rtype: list[str]
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
return _INCLUDE_GLOBALS['barescriptLintUnboundGlobals']([model, globals_], _include_options())
|
|
91
|
+
|
|
92
|
+
|
|
69
93
|
#
|
|
70
94
|
# barescriptModel.bare
|
|
71
95
|
#
|
|
@@ -448,6 +472,68 @@ def gzip_uncompress(bytes_):
|
|
|
448
472
|
return _INCLUDE_GLOBALS['gzipUncompress']([bytes_], _include_options())
|
|
449
473
|
|
|
450
474
|
|
|
475
|
+
#
|
|
476
|
+
# hash.bare
|
|
477
|
+
#
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
def hash_equal(left, right):
|
|
481
|
+
"""
|
|
482
|
+
Compare two values (e.g. message authentication codes) in constant time - every byte is compared, so the time
|
|
483
|
+
taken doesn't reveal how much of a guessed value is right
|
|
484
|
+
|
|
485
|
+
:param left: The first byte value array or string
|
|
486
|
+
:type left: list(int) or str
|
|
487
|
+
:param right: The second byte value array or string
|
|
488
|
+
:type right: list(int) or str
|
|
489
|
+
:return: True if the values are equal, False if not, or None if an argument is invalid
|
|
490
|
+
:rtype: bool or None
|
|
491
|
+
"""
|
|
492
|
+
|
|
493
|
+
return _INCLUDE_GLOBALS['hashEqual']([left, right], _include_options())
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
def hash_hex(bytes_):
|
|
497
|
+
"""
|
|
498
|
+
Format a byte value array (e.g. a hash) as a lowercase hexadecimal string
|
|
499
|
+
|
|
500
|
+
:param bytes_: The byte value array or string
|
|
501
|
+
:type bytes_: list(int) or str
|
|
502
|
+
:return: The hexadecimal string, or None if the argument is invalid
|
|
503
|
+
:rtype: str or None
|
|
504
|
+
"""
|
|
505
|
+
|
|
506
|
+
return _INCLUDE_GLOBALS['hashHex']([bytes_], _include_options())
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
def hash_hmac_sha256(key, message):
|
|
510
|
+
"""
|
|
511
|
+
Compute the HMAC-SHA256 message authentication code of a message (e.g. a JWT HS256 signature)
|
|
512
|
+
|
|
513
|
+
:param key: The key byte value array or string
|
|
514
|
+
:type key: list(int) or str
|
|
515
|
+
:param message: The message byte value array or string
|
|
516
|
+
:type message: list(int) or str
|
|
517
|
+
:return: The 32-byte message authentication code byte value array, or None if an argument is invalid
|
|
518
|
+
:rtype: list(int) or None
|
|
519
|
+
"""
|
|
520
|
+
|
|
521
|
+
return _INCLUDE_GLOBALS['hashHMACSHA256']([key, message], _include_options())
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
def hash_sha256(bytes_):
|
|
525
|
+
"""
|
|
526
|
+
Compute the SHA-256 hash of a byte value array (or a string, as UTF-8)
|
|
527
|
+
|
|
528
|
+
:param bytes_: The byte value array (integers 0 to 255) or string
|
|
529
|
+
:type bytes_: list(int) or str
|
|
530
|
+
:return: The 32-byte hash byte value array, or None if the argument is invalid
|
|
531
|
+
:rtype: list(int) or None
|
|
532
|
+
"""
|
|
533
|
+
|
|
534
|
+
return _INCLUDE_GLOBALS['hashSHA256']([bytes_], _include_options())
|
|
535
|
+
|
|
536
|
+
|
|
451
537
|
#
|
|
452
538
|
# markdown.bare
|
|
453
539
|
#
|