Skip to content

Commit b3fc4c7

Browse files
committed
update documentation and tests
1 parent 7017b41 commit b3fc4c7

File tree

12 files changed

+21
-88
lines changed

12 files changed

+21
-88
lines changed

docs/modules/trino/examples/usage-guide/opa-bundle-trino-cm-414.yaml

Lines changed: 0 additions & 22 deletions
This file was deleted.

docs/modules/trino/pages/usage-guide/security.adoc

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,24 +105,10 @@ NOTE: For a production setup you will use something much more granular.
105105
We provide a detailed set of rego rules in our integration tests.
106106
Details can be found below in the <<fine-granular-rego-rules, fine-granular rego rule>> section.
107107

108-
NOTE: Due to changes in the Trino OPA authorizer, rego rules differ between version 414 and newer versions.
109-
110-
[tabs]
111-
====
112-
414::
113-
+
114-
[source,yaml]
115-
----
116-
include::example$usage-guide/opa-bundle-trino-cm-414.yaml[]
117-
----
118-
119-
Newer than 414::
120-
+
121108
[source,yaml]
122109
----
123-
include::example$usage-guide/opa-bundle-trino-cm-new.yaml[]
110+
include::example$usage-guide/opa-bundle-trino-cm.yaml[]
124111
----
125-
====
126112

127113
Reference the package in the Trino cluster:
128114

docs/modules/trino/partials/supported-versions.adoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
// This is a separate file, since it is used by both the direct Trino documentation, and the overarching
33
// Stackable Platform documentation.
44

5+
- 455
56
- 451 (LTS)
6-
- 442 (deprecated)
7-
- 414 (deprecated)

examples/simple-trino-cluster-authentication-opa-authorization-s3.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,22 @@ data:
6666
trino.rego: |
6767
package trino
6868
69-
import future.keywords.in
69+
import rego.v1
7070
7171
default allow = false
7272
7373
# Allow non-batched access
74-
allow {
74+
allow_if {
7575
is_admin
7676
}
7777
# Allow batched access
78-
extended[i] {
78+
batch contains i if {
7979
some i
8080
input.action.filterResources[i]
8181
is_admin
8282
}
8383
# Corner case: filtering columns is done with a single table item, and many columns inside
84-
extended[i] {
84+
batch contains i if {
8585
some i
8686
input.action.operation == "FilterColumns"
8787
count(input.action.filterResources) == 1
@@ -90,22 +90,22 @@ data:
9090
}
9191
9292
# Special rules for bob
93-
allow {
93+
allow if {
9494
input.action.operation in ["ExecuteQuery", "AccessCatalog"]
9595
is_bob
9696
}
97-
extended[i] {
97+
batch contains i if {
9898
input.action.operation in ["FilterCatalogs"]
9999
some i
100100
input.action.filterResources[i]
101101
is_bob
102102
}
103103
104-
is_admin() {
104+
is_admin() if {
105105
input.context.identity.user == "admin"
106106
}
107107
108-
is_bob() {
108+
is_bob() if {
109109
input.context.identity.user == "bob"
110110
}
111111
---

rust/operator-binary/src/authorization/opa.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl TrinoOpaConfig {
5151
.full_document_url_from_config_map(
5252
client,
5353
trino,
54-
// Sticking to https://github.com/trinodb/trino/blob/442/plugin/trino-opa/src/test/java/io/trino/plugin/opa/TestOpaAccessControlDataFilteringSystem.java#L44
54+
// Sticking to https://github.com/trinodb/trino/blob/455/plugin/trino-opa/src/test/java/io/trino/plugin/opa/TestOpaAccessControlDataFilteringSystem.java#L46
5555
Some("rowFilters"),
5656
OpaApiVersion::V1,
5757
)
@@ -60,7 +60,7 @@ impl TrinoOpaConfig {
6060
.full_document_url_from_config_map(
6161
client,
6262
trino,
63-
// Sticking to https://github.com/trinodb/trino/blob/442/plugin/trino-opa/src/test/java/io/trino/plugin/opa/TestOpaAccessControlDataFilteringSystem.java#L45
63+
// Sticking to https://github.com/trinodb/trino/blob/455/plugin/trino-opa/src/test/java/io/trino/plugin/opa/TestOpaAccessControlDataFilteringSystem.java#L47
6464
Some("columnMask"),
6565
OpaApiVersion::V1,
6666
)

rust/operator-binary/src/config/jvm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// As of 2024-07-05 we support multiple Trino versions. Some using Java 17, some Java 21 and the latest (451) uses Java 22.
1+
// As of 2024-07-05 we support multiple Trino versions. Some using Java 17, some Java 21 and the latest (455) uses Java 22.
22
// This requires a different JVM config
33
use indoc::formatdoc;
44
use snafu::{OptionExt, ResultExt, Snafu};

rust/operator-binary/src/controller.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,7 +1636,7 @@ mod tests {
16361636
name: trino
16371637
spec:
16381638
image:
1639-
productVersion: "451"
1639+
productVersion: "455"
16401640
clusterConfig:
16411641
catalogLabelSelector:
16421642
matchLabels:
@@ -1662,7 +1662,7 @@ mod tests {
16621662

16631663
let validated_config = validated_product_config(
16641664
&trino,
1665-
"451.0.0",
1665+
"455.0.0",
16661666
&ProductConfigManager::from_yaml_file("../../deploy/config-spec/properties.yaml")
16671667
.unwrap(),
16681668
)

tests/templates/kuttl/opa-authorization/trino_rules/requested_permissions_test.rego

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ testcontext := {
285285
"groups": ["testgroup1", "testgroup2"],
286286
"user": "testuser",
287287
},
288-
"softwareStack": {"trinoVersion": "451"},
288+
"softwareStack": {"trinoVersion": "455"},
289289
}
290290

291291
test_access_filter_catalog if {

tests/templates/kuttl/opa-authorization/trino_rules/verification.rego

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import rego.v1
4343
# "groups": ["group1", ...],
4444
# "user": "username",
4545
# },
46-
# "softwareStack": {"trinoVersion": "451"},
46+
# "softwareStack": {"trinoVersion": "455"},
4747
# }
4848
# }
4949
#
@@ -193,7 +193,7 @@ allow if {
193193
# "groups": ["group1", ...],
194194
# "user": "username",
195195
# },
196-
# "softwareStack": {"trinoVersion": "451"},
196+
# "softwareStack": {"trinoVersion": "455"},
197197
# }
198198
# }
199199
#
@@ -254,7 +254,7 @@ batch contains index if {
254254
# "groups": ["group1", ...],
255255
# "user": "username",
256256
# },
257-
# "softwareStack": {"trinoVersion": "451"},
257+
# "softwareStack": {"trinoVersion": "455"},
258258
# }
259259
# }
260260
#
@@ -319,7 +319,7 @@ columnMask := column_mask if {
319319
# "groups": ["group1", ...],
320320
# "user": "username",
321321
# },
322-
# "softwareStack": {"trinoVersion": "451"},
322+
# "softwareStack": {"trinoVersion": "455"},
323323
# }
324324
# }
325325
#

0 commit comments

Comments
 (0)