mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
Implement most of the builtin time module (#82)
* Implement builtin `time.add_date` method * Implement builtin `time.clock` method * Implement builtin `time.date` method * Implement builtin `time.diff` method * Implement builtin `time.format` method * Migrate `time.now_ns` to `chrono` * Implement builtin `time.parse_ns` method * Implement builtin `time.parse_rfc3339_ns` method * Implement builtin `time.weekday` method * Add conditional `test` module for OPA tests * Cache result of `time.now_ns` * Fail in strict mode if timestamp is outside of range * Add `ensure_i32` util * Move `diff_between_datetimes` into its own file and include appropriate license
This commit is contained in:
+22
-1
@@ -20,8 +20,27 @@ regex = ["dep:regex"]
|
||||
semver = ["dep:semver"]
|
||||
uuid = ["dep:uuid"]
|
||||
urlquery = ["dep:url"]
|
||||
time = ["dep:chrono", "dep:chrono-tz"]
|
||||
yaml = ["serde_yaml"]
|
||||
full-opa = ["base64", "base64url", "crypto", "deprecated", "glob", "graph", "hex", "jsonschema", "regex", "semver", "uuid", "urlquery", "yaml"]
|
||||
full-opa = [
|
||||
"base64",
|
||||
"base64url",
|
||||
"crypto",
|
||||
"deprecated",
|
||||
"glob",
|
||||
"graph",
|
||||
"hex",
|
||||
"jsonschema",
|
||||
"regex",
|
||||
"semver",
|
||||
"uuid",
|
||||
"urlquery",
|
||||
"time",
|
||||
"yaml"
|
||||
]
|
||||
|
||||
# This feature enables some testing utils for OPA tests.
|
||||
opa-testutil = []
|
||||
|
||||
[dependencies]
|
||||
anyhow = {version = "1.0.66", features = ["backtrace"] }
|
||||
@@ -51,6 +70,8 @@ wax = { version = "0.6.0", features = [], default-features = false, optional = t
|
||||
url = { version = "2.5.0", optional = true }
|
||||
uuid = { version = "1.6.1", features = ["v4", "fast-rng"], optional = true }
|
||||
jsonschema = { version = "0.17.1", default-features = false, optional = true }
|
||||
chrono = { version = "0.4.31", optional = true }
|
||||
chrono-tz = { version = "0.8.5", optional = true }
|
||||
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
Reference in New Issue
Block a user