Skip to content

Commit aaba0e4

Browse files
author
Felix Hennig
committed
Docs: Rewrote sections to reference new LDAP tutorial (#365)
# Description this: stackabletech/documentation#339 should be merged first (ideally) - removed integration test reference and referenced tutorial instead. - removed code specifics in favor of lean snippets Note: the two references to the `home` (main) component will not work until we release the current nightly docs as the new latest version.
1 parent eb33859 commit aaba0e4

4 files changed

Lines changed: 54 additions & 83 deletions

File tree

docs/modules/usage_guide/examples/code/trino-file-authentication.yaml renamed to docs/modules/usage_guide/examples/code/trino-file-auth-snippet.yaml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
# yamllint disable-file
12
---
3+
# tag::secret[]
24
apiVersion: v1
35
kind: Secret
46
metadata:
@@ -8,26 +10,19 @@ stringData:
810
admin: $2y$10$89xReovvDLacVzRGpjOyAOONnayOgDAyIS2nW9bs5DJT98q17Dy5i
911
alice: $2y$10$HcCa4k9v2DRrD/g7e5vEz.Bk.1xg00YTEHOZjPX7oK3KqMSt2xT8W
1012
bob: $2y$10$xVRXtYZnYuQu66SmruijPO8WHFM/UK5QPHTr.Nzf4JMcZSqt3W.2.
13+
# end::secret[]
1114
---
15+
# tag::trino[]
1216
apiVersion: trino.stackable.tech/v1alpha1
1317
kind: TrinoCluster
1418
metadata:
1519
name: simple-trino
1620
spec:
17-
image:
18-
productVersion: 396
19-
stackableVersion: 0.3.0
20-
catalogLabelSelector: {}
21+
...
2122
authentication:
2223
method:
2324
multiUser:
2425
userCredentialsSecret:
2526
name: simple-trino-users-secret
26-
coordinators:
27-
roleGroups:
28-
default:
29-
replicas: 1
30-
workers:
31-
roleGroups:
32-
default:
33-
replicas: 1
27+
...
28+
# end::trino[]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# yamllint disable-file
2+
---
3+
# tag::trino[]
4+
apiVersion: trino.stackable.tech/v1alpha1
5+
kind: TrinoCluster
6+
metadata:
7+
name: trino-with-ldap
8+
spec:
9+
...
10+
authentication:
11+
method:
12+
ldap:
13+
authenticationClass: my-ldap
14+
...
15+
# end::trino[]
16+
---
17+
# tag::authclass[]
18+
apiVersion: authentication.stackable.tech/v1alpha1
19+
kind: AuthenticationClass
20+
metadata:
21+
name: my-ldap
22+
...
23+
# end::authclass[]

docs/modules/usage_guide/examples/code/trino-ldap-authentication.yaml

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

docs/modules/usage_guide/pages/security.adoc

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
= Security
22

3+
This page covers <<Authentication>> and <<Authorization>>.
4+
35
== Authentication
46

57
Trino supports several https://trino.io/docs/current/security/authentication-types.html[authentication types].
@@ -10,35 +12,46 @@ The Trino operator currently supports the following `PASSWORD` authenticators.
1012

1113
==== Password file
1214

13-
The https://trino.io/docs/current/security/password-file.html[file based authentication] can be defined as follows:
15+
The https://trino.io/docs/current/security/password-file.html[file based authentication] can be defined as follows. First create a secret with your users:
1416

1517
[source,yaml]
1618
----
17-
include::example$code/trino-file-authentication.yaml[]
19+
include::example$code/trino-file-auth-snippet.yaml[tag=secret]
1820
----
1921

20-
The `simple-trino-users-secret` points to a manually created secret. This contains username and password pairs as shown in the previous snippet.
21-
22-
The username and password combinations are provided in the `stringData` field. The hashes are created using bcrypt with 10 rounds.
22+
This contains username and password pairs as shown in the previous snippet. The username and password combinations are provided in the `stringData` field. The hashes are created using bcrypt with 10 rounds:
2323

2424
[source]
2525
----
2626
htpasswd -nbBC 10 admin admin
2727
----
2828

29-
==== LDAP
29+
Then reference the secret in your TrinoCluster definition:
30+
31+
[source,yaml]
32+
----
33+
include::example$code/trino-file-auth-snippet.yaml[tag=trino]
34+
----
35+
36+
=== LDAP
3037

31-
The Trino operator supports https://trino.io/docs/current/security/ldap.html[LDAP authentication] as well. The following snippet shows how to configure `PASSWORD` authentication using LDAP:
38+
The Trino operator supports https://trino.io/docs/current/security/ldap.html[LDAP authentication] as well and authentication in Stackable is done using xref:home:concepts:authentication.adoc#authenticationclass[AuthenticationClasses]:
3239

3340
[source,yaml]
3441
----
35-
include::example$code/trino-ldap-authentication.yaml[]
42+
include::example$code/trino-ldap-auth-snippet.yaml[tag=authclass]
3643
----
3744

38-
With this configuration, Trino will authenticate via `ldaps://openldap.default.svc.cluster.local:1636`.
39-
The UI or Trino CLI need to authenticate with the user `integrationtest` and password `integrationtest`.
45+
NOTE: You can follow the xref:home:tutorials:authentication_with_openldap.adoc[] tutorial to learn how to create an AuthenticationClass for an LDAP server.
46+
47+
With an AuthenticationClass ready, `PASSWORD` authentication using LDAP is done by referincing the LDAP AuthenticationClass:
48+
49+
[source,yaml]
50+
----
51+
include::example$code/trino-ldap-auth-snippet.yaml[tag=trino]
52+
----
4053

41-
Please have a look at the LDAP https://github.com/stackabletech/trino-operator/tree/main/tests/templates/kuttl/ldap[integration tests] for testing, setting up OpenLDAP and creating the integrationtest user.
54+
In the Trino CLI and web interface, LDAP users can now be used to log in.
4255

4356
== Authorization
4457

0 commit comments

Comments
 (0)