diff --git a/README.md b/README.md index 5bfd383db..0334dcf43 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,27 @@ In order to contribute to this repository, you need to have the following tools: - Helm unittests is used for running helm tests. To install the helm-unittest helm plugin follow instructions [here](https://github.com/helm-unittest/helm-unittest?tab=readme-ov-file#install) - This repository uses a taskfile, in order to run tasks install the binary, follow instructions [here](https://taskfile.dev/installation/). + +## Helm +The roles chart uses unit tests. To be able to execute them locally and update the snapshots you need to install a plugin. + +```shell +helm plugin install https://github.com/helm-unittest/helm-unittest.git --version v0.5.1 +``` + +Then you can run + +```shell +helm unittest ./charts/ +``` + +```shell +# To also update helm snapshot after changes, do: +helm unittest -u ./charts/ +``` + +To test your changes in the respective chart + ## Security / Disclosure If you find any bug that may be a security problem, please follow our instructions at [in our security policy](https://github.com/openmfp/helm-charts/security/policy) on how to report it. Please do not create GitHub issues for security-related doubts or problems. diff --git a/charts/keycloak/README.md b/charts/keycloak/README.md index cc85b5678..4add122b6 100644 --- a/charts/keycloak/README.md +++ b/charts/keycloak/README.md @@ -21,10 +21,10 @@ A Helm chart to deploy keycloak as OIDC provider in openmfp | crossplane.providerConfig | object | `{"name":"keycloak-provider-config","namespace":"openmfp-system"}` | crossplane provider config | | crossplane.providerConfig.name | string | `"keycloak-provider-config"` | name of the client | | crossplane.providerConfig.namespace | string | `"openmfp-system"` | client namespace | -| crossplane.realm | object | `{"accessTokenLifespan":"8h","displayName":"OpenMFP","name":"openmfp","registrationAllowed":true}` | crossplane realm config | +| crossplane.realm | object | `{"accessTokenLifespan":"8h","displayName":"default","name":"default","registrationAllowed":true}` | crossplane realm config | | crossplane.realm.accessTokenLifespan | string | `"8h"` | realm access token lifespan | -| crossplane.realm.displayName | string | `"OpenMFP"` | realm display name | -| crossplane.realm.name | string | `"openmfp"` | realm name | +| crossplane.realm.displayName | string | `"default"` | realm display name | +| crossplane.realm.name | string | `"default"` | realm name | | crossplane.realm.registrationAllowed | bool | `true` | realm registration allowed | | crossplane.trustedAudiences | list | `[]` | | | debug | bool | `false` | debug mode | diff --git a/charts/keycloak/tests/__snapshot__/crossplane_test.yaml.snap b/charts/keycloak/tests/__snapshot__/crossplane_test.yaml.snap index 86cf8a1df..405f58111 100644 --- a/charts/keycloak/tests/__snapshot__/crossplane_test.yaml.snap +++ b/charts/keycloak/tests/__snapshot__/crossplane_test.yaml.snap @@ -11,7 +11,7 @@ matches the snapshot: enabled: true name: OpenMFP realmIdRef: - name: openmfp + name: default standardFlowEnabled: true validRedirectUris: - http://localhost:8000/callback* @@ -38,7 +38,7 @@ matches the snapshot: - groups - trusted-openmfp-audiences realmIdRef: - name: openmfp + name: default providerConfigRef: name: keycloak-provider-config 3: | @@ -51,7 +51,7 @@ matches the snapshot: groupIdsRefs: - name: portal realmIdRef: - name: openmfp + name: default providerConfigRef: name: keycloak-provider-config 4: | @@ -63,7 +63,7 @@ matches the snapshot: forProvider: name: portal realmIdRef: - name: openmfp + name: default providerConfigRef: name: keycloak-provider-config 5: | @@ -77,7 +77,7 @@ matches the snapshot: includeInTokenScope: true name: groups realmIdRef: - name: openmfp + name: default providerConfigRef: name: keycloak-provider-config 6: | @@ -92,7 +92,7 @@ matches the snapshot: name: groups-client-scope name: group-membership-mapper realmIdRef: - name: openmfp + name: default providerConfigRef: name: keycloak-provider-config 7: | @@ -105,7 +105,7 @@ matches the snapshot: includeInTokenScope: true name: trusted-openmfp-audiences realmIdRef: - name: openmfp + name: default providerConfigRef: name: keycloak-provider-config 8: | @@ -140,17 +140,17 @@ matches the snapshot: apiVersion: realm.keycloak.crossplane.io/v1alpha1 kind: Realm metadata: - name: openmfp + name: default spec: forProvider: accessTokenLifespan: 8h attributes: organizationsEnabled: "true" - displayName: OpenMFP - displayNameHtml: OpenMFP + displayName: default + displayNameHtml: default enabled: true loginWithEmailAllowed: true - realm: openmfp + realm: default registrationAllowed: true registrationEmailAsUsername: true ssoSessionIdleTimeout: 8h @@ -169,7 +169,7 @@ matches the snapshot with custom config: enabled: true name: OpenMFP realmIdRef: - name: openmfp + name: default standardFlowEnabled: true validRedirectUris: - http://localhost:8000/callback* @@ -196,7 +196,7 @@ matches the snapshot with custom config: - groups - trusted-openmfp-audiences realmIdRef: - name: openmfp + name: default providerConfigRef: name: keycloak-provider-config 3: | @@ -209,7 +209,7 @@ matches the snapshot with custom config: groupIdsRefs: - name: portal realmIdRef: - name: openmfp + name: default providerConfigRef: name: keycloak-provider-config 4: | @@ -221,7 +221,7 @@ matches the snapshot with custom config: forProvider: name: portal realmIdRef: - name: openmfp + name: default providerConfigRef: name: keycloak-provider-config 5: | @@ -235,7 +235,7 @@ matches the snapshot with custom config: includeInTokenScope: true name: groups realmIdRef: - name: openmfp + name: default providerConfigRef: name: keycloak-provider-config 6: | @@ -250,7 +250,7 @@ matches the snapshot with custom config: name: groups-client-scope name: group-membership-mapper realmIdRef: - name: openmfp + name: default providerConfigRef: name: keycloak-provider-config 7: | @@ -272,7 +272,7 @@ matches the snapshot with custom config: hideOnLoginPage: true issuer: https://custom-provider.com realmRef: - name: openmfp + name: default tokenUrl: https://custom-provider.com/oauth/token trustEmail: true providerConfigRef: @@ -292,7 +292,7 @@ matches the snapshot with custom config: identityProviderMapper: oidc-user-attribute-idp-mapper name: last_name realmRef: - name: openmfp + name: default providerConfigRef: name: keycloak-provider-config 9: | @@ -310,7 +310,7 @@ matches the snapshot with custom config: identityProviderMapper: oidc-user-attribute-idp-mapper name: first_name realmRef: - name: openmfp + name: default providerConfigRef: name: keycloak-provider-config 10: | @@ -323,7 +323,7 @@ matches the snapshot with custom config: includeInTokenScope: true name: trusted-openmfp-audiences realmIdRef: - name: openmfp + name: default providerConfigRef: name: keycloak-provider-config 11: | @@ -358,17 +358,17 @@ matches the snapshot with custom config: apiVersion: realm.keycloak.crossplane.io/v1alpha1 kind: Realm metadata: - name: openmfp + name: default spec: forProvider: accessTokenLifespan: 8h attributes: organizationsEnabled: "true" - displayName: OpenMFP - displayNameHtml: OpenMFP + displayName: default + displayNameHtml: default enabled: true loginWithEmailAllowed: true - realm: openmfp + realm: default registrationAllowed: true registrationEmailAsUsername: true ssoSessionIdleTimeout: 8h diff --git a/charts/keycloak/values.yaml b/charts/keycloak/values.yaml index 99824d072..9c5a6fcbd 100644 --- a/charts/keycloak/values.yaml +++ b/charts/keycloak/values.yaml @@ -22,9 +22,9 @@ crossplane: # -- crossplane realm config realm: # -- realm name - name: openmfp + name: default # -- realm display name - displayName: OpenMFP + displayName: default # -- realm registration allowed registrationAllowed: true # -- realm access token lifespan