Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
3c782e7
WIP Add OIDC config to CRD
labrenbe Apr 26, 2024
08113ed
Merge remote-tracking branch 'origin/main' into feat/oidc-support
labrenbe May 10, 2024
ea145f5
replaced first sed instance
Jun 3, 2024
1e144d1
removed second instance of sed - still needs testing
Jun 3, 2024
57db6db
Merge remote-tracking branch 'origin/main' into feat/oidc-support
labrenbe Jun 4, 2024
b75aed0
ldap test worked
Jun 4, 2024
06852b4
remove outdated comment
Jun 4, 2024
81a9e26
wip
labrenbe Jun 5, 2024
adc870f
simplify and add "
Jun 6, 2024
3435367
make ldap admin password more complicated
Jun 6, 2024
817959b
Merge remote-tracking branch 'origin/main' into feat/oidc-support
labrenbe Jun 6, 2024
9144aa2
use the feature to load secret directly from file
Jun 6, 2024
6f8f241
Load S3 keys from file instead of from env
Jun 6, 2024
c237be1
wip: refactor crd::authentication
labrenbe Jun 7, 2024
5dfc9da
wip
labrenbe Jun 10, 2024
66f45c8
Merge remote-tracking branch 'origin/219-replace-sed-with-env-feature…
labrenbe Jun 10, 2024
613d504
wip
labrenbe Jun 10, 2024
533ecb1
wip: can be compiled
labrenbe Jun 11, 2024
796a546
wip: debugging
labrenbe Jun 12, 2024
d542af5
wip: fix env issue
labrenbe Jun 12, 2024
e9c2fea
some bugfixes
labrenbe Jun 13, 2024
f8b5632
fix test definition format
labrenbe Jun 13, 2024
eb9e7da
wip: oidc over tls
labrenbe Jun 13, 2024
4936b5d
fix oidc with tls
labrenbe Jun 14, 2024
c559918
run cargo fmt
labrenbe Jun 14, 2024
5841dbf
fix clippy feedback
labrenbe Jun 14, 2024
c35dca6
fix clippy feedback
labrenbe Jun 14, 2024
5cd2763
fix integration test
labrenbe Jun 14, 2024
52b387a
Merge remote-tracking branch 'origin/main' into feat/oidc-support
labrenbe Jun 14, 2024
13598f8
add documentation on OIDC
labrenbe Jun 14, 2024
cb34c83
add to changelog
labrenbe Jun 14, 2024
dca2618
fix typo in docs
labrenbe Jun 14, 2024
b058b6e
refactor authentication to use a similar approach to superset operator
labrenbe Jun 24, 2024
0598d4d
Merge remote-tracking branch 'origin/main' into feat/oidc-support
labrenbe Jun 24, 2024
6ad39ad
Merge remote-tracking branch 'origin/main' into feat/oidc-support
labrenbe Jun 24, 2024
7d7a2d1
address clippy feedback
labrenbe Jun 24, 2024
53cf335
address clippy feedback
labrenbe Jun 24, 2024
f7e7b06
Merge remote-tracking branch 'origin/main' into feat/oidc-support
labrenbe Jul 11, 2024
3f1cfc1
fix a bug where no auth class was not allowed
labrenbe Jul 11, 2024
cdbc5ea
Merge remote-tracking branch 'origin/main' into feat/oidc-support
labrenbe Jul 11, 2024
8019de4
remove unused code
labrenbe Jul 11, 2024
ae04b51
remove needless returns
labrenbe Jul 11, 2024
b547d59
run cargo fmt
labrenbe Jul 11, 2024
27090b2
fix bugs related to tls authentication
labrenbe Jul 12, 2024
4428775
Merge remote-tracking branch 'origin/main' into feat/oidc-support
labrenbe Jul 12, 2024
59491d3
run cargo fmt
labrenbe Jul 12, 2024
098e2bc
fix an issue related to internal password
labrenbe Jul 15, 2024
ede5e6d
fix oidc test
labrenbe Jul 15, 2024
f9b7c60
Merge remote-tracking branch 'origin/main' into feat/oidc-support
labrenbe Jul 16, 2024
746aa7f
address feedback from code review
labrenbe Jul 16, 2024
e7d5b49
add documentation to new functions
labrenbe Jul 16, 2024
b1662b6
run cargo fmt
labrenbe Jul 16, 2024
23a0db1
fix formatting
labrenbe Jul 16, 2024
81d75ff
fix comment formatting
labrenbe Jul 16, 2024
fca346a
document why OIDC is not configured on middlemanagers
labrenbe Jul 16, 2024
724ac76
add support for oidc scopes and remove prefixes from auth config
labrenbe Jul 17, 2024
7c372bd
remove unnecessary formatting
labrenbe Jul 17, 2024
627da35
Merge remote-tracking branch 'origin/main' into feat/oidc-support
labrenbe Jul 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'stackable-druid-operator'",
"cargo": {
"args": [
"build",
"--bin=stackable-druid-operator",
"--package=stackable-druid-operator"
],
"filter": {
"name": "stackable-druid-operator",
"kind": "bin"
}
},
"args": ["run"],
"cwd": "${workspaceFolder}"
}
]
}
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ All notable changes to this project will be documented in this file.
### Added

