Skip to content
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

update all api config for keycloak standalone #258

Conversation

MatthewErispe
Copy link
Collaborator

@MatthewErispe MatthewErispe commented Jun 12, 2024

Summary by CodeRabbit

  • New Features

    • Enabled Single Sign-On (SSO) for improved security and user experience.
    • Updated API configuration to include new system configuration parameters.
  • Configuration

    • Adjusted base API port to 50000 for better network management.
    • Renamed JSON configuration fields for consistency and clarity.

@rcrichton
Copy link
Member

Copy link
Contributor

coderabbitai bot commented Jun 12, 2024

Walkthrough

The recent updates introduce new configuration parameters and environment variables across various files, enhancing system and API configuration management. Key changes include the addition of configuration strings in Java classes, adjustments in Docker stack files for environment variables, and modifications in a JSON configuration file. These changes aim to improve the integration and setup process for the application, including enabling Single Sign-On (SSO) and refining API configurations.

Changes

Files Change Summaries
AppConfig.java Introduced new public static final strings for system configuration and API configuration filenames.
APIKC.java Updated create() method to include additional configuration parameters.
create-env-linux-low-1.sh Enabled SSO, configured base API port for React app, and set REACT_APP_MOCK_BACKEND to false.
docker-stack-high-0.yml, docker-stack-high-1.yml, docker-stack-low-0.yml, docker-stack-low-1.yml Added SYSTEM_CONFIG_DIR, API_CONFIG_REFERENCE_FILENAME, and API_CONFIG_MASTER_FILENAME variables.
config-reference-link-dp-api.json Renamed fields to follow camelCase convention (e.g., given_name to givenName).

Poem

In code's vast and shifting sea,
New configs set the data free,
With SSO and ports aligned,
Docker stacks now intertwined.
Variables dance in perfect tune,
API fields hum a joyous rune.
Oh, how the system sings anew,
A rabbit's cheer for changes true! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range and nitpick comments (1)
devops/linux/docker/conf/env/create-env-linux-low-1.sh (1)

Line range hint 4-4: Ensure safe directory changes and separate declaration from assignment.

# Correct the potential failure of cd command and separate the declaration from assignment to avoid masking return values.
export PROJECT_PATH_APPS_ROOT=$(builtin cd ../../../../../ || exit; pwd)
export PROJECT_DIR=$(builtin cd ../../ || exit; pwd)

Also applies to: 6-6

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1d84646 and e80a6c4.

Files selected for processing (8)
  • JeMPI_Apps/JeMPI_API_KC/src/main/java/org/jembi/jempi/AppConfig.java (1 hunks)
  • JeMPI_Apps/JeMPI_API_KC/src/main/java/org/jembi/jempi/api/APIKC.java (1 hunks)
  • devops/linux/docker/conf/env/create-env-linux-low-1.sh (1 hunks)
  • devops/linux/docker/conf/stack/docker-stack-high-0.yml (1 hunks)
  • devops/linux/docker/conf/stack/docker-stack-high-1.yml (1 hunks)
  • devops/linux/docker/conf/stack/docker-stack-low-0.yml (1 hunks)
  • devops/linux/docker/conf/stack/docker-stack-low-1.yml (1 hunks)
  • devops/linux/docker/data-config/config-reference-link-dp-api.json (4 hunks)
Files skipped from review due to trivial changes (2)
  • devops/linux/docker/conf/stack/docker-stack-low-0.yml
  • devops/linux/docker/data-config/config-reference-link-dp-api.json
Additional context used
Shellcheck
devops/linux/docker/conf/env/create-env-linux-low-1.sh

[warning] 4-4: Declare and assign separately to avoid masking return values. (SC2155)


[warning] 4-4: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. (SC2164)


[warning] 6-6: Declare and assign separately to avoid masking return values. (SC2155)


[warning] 6-6: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. (SC2164)


[warning] 16-16: Declare and assign separately to avoid masking return values. (SC2155)


