Skip to content

Commit 3b96eff

Browse files
authored
[Feature] [Platform] OpenID Integration - API Extension (#1893)
1 parent 5b5ada0 commit 3b96eff

14 files changed

+362
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- (Maintenance) Fix Helm & JWT CVE's
99
- (Feature) (Platform) Improve CLI Values
1010
- (Feature) (Platform) Envoy Cache Introduction
11+
- (Feature) (Platform) OpenID Integration - API Extension
1112

1213
## [1.2.48](https://github.com/arangodb/kube-arangodb/tree/1.2.48) (2025-05-08)
1314
- (Maintenance) Extend Documentation

docs/api/ArangoDeployment.V1.md

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3137,6 +3137,49 @@ Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.
31373137

31383138
***
31393139

3140+
### .spec.gateway.authentication.secret.checksum
3141+
3142+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/shared/v1/object.go#L61)</sup>
3143+
3144+
UID keeps the information about object Checksum
3145+
3146+
***
3147+
3148+
### .spec.gateway.authentication.secret.name
3149+
3150+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/shared/v1/object.go#L52)</sup>
3151+
3152+
Name of the object
3153+
3154+
***
3155+
3156+
### .spec.gateway.authentication.secret.namespace
3157+
3158+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/shared/v1/object.go#L55)</sup>
3159+
3160+
Namespace of the object. Should default to the namespace of the parent object
3161+
3162+
***
3163+
3164+
### .spec.gateway.authentication.secret.uid
3165+
3166+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/shared/v1/object.go#L58)</sup>
3167+
3168+
UID keeps the information about object UID
3169+
3170+
***
3171+
3172+
### .spec.gateway.authentication.type
3173+
3174+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway_authentication.go#L51)</sup>
3175+
3176+
Type defines the Authentication Type
3177+
3178+
Possible Values:
3179+
* `"OpenID"` (default) - Configure OpenID Authentication Type
3180+
3181+
***
3182+
31403183
### .spec.gateway.cookiesSupport
31413184

31423185
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L49)</sup>
@@ -3147,10 +3190,20 @@ Default Value: `true`
31473190

31483191
***
31493192

3150-
### .spec.gateway.defaultTargetAuthentication
3193+
### .spec.gateway.createUsers
31513194

31523195
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L53)</sup>
31533196

3197+
CreateUsers defines if authenticated users will be created in ArangoDB
3198+
3199+
Default Value: `false`
3200+
3201+
***
3202+
3203+
### .spec.gateway.defaultTargetAuthentication
3204+
3205+
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L57)</sup>
3206+
31543207
DefaultTargetAuthentication defines if default endpoints check authentication via envoy (Cookie and Header based auth)
31553208

31563209
Default Value: `true`
@@ -3190,7 +3243,7 @@ By default, the image is determined by the operator.
31903243

31913244
### .spec.gateway.timeout
31923245

3193-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L58)</sup>
3246+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L62)</sup>
31943247

31953248
Timeout defines default timeout for the upstream actions (if not overridden)
31963249

pkg/apis/deployment/v1/deployment_spec.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,10 +684,16 @@ func (s DeploymentSpec) GetCoreContainers(group ServerGroup) utils.StringList {
684684
return utils.StringList{shared.ServerContainerName}
685685
}
686686

687-
result := make(utils.StringList, 0, len(groupSpec.SidecarCoreNames)+1)
687+
result := make(utils.StringList, 0, len(groupSpec.SidecarCoreNames)+3)
688688
if !utils.StringList(groupSpec.SidecarCoreNames).Has(shared.ServerContainerName) {
689689
result = append(result, shared.ServerContainerName)
690690
}
691+
if !utils.StringList(groupSpec.SidecarCoreNames).Has(shared.ExporterContainerName) {
692+
result = append(result, shared.ExporterContainerName)
693+
}
694+
if !utils.StringList(groupSpec.SidecarCoreNames).Has(shared.IntegrationContainerName) {
695+
result = append(result, shared.IntegrationContainerName)
696+
}
691697
result = append(result, groupSpec.SidecarCoreNames...)
692698