- Add support for specifying additional extensions to load ([#547], [#563]).
- Add support for OIDC as authentication method ([#573]).

### Changed

- Bump `stackable-operator` from `0.64.0` to `0.70.0` ([#585]).
- Bump `product-config` from `0.6.0` to `0.7.0` ([#585]).
- Bump other dependencies ([#587]).

[#585]: https://github.com/stackabletech/airflow-operator/pull/585
[#587]: https://github.com/stackabletech/airflow-operator/pull/587
[#585]: https://github.com/stackabletech/druid-operator/pull/585
[#587]: https://github.com/stackabletech/druid-operator/pull/587

### Fixed

Expand All @@ -27,6 +28,7 @@ All notable changes to this project will be documented in this file.
[#557]: https://github.com/stackabletech/druid-operator/pull/557
[#563]: https://github.com/stackabletech/druid-operator/pull/563
[#572]: https://github.com/stackabletech/druid-operator/pull/572
[#573]: https://github.com/stackabletech/druid-operator/pull/573

## [24.3.0] - 2024-03-20

Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 21 additions & 2 deletions deploy/helm/druid-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7203,14 +7203,33 @@ spec:
authentication:
default: []
description: |-
List of [AuthenticationClasses](https://docs.stackable.tech/home/nightly/concepts/authentication) to use for authenticating users. TLS and LDAP authentication are supported. More information in the [Druid operator security documentation](https://docs.stackable.tech/home/nightly/druid/usage-guide/security#_authentication).
List of [AuthenticationClasses](https://docs.stackable.tech/home/nightly/concepts/authentication) to use for authenticating users. TLS, LDAP and OIDC authentication are supported. More information in the [Druid operator security documentation](https://docs.stackable.tech/home/nightly/druid/usage-guide/security#_authentication).

For TLS: Please note that the SecretClass used to authenticate users needs to be the same as the SecretClass used for internal communication.
items:
properties:
authenticationClass:
description: 'The name of an [AuthenticationClass](https://docs.stackable.tech/home/nightly/concepts/authentication) object. When using TLS authentication, the `clientCertSecretClass` must be identical to the `serverAndInternalSecretClass` in the `clusterConfig.tls` settings of Druid. This is a limitation of Druid: Only one CA certificate can be used for both internal authentication between processes as well as authentication of users.'
description: A name/key which references an authentication class. To get the concrete [`AuthenticationClass`], we must resolve it. This resolution can be achieved by using [`ClientAuthenticationDetails::resolve_class`].
type: string
oidc:
description: |-
This field contains authentication provider specific configuration.

Use [`ClientAuthenticationDetails::oidc_or_error`] to get the value or report an error to the user.
nullable: true
properties:
clientCredentialsSecret:
description: A reference to the OIDC client credentials secret. The secret contains the client id and secret.
type: string
extraScopes:
default: []
description: An optional list of extra scopes which get merged with the scopes defined in the [`AuthenticationClass`].
items:
type: string
type: array
required:
- clientCredentialsSecret
type: object
required:
- authenticationClass
type: object
Expand Down
37 changes: 37 additions & 0 deletions docs/modules/druid/examples/druid-oidc-authentication.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# yamllint disable-file

# tag::authclass[]
apiVersion: authentication.stackable.tech/v1alpha1
kind: AuthenticationClass
metadata:
name: oidc-auth
spec:
provider:
oidc:
[...]
#end::authclass[]

# tag::druid[]
apiVersion: druid.stackable.tech/v1alpha1
kind: DruidCluster
metadata:
name: druid
spec:
clusterConfig:
authentication:
- authenticationClass: oidc-auth
oidc:
clientCredentialsSecret: druid-oidc-client
[...]
# end::druid[]

# tag::secret[]
apiVersion: v1
kind: Secret
metadata:
name: druid-oidc-client
stringData:
clientId: <client-id>
clientSecret: <client-secret>

# end::secret[]
27 changes: 25 additions & 2 deletions docs/modules/druid/pages/usage-guide/security.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,35 @@ include::example$druid-ldap-authentication.yaml[tag=druid]
----

Check out the xref:tutorials:authentication_with_openldap.adoc[] tutorial to see a complete example of how to set LDAP authentication for another Stackable operator.
You can also consult the home:reference:authenticationclass.adoc[] reference, or
You can also consult the xref:home:reference:authenticationclass.adoc[] reference, or
https://github.com/stackabletech/druid-operator/tree/main/tests/templates/kuttl/ldap-authentication[the LDAP test] suite.

=== OIDC

Druid supports xref:concepts:authentication.adoc[authentication] of users of the web console against a OIDC provider.
This requires setting up a xref:concepts:authentication.adoc#authenticationclass[AuthenticationClass] for the OIDC provider:

[source,yaml]
----
include::example$druid-oidc-authentication.yaml[tag=authclass]
----

Reference the AuthenticationClass and a secret containing OIDC client credentials in your DruidCluster resource:

[source,yaml]
----
include::example$druid-oidc-authentication.yaml[tag=druid]
----

The secret containing the OIDC client credentials should be structured like this:
[source,yaml]
----
include::example$druid-oidc-authentication.yaml[tag=secret]
----

=== Current Limitations and Upcoming Work

At the moment you can either use TLS authentication or LDAP authentication. Both methods together are not supported.
At the moment you can either use TLS, LDAP or OIDC authentication but not a combination of authentication methods.

Using an LDAP server **without** bind credentials is not supported. This limitation is due to Druid not supporting this scenario. See https://github.com/stackabletech/druid-operator/issues/383[our issue] for details.

Expand Down
1 change: 1 addition & 0 deletions rust/crd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ lazy_static.workspace = true
[dev-dependencies]
rstest.workspace = true
serde_yaml.workspace = true
tokio.workspace = true
Loading