Skip to content

Commit d7ed35d

Browse files
authored
fix: allow overriding https for session ingress (#1106)
1 parent 1b6532a commit d7ed35d

4 files changed

Lines changed: 12 additions & 1 deletion

File tree

api/v1alpha1/amaltheasession_children.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,10 @@ func getUseNoneSameSiteSessionCookie() bool {
611611
return strings.ToLower(os.Getenv("USE_NONE_SAME_SITE_SESSION_COOKIE")) == "true"
612612
}
613613

614+
func getHttpsSessionIngress() bool {
615+
return strings.ToLower(os.Getenv("HTTPS_SESSION_INGRESS")) == "true"
616+
}
617+
614618
// InternalSecretName returns the name of the secret that is a child
615619
// of the AmaltheaSession CR, as opposed to all other adopted secrets that
616620
// are not children of the AmaltheaSession CR and are created by the creator of each AmaltheaSession CR.

api/v1alpha1/amaltheasession_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ type Ingress struct {
231231

232232
func (ingress *Ingress) UrlScheme() string {
233233
urlScheme := "http"
234-
if (ingress.TLSSecret != nil && ingress.TLSSecret.Name != "") || ingress.UseDefaultClusterTLSCert || ingress.AssumeHttps {
234+
if (ingress.TLSSecret != nil && ingress.TLSSecret.Name != "") || ingress.UseDefaultClusterTLSCert || ingress.AssumeHttps || getHttpsSessionIngress() {
235235
urlScheme = "https"
236236
}
237237
return urlScheme

helm-chart/amalthea-sessions/templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ spec:
4444
value: {{ .Values.sidecars.image.repository }}:{{ .Values.sidecars.image.tag }}
4545
- name: USE_NONE_SAME_SITE_SESSION_COOKIE
4646
value: {{ .Values.useNoneSameSiteSessionCookie | quote }}
47+
- name: HTTPS_SESSION_INGRESS
48+
value: {{ .Values.httpsSessionIngress | quote }}
4749
image: {{ .Values.controllerManager.manager.image.repository }}:{{ .Values.controllerManager.manager.image.tag
4850
| default .Chart.AppVersion }}
4951
livenessProbe:

helm-chart/amalthea-sessions/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,8 @@ cloner:
7272
# SameSite parameter to None. This is only useful in specific cases for remote Renku cluster.
7373
# Setting this value to true can have security implications without adjusting CSP and CORS on the session ingress.
7474
useNoneSameSiteSessionCookie: false
75+
76+
# Setting this to true will result the url for the session always using https.
77+
# Regardless of whether a TLS secret or cluster-wide TLS secret is used.
78+
# This is useful because in many cases TLS can be provided through other means.
79+
httpsSessionIngress: false

0 commit comments

Comments
 (0)