Skip to content

Commit

Permalink
Provide method to set frame ancestors in global Educates settings val…
Browse files Browse the repository at this point in the history
…ues.
  • Loading branch information
GrahamDumpleton committed Jul 30, 2023
1 parent 9de2e88 commit 0310500
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ websiteStyling:
- name: ""
namespace: ""

frameAncestors:
- ""

#! Pre-pull selected Educates images to nodes in the cluster. Should be empty
#! list if no images should be prepulled. This is done to reduce start up times
#! for workhop sessions the first time on each node in the cluster.
Expand Down
3 changes: 2 additions & 1 deletion client-programs/pkg/config/installationconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,9 @@ type WebsiteStylingConfig struct {
TrainingPortal WebsiteStyleOverridesConfig `yaml:"trainingPortal,omitempty"`
WorkshopStarted WebsiteHTMLSnippetConfig `yaml:"workshopStarted,omitempty"`
WorkshopFinished WebsiteHTMLSnippetConfig `yaml:"workshopFinished,omitempty"`
DefaultTheme string `yaml:"defaultTheme"`
DefaultTheme string `yaml:"defaultTheme,omitempty"`
ThemeDataRefs []ThemeDataRefConfig `yaml:"themeDataRefs,omitempty"`
FrameAncestors []string `yaml:"frameAncestors,omitempty"`
}

type ClusterEssentialsConfig struct {
Expand Down
2 changes: 2 additions & 0 deletions session-manager/handlers/operator_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@

DEFAULT_THEME_NAME = xget(config_values, "websiteStyling.defaultTheme", "")

FRAME_ANCESTORS = xget(config_values, "websiteStyling.frameAncestors", [])

GOOGLE_TRACKING_ID = xget(config_values, "workshopAnalytics.google.trackingId", "")
CLARITY_TRACKING_ID = xget(config_values, "workshopAnalytics.clarity.trackingId", "")
AMPLITUDE_TRACKING_ID = xget(config_values, "workshopAnalytics.amplitude.trackingId", "")
Expand Down
3 changes: 2 additions & 1 deletion session-manager/handlers/trainingportal.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
CLUSTER_STORAGE_GROUP,
CLUSTER_SECURITY_POLICY_ENGINE,
DEFAULT_THEME_NAME,
FRAME_ANCESTORS,
GOOGLE_TRACKING_ID,
CLARITY_TRACKING_ID,
AMPLITUDE_TRACKING_ID,
Expand Down Expand Up @@ -117,7 +118,7 @@ def training_portal_create(name, uid, body, spec, status, patch, runtime, retry,
if not theme_name:
theme_name = "default-website-theme"

frame_ancestors = ",".join(xget(spec, "portal.theme.frame.ancestors", []))
frame_ancestors = ",".join(xget(spec, "portal.theme.frame.ancestors", FRAME_ANCESTORS))

cookie_domain = xget(spec, "portal.cookies.domain")

Expand Down

0 comments on commit 0310500

Please sign in to comment.