Skip to content

Commit

Permalink
Merge remote-tracking branch 'adorsys/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
ma1uta committed Nov 13, 2024
2 parents cd40ca0 + bc525cc commit d227235
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 2 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Added Navigation in the readme [#1010](https://github.com/adorsys/keycloak-config-cli/issues/1010)
### Added
- improved logging for realm retrieval errors [#1010](https://github.com/adorsys/keycloak-config-cli/issues/1010)
### Fixed
- Fix required action import handling for no-delete option [#834](https://github.com/adorsys/keycloak-config-cli/issues/834)

### Fixed
- Allow environment variables from existing secrets [#822](https://github.com/adorsys/keycloak-config-cli/issues/822)
### Fixed
- Fix versioning in artifact to contain the correct keycloak version [#1097](https://github.com/adorsys/keycloak-config-cli/issues/1097)

Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@
[![codecov](https://codecov.io/gh/adorsys/keycloak-config-cli/branch/main/graph/badge.svg)](https://codecov.io/gh/adorsys/keycloak-config-cli)
[![GitHub license](https://img.shields.io/github/license/adorsys/keycloak-config-cli)](https://github.com/adorsys/keycloak-config-cli/blob/main/LICENSE.txt)

# Table of Contents

- [Config Files](#config-files)
- [Variable Substitution](#variable-substitution)
- [Logging](#logging)
- [Supported Features](#supported-features)
- [Compatibility with Keycloak](#compatibility-with-keycloak)
- [Build this Project](#build-this-project)
- [Run Integration Tests](#run-integration-tests)
- [Run this Project](#run-this-project)
- [Docker](#docker)
- [Helm](#helm)
- [Configuration](#configuration)
- [Perform Release](#perform-release)
- [Commercial Support](#commercial-support)

# keycloak-config-cli

keycloak-config-cli is a Keycloak utility to ensure the desired configuration state for a realm based on a JSON/YAML file. The format of the JSON/YAML file based on the export realm format. Store and handle the configuration files inside git just like normal code. A Keycloak restart isn't required to apply the configuration.
Expand Down Expand Up @@ -91,6 +107,8 @@ Further development requirements
- Java Development Kit (JDK)
- Docker Desktop or an alternative replacement (e.g Rancher Desktop)

Before running `mvn verify`, you have to set the JAVA_HOME environment variable to prevent some test failures.

```shell
./mvnw verify

Expand Down
11 changes: 10 additions & 1 deletion contrib/charts/keycloak-config-cli/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,16 @@ spec:
secretKeyRef:
name: "{{ tpl .Values.existingSecret . }}"
key: "{{ .Values.existingSecretKey }}"
{{- end }}
{{- end }}
{{- if .Values.existingSecrets }}
{{- range .Values.existingSecrets }}
- name: {{ .envVar }}
valueFrom:
secretKeyRef:
name: {{ .name }}
key: {{ .key }}
{{- end }}
{{- end }}
{{- with .Values.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
Expand Down
5 changes: 5 additions & 0 deletions contrib/charts/keycloak-config-cli/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ podLabels: {}

## Extra Annotations to be added to pod
podAnnotations: {}
# New section for existing secrets
existingSecrets:
# - name: my-existing-secret
# key: my-secret-key
# envVar: MY_ENV_VAR

config: {}
# <realm name>:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void doImport(RealmImport realmImport) {

List<RequiredActionProviderRepresentation> existingRequiredActions = requiredActionRepository.getAll(realmName);

if (importConfigProperties.getManaged().getClientScope() == ImportManagedPropertiesValues.FULL) {
if (importConfigProperties.getManaged().getRequiredAction() == ImportManagedPropertiesValues.FULL) {
deleteRequiredActionsMissingInImport(realmName, requiredActions, existingRequiredActions);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public void doImport(RealmImport realmImport) {

public boolean hasToBeUpdated(RealmImport realmImport) {
RealmRepresentation existingRealm = realmRepository.get(realmImport.getRealm());
if (existingRealm == null) {
throw new InvalidImportException("The specified realm does not exist: " + realmImport.getRealm());
}
Map<String, String> customAttributes = existingRealm.getAttributes();

String readChecksum = customAttributes.get(getCustomAttributeKey(realmImport));
Expand Down

0 comments on commit d227235

Please sign in to comment.