[warning] 18-18: Declare and assign separately to avoid masking return values. (SC2155)

Additional comments not posted (7)
devops/linux/docker/conf/env/create-env-linux-low-1.sh (2)

Line range hint 16-18: New environment variables for Keycloak configuration are correctly set.


64-65: Clarify the intention behind setting SSO to false.

Also applies to: 68-68

JeMPI_Apps/JeMPI_API_KC/src/main/java/org/jembi/jempi/api/APIKC.java (1)

45-48: New Keycloak configuration parameters are correctly integrated into the API setup.

JeMPI_Apps/JeMPI_API_KC/src/main/java/org/jembi/jempi/AppConfig.java (1)

50-53: New configuration constants for system and API settings are correctly declared.

devops/linux/docker/conf/stack/docker-stack-low-1.yml (1)

513-515: New environment variables for system and API configuration in the api-kc service are correctly set.

devops/linux/docker/conf/stack/docker-stack-high-0.yml (1)

701-703: Ensure the new environment variables are correctly referenced in the application.

Verification successful

The new environment variables SYSTEM_CONFIG_DIR, API_CONFIG_REFERENCE_FILENAME, API_CONFIG_MASTER_FILENAME, and API_FIELDS_CONFIG_FILENAME are correctly referenced and used in the application code, specifically in the AppConfig and APIKC classes. The variables are also properly defined in the Docker Compose files and environment setup scripts.

  • JeMPI_Apps/JeMPI_API_KC/src/main/java/org/jembi/jempi/AppConfig.java
  • JeMPI_Apps/JeMPI_API_KC/src/main/java/org/jembi/jempi/api/APIKC.java
  • JeMPI_Apps/JeMPI_API/src/main/java/org/jembi/jempi/AppConfig.java
  • JeMPI_Apps/JeMPI_API/src/main/java/org/jembi/jempi/api/API.java
  • devops/linux/docker/conf/stack/docker-stack-high-0.yml
  • devops/linux/docker/conf/stack/docker-stack-low-0.yml
  • devops/linux/docker/conf/stack/docker-stack-low-1.yml
  • devops/linux/docker/conf/stack/docker-stack-high-1.yml
  • devops/linux/docker/conf/env/create-env-linux-low-1.sh
  • devops/linux/docker/conf/env/create-env-linux-high-1.sh
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the usage of new environment variables in the application code.

# Test: Search for the environment variable usage. Expect: Proper handling and usage in the application.
rg --type yaml 'SYSTEM_CONFIG_DIR|API_CONFIG_REFERENCE_FILENAME|API_CONFIG_MASTER_FILENAME|API_FIELDS_CONFIG_FILENAME' -C 3

Length of output: 17221



Script:

#!/bin/bash
# Description: Verify the usage of new environment variables in the application code.

# Test: Search for the environment variable usage in the application code. Expect: Proper handling and usage in the application.
rg 'SYSTEM_CONFIG_DIR|API_CONFIG_REFERENCE_FILENAME|API_CONFIG_MASTER_FILENAME|API_FIELDS_CONFIG_FILENAME' -t py -t js -t ts -t java -t go -t rb -t php -t sh -t yaml -t yml -t json -t xml -t properties -t env

Length of output: 237



Script:

#!/bin/bash
# Description: Verify the usage of new environment variables in the application code.

# Test: Search for the environment variable usage in the application code. Expect: Proper handling and usage in the application.
rg 'SYSTEM_CONFIG_DIR|API_CONFIG_REFERENCE_FILENAME|API_CONFIG_MASTER_FILENAME|API_FIELDS_CONFIG_FILENAME' -t py -t js -t ts -t java -t go -t php -t sh -t yaml -t yml -t json -t xml -t properties -t env

Length of output: 232



Script:

#!/bin/bash
# Description: Verify the usage of new environment variables in the application code.

