Skip to content

Commit

Permalink
Check for Kubernetes secret name in oAuthSecret, fallback to plain te…
Browse files Browse the repository at this point in the history
…xt (#1836)

* Check for Kubernetes secret name in oAuthSecret, fallback to plain text

* Removed logging, added test cases

* Update documentation

* cleaning up formatting

* update-dev-resources
  • Loading branch information
guydog28 authored May 14, 2024
1 parent e007fce commit 192216b
Show file tree
Hide file tree
Showing 43 changed files with 194 additions and 493 deletions.
3 changes: 3 additions & 0 deletions api/v2/checluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,9 @@ type Auth struct {
// +optional
OAuthClientName string `json:"oAuthClientName,omitempty"`
// Name of the secret set in the OpenShift `OAuthClient` resource used to set up identity federation on the OpenShift side.
// For Kubernetes, this can either be the plain text oAuthSecret value, or the name of a kubernetes secret which contains a
// key `oAuthSecret` and the value is the secret. NOTE: this secret must exist in the same namespace as the `CheCluster`
// resource and contain the label `app.kubernetes.io/part-of=che.eclipse.org`.
// +optional
OAuthSecret string `json:"oAuthSecret,omitempty"`
// Access Token Scope.
Expand Down
20 changes: 6 additions & 14 deletions config/crd/bases/org.eclipse.che_checlusters.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#


apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -8075,9 +8063,13 @@ spec:
OpenShift.
type: string
oAuthSecret:
description: Name of the secret set in the OpenShift `OAuthClient`
description: 'Name of the secret set in the OpenShift `OAuthClient`
resource used to set up identity federation on the OpenShift
side.
side. For Kubernetes, this can either be the plain text
oAuthSecret value, or the name of a kubernetes secret which
contains a key `oAuthSecret` and the value is the secret.
NOTE: this secret must exist in the same namespace as the
`CheCluster` resource and contain the label `app.kubernetes.io/part-of=che.eclipse.org`.'
type: string
type: object
domain:
Expand Down
20 changes: 6 additions & 14 deletions deploy/deployment/kubernetes/combined.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: v1
kind: Namespace
metadata:
Expand Down Expand Up @@ -8094,9 +8082,13 @@ spec:
OpenShift.
type: string
oAuthSecret:
description: Name of the secret set in the OpenShift `OAuthClient`
description: 'Name of the secret set in the OpenShift `OAuthClient`
resource used to set up identity federation on the OpenShift
side.
side. For Kubernetes, this can either be the plain text
oAuthSecret value, or the name of a kubernetes secret which
contains a key `oAuthSecret` and the value is the secret.
NOTE: this secret must exist in the same namespace as the
`CheCluster` resource and contain the label `app.kubernetes.io/part-of=che.eclipse.org`.'
type: string
type: object
domain:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: v1
kind: Service
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
Expand Down
12 changes: 0 additions & 12 deletions deploy/deployment/kubernetes/objects/che-operator.ClusterRole.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand Down
12 changes: 0 additions & 12 deletions deploy/deployment/kubernetes/objects/che-operator.Deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
12 changes: 0 additions & 12 deletions deploy/deployment/kubernetes/objects/che-operator.Role.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
Expand Down
12 changes: 0 additions & 12 deletions deploy/deployment/kubernetes/objects/che-operator.RoleBinding.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down Expand Up @@ -8089,9 +8077,13 @@ spec:
OpenShift.
type: string
oAuthSecret:
description: Name of the secret set in the OpenShift `OAuthClient`
description: 'Name of the secret set in the OpenShift `OAuthClient`
resource used to set up identity federation on the OpenShift
side.
side. For Kubernetes, this can either be the plain text
oAuthSecret value, or the name of a kubernetes secret which
contains a key `oAuthSecret` and the value is the secret.
NOTE: this secret must exist in the same namespace as the
`CheCluster` resource and contain the label `app.kubernetes.io/part-of=che.eclipse.org`.'
type: string
type: object
domain:
Expand Down
12 changes: 0 additions & 12 deletions deploy/deployment/kubernetes/objects/eclipse-che.Namespace.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: v1
kind: Namespace
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
Expand Down
20 changes: 6 additions & 14 deletions deploy/deployment/openshift/combined.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: v1
kind: Namespace
metadata:
Expand Down Expand Up @@ -8094,9 +8082,13 @@ spec:
OpenShift.
type: string
oAuthSecret:
description: Name of the secret set in the OpenShift `OAuthClient`
description: 'Name of the secret set in the OpenShift `OAuthClient`
resource used to set up identity federation on the OpenShift
side.
side. For Kubernetes, this can either be the plain text
oAuthSecret value, or the name of a kubernetes secret which
contains a key `oAuthSecret` and the value is the secret.
NOTE: this secret must exist in the same namespace as the
`CheCluster` resource and contain the label `app.kubernetes.io/part-of=che.eclipse.org`.'
type: string
type: object
domain:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: v1
kind: Service
metadata:
Expand Down
12 changes: 0 additions & 12 deletions deploy/deployment/openshift/objects/che-operator.ClusterRole.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand Down
12 changes: 0 additions & 12 deletions deploy/deployment/openshift/objects/che-operator.Deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
Loading

0 comments on commit 192216b

Please sign in to comment.