mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
Implement json.marshal_with_options builtin closes #215, closes #218 Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
26 KiB
26 KiB
Built-in Functions
This page lists all the supported Rego built-in functions and the cargo feature that is needed to enable each builtin.
Those builtins that are not need for a specific use of the Regorus crate can be excluded from the binary by not specifying the corresponding feature. This is useful in Confidential Computing scenarios where
- There needs to be control over what a policy execution can and cannot do.
- There needs to be control over exactly what goes into the Trusted Computing Base.
Currently many builtins are baked-in, i.e. there is no way to exclude them from the TCB.
In future, each builtin will be associated with a feature (many builtins could be associated with the same feature).
-
Builtin Feature x == y _ x > y _ x >= y _ x < y _ x <= y _ x != y _ -
Builtin Feature abs _ ceil _ x / y _ floor _ x - y _ x * y _ numbers.range _ numbers.range_step _ x + y _ rand.intn _ x % y _ round _ -
Builtin Feature count _ max _ min _ product _ sort _ sum _ -
Builtin Feature array.concat _ array.reverse _ array.slice _ -
Builtin Feature x & y _ intersection _ x - y _ x | y _ union _ -
Builtin Feature json.filter _ json.match_schema jsonschemajson.remove _ json.verify_schema jsonschemaobject.filter _ object.get _ object.keys _ object.remove _ object.subset _ object.union _ object.union_n _ -
Builtin Feature concat _ contains _ endswith _ format_int _ indexof _ indexof_n _ lower _ replace _ split _ sprintf _ startswith _ strings.any_prefix_match _ strings.any_suffix_match _ strings.render_template _ strings.replace_n _ strings.reverse _ substring _ trim _ trim_left _ trim_prefix _ trim_right _ trim_space _ trim_suffix _ upper _ -
Builtin Feature regex.find_all_string_submatch_n regexregex.find_n regexregex.globs_match regexregex.is_valid regexregex.match regexregex.replace regexregex.split regexregex.template_match regex -
Builtin Feature glob.match globglob.quote_meta glob -
Builtin Feature bits.and _ bits.lsh _ bits.negate _ bits.or _ bits.rsh _ bits.xor _ -
Builtin Feature to_number _ -
Builtin Feature units.parse _ units.parse_bytes _ -
Builtin Feature is_array _ is_boolean _ is_null _ is_number _ is_object _ is_set _ is_string _ type_name _ -
Builtin Feature base64.is_valid base64base64url.decode base64base64url.encode base64urlbase64url.encode_no_pad base64urlhex.decode hexhex.encode hexjson.is_valid _ json.marshal _ json.marshal_with_options _ json.unmarshal _ urlquery.decode urlqueryurlquery.decode_object urlqueryurlquery.encode urlqueryurlquery.encode_object urlqueryyaml.is_valid yamlyaml.marshal yamlyaml.unmarshal yaml -
Builtin Feature (time.add_date timetime.add_date timetime.clock timetime.date timetime.diff timetime.format timetime.now_ns timetime.parse_duration_ns timetime.parse_ns timetime.parse_rfc3339_ns timetime.weekday time -
Builtin Feature crypto.hmac.equal cryptocrypto.hmac.md5 cryptocrypto.hmac.sha1 cryptocrypto.hmac.sha256 cryptocrypto.hmac.sha512 cryptocrypto.md5 cryptocrypto.sha1 cryptocrypto.sha256 crypto -
Builtin Feature graph.reachable graphwalk graph -
Builtin Feature uuid.parse uuiduuid.rfc4122 uuid -
Builtin Feature semver.compare semversemver.is_valid semver -
[OPA](https://www.openpolicyagent.org/docs/latest/policy-reference/#opa
Builtin Feature opa.runtime _ -
Builtin Feature print(...) _ -
Builtin Feature trace _