# Test: Search for the environment variable usage in the application code. Expect: Proper handling and usage in the application.
rg 'SYSTEM_CONFIG_DIR|API_CONFIG_REFERENCE_FILENAME|API_CONFIG_MASTER_FILENAME|API_FIELDS_CONFIG_FILENAME' -t py -t js -t ts -t java -t go -t php -t sh -t yaml -t json -t xml -t properties -t env

Length of output: 232



Script:

#!/bin/bash
# Description: Verify the usage of new environment variables in the application code.

# Test: Search for the environment variable usage in the application code. Expect: Proper handling and usage in the application.
rg 'SYSTEM_CONFIG_DIR|API_CONFIG_REFERENCE_FILENAME|API_CONFIG_MASTER_FILENAME|API_FIELDS_CONFIG_FILENAME' -t py -t js -t ts -t java -t go -t php -t sh -t yaml -t json -t xml -t env

Length of output: 211



Script:

#!/bin/bash
# Description: Verify the usage of new environment variables in the application code.

# Test: Search for the environment variable usage in the application code. Expect: Proper handling and usage in the application.
rg 'SYSTEM_CONFIG_DIR|API_CONFIG_REFERENCE_FILENAME|API_CONFIG_MASTER_FILENAME|API_FIELDS_CONFIG_FILENAME' -t py -t js -t ts -t java -t go -t php -t sh -t yaml -t json -t xml

Length of output: 9122

devops/linux/docker/conf/stack/docker-stack-high-1.yml (1)

701-703: Ensure the new environment variables are correctly referenced in the application.

Verification successful

The environment variables SYSTEM_CONFIG_DIR, API_CONFIG_REFERENCE_FILENAME, API_CONFIG_MASTER_FILENAME, and API_FIELDS_CONFIG_FILENAME are correctly referenced and used in the application code, specifically in the AppConfig and API classes within the Java files.

  • JeMPI_Apps/JeMPI_API_KC/src/main/java/org/jembi/jempi/AppConfig.java
  • JeMPI_Apps/JeMPI_API_KC/src/main/java/org/jembi/jempi/api/APIKC.java
  • JeMPI_Apps/JeMPI_API/src/main/java/org/jembi/jempi/AppConfig.java
  • JeMPI_Apps/JeMPI_API/src/main/java/org/jembi/jempi/api/API.java

These references confirm that the environment variables are properly handled and utilized within the application.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the usage of new environment variables in the application code.

# Test: Search for the environment variable usage. Expect: Proper handling and usage in the application.
rg --type yaml 'SYSTEM_CONFIG_DIR|API_CONFIG_REFERENCE_FILENAME|API_CONFIG_MASTER_FILENAME|API_FIELDS_CONFIG_FILENAME' -C 3

Length of output: 17221



Script:

#!/bin/bash
# Description: Verify the usage of new environment variables in the application code.

# Test: Search for the environment variable usage in the application code. Expect: Proper handling and usage in the application.
rg 'SYSTEM_CONFIG_DIR|API_CONFIG_REFERENCE_FILENAME|API_CONFIG_MASTER_FILENAME|API_FIELDS_CONFIG_FILENAME' -t py -t js -t ts -t java -t go -t php -t rb -t sh -t yaml -C 3

Length of output: 199



Script:

#!/bin/bash
# Description: Verify the usage of new environment variables in the application code.

# Test: Search for the environment variable usage in the application code. Expect: Proper handling and usage in the application.
rg 'SYSTEM_CONFIG_DIR|API_CONFIG_REFERENCE_FILENAME|API_CONFIG_MASTER_FILENAME|API_FIELDS_CONFIG_FILENAME' -t py -t js -t ts -t java -t go -t php -t sh -t yaml -C 3

Length of output: 25342

@MatthewErispe MatthewErispe merged commit 186a60d into CU-86by1w64p_JeMPI-UI-Configuration Jun 20, 2024
@MatthewErispe MatthewErispe deleted the CU-86bxxxcwe_KeyCloak-in-JeMPI-standalone branch June 20, 2024 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants