-
Notifications
You must be signed in to change notification settings - Fork 2
feat: theme customization #387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
066e801
Theme customization
slaskawi 69d8e59
Update docs/reference/UDS Core/IdAM/customization.md
slaskawi a6ad502
Update docs/reference/UDS Core/IdAM/customization.md
slaskawi 4813088
Update docs/reference/UDS Core/IdAM/customization.md
slaskawi 20c038a
Automatic tests and comments addressed
slaskawi d15735e
Merge remote-tracking branch 'origin/main' into 319-customize_keycloa…
slaskawi 37df7f2
lint
slaskawi e9a3609
Invoke the tests
slaskawi 7f2460a
Fixes
slaskawi 62b67ec
Paths updated
slaskawi a8ff903
Simplified how tests are ran
slaskawi 63bc8c0
Test fix
slaskawi 984e065
Merge remote-tracking branch 'origin/main' into 319-customize_keycloa…
slaskawi 1cc9ed6
Reverted branch
slaskawi 2913701
Merge remote-tracking branch 'origin/main' into 319-customize_keycloa…
slaskawi 54ad6ee
last fixes
slaskawi 4fa852d
Merge remote-tracking branch 'origin/main' into 319-customize_keycloa…
slaskawi af9b9ff
Changed the image into something real
slaskawi 67c900f
Added missing manual paragraph
slaskawi 2f6fb46
Merge branch 'main' into 319-customize_keycloak_themes
mjnagel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| # Copyright 2025 Defense Unicorns | ||
| # SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial | ||
|
|
||
| kind: UDSBundle | ||
| metadata: | ||
| name: theme-customization-tests | ||
| description: A UDS Bundle designed to be deployed on top of `uds-bundle-k3d-core-slim-dev` to test theme customization | ||
| version: "dev" | ||
|
|
||
| packages: | ||
| - name: core-identity-authorization | ||
| path: ../../uds-core/build/ | ||
| # renovate: datasource=github-tags depName=defenseunicorns/uds-core versioning=semver | ||
| ref: 0.38.0 | ||
| overrides: | ||
| keycloak: | ||
| keycloak: | ||
| variables: | ||
| - name: KEYCLOAK_CONFIG_IMAGE | ||
| description: "The keycloak config image to deploy plugin and initial setup configuration" | ||
| path: configImage | ||
| values: | ||
| - path: themeCustomizations | ||
| value: | ||
| resources: | ||
| images: | ||
| - name: background.jpg | ||
| configmap: | ||
| name: keycloak-theme-overrides | ||
| - name: logo.svg | ||
| configmap: | ||
| name: keycloak-theme-overrides | ||
| - name: footer.png | ||
| configmap: | ||
| name: keycloak-theme-overrides | ||
| - name: favicon.svg | ||
| configmap: | ||
| name: keycloak-theme-overrides | ||
| - path: realmInitEnv | ||
| value: | ||
| GOOGLE_IDP_ENABLED: true | ||
| GOOGLE_IDP_ID: "C01881u7t" | ||
| GOOGLE_IDP_SIGNING_CERT: "MIIDdDCCAlygAwIBAgIGAXkza8/+MA0GCSqGSIb3DQEBCwUAMHsxFDASBgNVBAoTC0dvb2dsZSBJbmMuMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MQ8wDQYDVQQDEwZHb29nbGUxGDAWBgNVBAsTD0dvb2dsZSBGb3IgV29yazELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWEwHhcNMjEwNTAzMTgwOTMzWhcNMjYwNTAyMTgwOTMzWjB7MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEPMA0GA1UEAxMGR29vZ2xlMRgwFgYDVQQLEw9Hb29nbGUgRm9yIFdvcmsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu9en1CO4EriCJ5jzss6TqUmtYMXXRBfsSkdnhVvMx0fYOegxy0d8DouUEEITlPW+YPBG1T72kiV9KGtKVw90ff4Y+siNDNrME81w4K3Zjo6VukvATfD05lVzh9JyO0VxdzBpdRXSJqBOVLo38cwVbyTcX5Nk/nHENjDSN7as3UvbXa7eT4Xswy1GARGAZ3MAaLTZn1+Cctn0MDKniQOS6QDryYgKWz8ko/H4T9XCxgjHJVsL6obezaPZF+pibyyVPCuePssuxUbFHF6yiP5rCfAsK6VTv/8pbYGauGpYHDgnM941RtN2ThltORgi+P9i9wQ8VRBQpEm1RvDXOqJ7OwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQB5L26tpco6EgVunmZYBAFiFE+Dhqwvy4J1iKuXApaKhqabeKJ8kBv/pJBnZl7CRF5Pv8dLfhNoNm2BsXbpH91/rhDj9zl/Imkc5ttVGbXbKSBpUaduwBZpsVIX0xCugNPflHFz9kf/zsGWb3X6wO/2eNewj3fr8jNRC/KWQ7otcdqwYbe1BO4yo6FjAIs5L+wCQcc2JjRWgBon4wL25ccX3nH8aMHl4/gz5trKwPqH0/lYcScJmMSRPzHbmd62LlmZE9eWEwuYJ+h8fssTZA9JTMXvkPhg05w2snaM9XdSuXIRo4UtqGpMQC0KRMmwDHbVSluX63wn7iSZD4TGHZGa" | ||
| GOOGLE_IDP_NAME_ID_FORMAT: "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" | ||
| GOOGLE_IDP_CORE_ENTITY_ID: "https://sso.uds.dev/realms/uds" | ||
| GOOGLE_IDP_ADMIN_GROUP: "uds-core-dev-admin" | ||
| GOOGLE_IDP_AUDITOR_GROUP: "uds-core-dev-auditor" | ||
| - path: realmAuthFlows | ||
| value: | ||
| USERNAME_PASSWORD_AUTH_ENABLED: true | ||
| X509_AUTH_ENABLED: true | ||
| SOCIAL_AUTH_ENABLED: true | ||
| OTP_ENABLED: true | ||
| - path: env[0] | ||
| value: | ||
| name: JAVA_OPTS_KC_HEAP | ||
| value: "-XX:MaxRAMPercentage=70 -XX:MinRAMPercentage=70 -XX:InitialRAMPercentage=50 -XX:MaxRAM=1G" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| /** | ||
| * Copyright 2024 Defense Unicorns | ||
| * SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial | ||
| */ | ||
|
|
||
| describe("Theme customizations", () => { | ||
| it("Customization ConfigMap exists", () => { | ||
| cy.exec("uds zarf tools kubectl get cm -n keycloak keycloak-theme-overrides").then(result => { | ||
| expect(result.stdout).to.contain("keycloak-theme-overrides"); | ||
| }); | ||
| }); | ||
| it("UDS Identity Config has proper Volume Mounts", () => { | ||
| cy.exec( | ||
| "uds zarf tools kubectl get pod keycloak-0 -n keycloak -o yaml -o jsonpath='{.spec.initContainers[?(@.name==\"uds-config\")].volumeMounts}'", | ||
| ).then(result => { | ||
| expect(result.stdout).to.contain("theme-overrides"); | ||
| }); | ||
| }); | ||
| it("Override files are properly copied", () => { | ||
| cy.exec("uds zarf tools kubectl get cm -n keycloak keycloak-theme-overrides -o yaml").then( | ||
| result => { | ||
| const configMap = result.stdout; | ||
| const backgroundJpg = /background\.jpg:\s*(.*)/.exec(configMap)?.[1]; | ||
| const faviconSvg = /favicon\.svg:\s*(.*)/.exec(configMap)?.[1]; | ||
| const footerPng = /footer\.png:\s*(.*)/.exec(configMap)?.[1]; | ||
| const logoSvg = /logo\.svg:\s*(.*)/.exec(configMap)?.[1]; | ||
|
|
||
| expect(backgroundJpg).to.exist; | ||
| expect(faviconSvg).to.exist; | ||
| expect(footerPng).to.exist; | ||
| expect(logoSvg).to.exist; | ||
|
|
||
| // logo.svg tests | ||
| cy.exec( | ||
| "uds zarf tools kubectl exec keycloak-0 -n keycloak -- cat /opt/keycloak/themes/theme/login/resources/img/logo.svg | base64 -w 0", | ||
| ).then(result => { | ||
| expect(result.stdout).to.equal(logoSvg); | ||
| }); | ||
| cy.exec( | ||
| "uds zarf tools kubectl exec keycloak-0 -n keycloak -- cat /opt/keycloak/themes/theme/login/resources/img/uds-logo.svg | base64 -w 0", | ||
| ).then(result => { | ||
| expect(result.stdout).to.equal(logoSvg); | ||
| }); | ||
| cy.exec( | ||
| "uds zarf tools kubectl exec keycloak-0 -n keycloak -- cat /opt/keycloak/themes/theme/account/resources/public/logo.svg | base64 -w 0", | ||
| ).then(result => { | ||
| expect(result.stdout).to.equal(logoSvg); | ||
| }); | ||
| cy.exec( | ||
| "uds zarf tools kubectl exec keycloak-0 -n keycloak -- cat /opt/keycloak/themes/theme/account/resources/public/uds-logo.svg | base64 -w 0", | ||
| ).then(result => { | ||
| expect(result.stdout).to.equal(logoSvg); | ||
| }); | ||
|
|
||
| // background.jpg tests | ||
| cy.exec( | ||
| "uds zarf tools kubectl exec keycloak-0 -n keycloak -- cat /opt/keycloak/themes/theme/login/resources/img/tech-bg.jpg | base64 -w 0", | ||
| ).then(result => { | ||
| expect(result.stdout).to.equal(backgroundJpg); | ||
| }); | ||
| cy.exec( | ||
| "uds zarf tools kubectl exec keycloak-0 -n keycloak -- cat /opt/keycloak/themes/theme/account/resources/public/tech-bg.jpg | base64 -w 0", | ||
| ).then(result => { | ||
| expect(result.stdout).to.equal(backgroundJpg); | ||
| }); | ||
|
|
||
| // favicon.svg tests | ||
| cy.exec( | ||
| "uds zarf tools kubectl exec keycloak-0 -n keycloak -- cat /opt/keycloak/themes/theme/login/resources/img/favicon.svg | base64 -w 0", | ||
| ).then(result => { | ||
| expect(result.stdout).to.equal(faviconSvg); | ||
| }); | ||
|
|
||
| // footer.png tests | ||
| cy.exec( | ||
| "uds zarf tools kubectl exec keycloak-0 -n keycloak -- cat /opt/keycloak/themes/theme/login/resources/img/full-du-logo.png | base64 -w 0", | ||
| ).then(result => { | ||
| expect(result.stdout).to.equal(footerPng); | ||
| }); | ||
| cy.exec( | ||
| "uds zarf tools kubectl exec keycloak-0 -n keycloak -- cat /opt/keycloak/themes/theme/login/resources/img/full-du-logo.png | base64 -w 0", | ||
| ).then(result => { | ||
| expect(result.stdout).to.equal(footerPng); | ||
| }); | ||
| }, | ||
| ); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.