-
Notifications
You must be signed in to change notification settings - Fork 12
/
Cargo.toml
152 lines (135 loc) · 4.26 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
[package]
name = "opa-wasm"
version = "0.1.1"
description = "A crate to use OPA policies compiled to WASM."
repository = "https://github.com/matrix-org/rust-opa-wasm"
rust-version = "1.76"
authors = ["Quentin Gliech <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
default-run = "opa-eval"
[dependencies]
anyhow = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1.0.18" # This is the earliest version which supports 128-bit integers
thiserror = "1"
tokio = { version = "1.5", features = ["sync", "macros"] }
tracing = "0.1.27"
wasmtime = { version = ">=22, <24", default-features = false, features = [
"async",
] }
# Loader
tokio-tar = { version = "0.3", optional = true }
async-compression = { version = "0.4", optional = true, features = [
"tokio",
"gzip",
] }
futures-util = { version = "0.3", optional = true }
# CLI
camino = { version = "1", optional = true }
clap = { version = "4", features = ["derive"], optional = true }
tracing-forest = { version = "0.1.4", optional = true }
tracing-subscriber = { version = "0.3", features = [
"env-filter",
], optional = true }
# Builtins
base64 = { version = "0.22", optional = true }
digest = { version = "0.10", optional = true }
hex = { version = "0.4", optional = true }
hmac = { version = "0.12", optional = true }
json-patch = { version = ">=0.2.3, <2.1.0", optional = true, default-features = false }
md-5 = { version = "0.10", optional = true }
rand = { version = "0.8", optional = true }
semver = { version = "1", optional = true }
sha1 = { version = "0.10", optional = true }
sha2 = { version = "0.10", optional = true }
sprintf = { version = "0.3", optional = true }
parse-size = { version = "1", features = ["std"], optional = true }
serde_yaml = { version = "0.9.1", optional = true }
form_urlencoded = { version = "1", optional = true }
urlencoding = { version = "2", optional = true }
chrono = { version = "0.4.31", optional = true, default-features = false, features = [
"std",
"clock",
] }
chrono-tz = { version = ">=0.6, <0.10.0", optional = true }
chronoutil = { version = "0.2", optional = true }
duration-str = { version = "0.11", optional = true, default-features = false }
[dev-dependencies.tokio]
version = "1.5"
features = ["macros", "fs", "rt", "rt-multi-thread"]
[dev-dependencies]
wasmtime = { version = ">=22, <24", default-features = false, features = [
"cranelift",
] }
insta = { version = "1", features = ["yaml"] }
[build-dependencies]
# We would like at least this version of rayon, because older versions depend on old rand,
# which depends on old log, which depends on old libc, which doesn't build with newer rustc
rayon = "^1.6"
[features]
default = ["all-builtins", "fast"]
loader = [
"dep:tokio-tar",
"dep:async-compression",
"dep:futures-util",
"tokio/fs",
"tokio/io-util",
]
cli = [
"loader",
"fast",
"dep:camino",
"dep:clap",
"dep:tracing-forest",
"dep:tracing-subscriber",
"tokio/fs",
"tokio/rt-multi-thread",
]
fast = ["wasmtime/cranelift", "wasmtime/parallel-compilation"]
rng = ["dep:rand"]
time = ["dep:chrono"]
base64url-builtins = ["dep:base64", "dep:hex"]
crypto-digest-builtins = ["dep:digest", "dep:hex"]
crypto-hmac-builtins = ["dep:hmac", "dep:hex"]
crypto-md5-builtins = ["dep:md-5"]
crypto-sha1-builtins = ["dep:sha1"]
crypto-sha2-builtins = ["dep:sha2"]
hex-builtins = ["dep:hex"]
semver-builtins = ["dep:semver"]
sprintf-builtins = ["dep:sprintf"]
json-builtins = ["dep:json-patch"]
units-builtins = ["dep:parse-size"]
rand-builtins = ["rng"]
yaml-builtins = ["dep:serde_yaml"]
urlquery-builtins = ["dep:form_urlencoded", "dep:urlencoding"]
time-builtins = ["time", "dep:chrono-tz", "dep:duration-str", "dep:chronoutil"]
all-crypto-builtins = [
"crypto-digest-builtins",
"crypto-hmac-builtins",
"crypto-md5-builtins",
"crypto-sha1-builtins",
"crypto-sha2-builtins",
]
all-builtins = [
"all-crypto-builtins",
"base64url-builtins",
"hex-builtins",
"json-builtins",
"rand-builtins",
"semver-builtins",
"sprintf-builtins",
"units-builtins",
"yaml-builtins",
"urlquery-builtins",
"time-builtins",
]
[[test]]
name = "smoke_test"
required-features = ["loader"]
[[bin]]
name = "opa-eval"
required-features = ["cli"]
[[bin]]
name = "simple"
required-features = ["cli"]