693699
return result

pkg/apis/deployment/v1/deployment_spec_gateway.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ type DeploymentSpecGateway struct {
4848
// +doc/default: true
4949
CookiesSupport *bool `json:"cookiesSupport,omitempty"`
5050

51+
// CreateUsers defines if authenticated users will be created in ArangoDB
52+
// +doc/default: false
53+
CreateUsers *bool `json:"createUsers,omitempty"`
54+
5155
// DefaultTargetAuthentication defines if default endpoints check authentication via envoy (Cookie and Header based auth)
5256
// +doc/default: true
5357
DefaultTargetAuthentication *bool `json:"defaultTargetAuthentication,omitempty"`
@@ -56,6 +60,9 @@ type DeploymentSpecGateway struct {
5660
// +doc/type: string
5761
// +doc/default: 1m0s
5862
Timeout *meta.Duration `json:"timeout,omitempty"`
63+
64+
// Authentication defines the Authentication spec
65+
Authentication *DeploymentSpecGatewayAuthentication `json:"authentication,omitempty"`
5966
}
6067

6168
// IsEnabled returns whether the gateway is enabled.
@@ -76,6 +83,15 @@ func (d *DeploymentSpecGateway) IsCookiesSupportEnabled() bool {
7683
return *d.CookiesSupport
7784
}
7885

86+
// IsCreateUsersEnabled returns whether the authenticated users will be created in ArangoDB.
87+
func (d *DeploymentSpecGateway) IsCreateUsersEnabled() bool {
88+
if d == nil || d.CreateUsers == nil {
89+
return false
90+
}
91+
92+
return *d.CreateUsers
93+
}
94+
7995
// IsDefaultTargetAuthenticationEnabled returns whether the default target should have verified authentication.
8096
func (d *DeploymentSpecGateway) IsDefaultTargetAuthenticationEnabled() bool {
8197
if d == nil || d.DefaultTargetAuthentication == nil {
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2025 ArangoDB GmbH, Cologne, Germany
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
//
20+
21+
package v1
22+
23+
import (
24+
shared "github.com/arangodb/kube-arangodb/pkg/apis/shared"
25+
sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1"
26+
"github.com/arangodb/kube-arangodb/pkg/util/errors"
27+
)
28+
29+
type DeploymentSpecGatewayAuthenticationType string
30+
31+
func (d *DeploymentSpecGatewayAuthenticationType) Validate() error {
32+
if d == nil {
33+
return nil
34+
}
35+
36+
switch v := *d; v {
37+
case DeploymentSpecGatewayAuthenticationTypeOpenID:
38+
return nil
39+
default:
40+
return errors.Errorf("Invalid AuthenticationType `%s`", v)
41+
}
42+
}
43+
44+
const (
45+
DeploymentSpecGatewayAuthenticationTypeOpenID DeploymentSpecGatewayAuthenticationType = "OpenID"
46+
)
47+
48+
type DeploymentSpecGatewayAuthentication struct {
49+
// Type defines the Authentication Type
50+
// +doc/enum: OpenID|Configure OpenID Authentication Type
51+
Type DeploymentSpecGatewayAuthenticationType `json:"type"`
52+
53+
// Secret defines the secret with the integration configuration
54+
Secret *sharedApi.Object `json:"secret,omitempty"`
55+
}
56+
57+
func (d *DeploymentSpecGatewayAuthentication) Validate() error {
58+
if d == nil {
59+
return nil
60+
}
61+
62+
return shared.WithErrors(
63+
shared.PrefixResourceError("type", d.Type.Validate()),
64+
shared.PrefixResourceError("secret", d.Secret.Validate()),
65+
)
66+
}

pkg/apis/deployment/v1/deployment_spec_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2016-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -151,7 +151,7 @@ func TestDeploymentSpec_GetCoreContainers(t *testing.T) {
151151
args: args{
152152
group: ServerGroupDBServers,
153153
},
154-
want: utils.StringList{"server", "other"},
154+
want: utils.StringList{"server", "exporter", "integration", "other"},
155155
},
156156
"one predefined container and one sidecar container": {
157157
fields: fields{
@@ -162,7 +162,7 @@ func TestDeploymentSpec_GetCoreContainers(t *testing.T) {
162162
args: args{
163163
group: ServerGroupDBServers,
164164
},
165-
want: utils.StringList{"server", "other"},
165+
want: utils.StringList{"exporter", "integration", "server", "other"},
166166
},
167167
"zero core containers": {
168168
fields: fields{
@@ -184,7 +184,7 @@ func TestDeploymentSpec_GetCoreContainers(t *testing.T) {
184184
args: args{
185185
group: ServerGroupDBServers,
186186
},
187-
want: utils.StringList{"server", "other1", "other2"},
187+
want: utils.StringList{"server", "exporter", "integration", "other1", "other2"},
188188
},
189189
}
190190
for testName, test := range tests {

pkg/apis/deployment/v1/zz_generated.deepcopy.go

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/deployment/v2alpha1/deployment_spec.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,10 +684,16 @@ func (s DeploymentSpec) GetCoreContainers(group ServerGroup) utils.StringList {
684684
return utils.StringList{shared.ServerContainerName}
685685
}
686686

687-
result := make(utils.StringList, 0, len(groupSpec.SidecarCoreNames)+1)
687+
result := make(utils.StringList, 0, len(groupSpec.SidecarCoreNames)+3)
688688
if !utils.StringList(groupSpec.SidecarCoreNames).Has(shared.ServerContainerName) {
689689
result = append(result, shared.ServerContainerName)
690690
}
691+
if !utils.StringList(groupSpec.SidecarCoreNames).Has(shared.ExporterContainerName) {
692+
result = append(result, shared.ExporterContainerName)
693+
}
694+
if !utils.StringList(groupSpec.SidecarCoreNames).Has(shared.IntegrationContainerName) {
695+
result = append(result, shared.IntegrationContainerName)
696+
}
691697
result = append(result, groupSpec.SidecarCoreNames...)
692698

693699
return result

pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ type DeploymentSpecGateway struct {
4848
// +doc/default: true
4949
CookiesSupport *bool `json:"cookiesSupport,omitempty"`
5050

51+
// CreateUsers defines if authenticated users will be created in ArangoDB
52+
// +doc/default: false
53+
CreateUsers *bool `json:"createUsers,omitempty"`
54+
5155
// DefaultTargetAuthentication defines if default endpoints check authentication via envoy (Cookie and Header based auth)
5256
// +doc/default: true
5357
DefaultTargetAuthentication *bool `json:"defaultTargetAuthentication,omitempty"`
@@ -56,6 +60,9 @@ type DeploymentSpecGateway struct {
5660
// +doc/type: string
5761
// +doc/default: 1m0s
5862
Timeout *meta.Duration `json:"timeout,omitempty"`
63+
64+
// Authentication defines the Authentication spec
65+
Authentication *DeploymentSpecGatewayAuthentication `json:"authentication,omitempty"`
5966
}
6067

6168
// IsEnabled returns whether the gateway is enabled.
@@ -76,6 +83,15 @@ func (d *DeploymentSpecGateway) IsCookiesSupportEnabled() bool {
7683
return *d.CookiesSupport
7784
}
7885

86+
// IsCreateUsersEnabled returns whether the authenticated users will be created in ArangoDB.
87+
func (d *DeploymentSpecGateway) IsCreateUsersEnabled() bool {
88+
if d == nil || d.CreateUsers == nil {
89+
return false
90+
}
91+
92+
return *d.CreateUsers
93+
}
94+
7995
// IsDefaultTargetAuthenticationEnabled returns whether the default target should have verified authentication.
8096
func (d *DeploymentSpecGateway) IsDefaultTargetAuthenticationEnabled() bool {
8197
if d == nil || d.DefaultTargetAuthentication == nil {

0 commit comments

Comments
 (0)