Skip to content

feat: implement native internationalization for Agama projects #10165

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 4 commits into from
Nov 18, 2024

Conversation

jgomer2001
Copy link
Contributor

@jgomer2001 jgomer2001 commented Nov 15, 2024

Prepare


Description

Target issue

closes #8675

Implementation Details


Test and Document the changes

  • Static code analysis has been run locally and issues have been fixed
  • Relevant unit and integration tests have been added/updated
  • Relevant documentation has been updated if any (i.e. user guides, installation and configuration guides, technical design docs etc)

Please check the below before submitting your PR. The PR will not be merged if there are no commits that start with docs: to indicate documentation changes or if the below checklist is not selected.

  • I confirm that there is no impact on the docs due to the code changes in this PR.

Signed-off-by: jgomer2001 <bonustrack310@gmail.com>
Signed-off-by: jgomer2001 <bonustrack310@gmail.com>
Copy link

dryrunsecurity bot commented Nov 15, 2024

DryRun Security Summary

The pull request focuses on improving the documentation, deployment, and localization/internationalization features of the Agama framework used in the Jans Auth Server application, with a strong emphasis on security considerations such as sensitive configuration data, flow execution control, consistent directory structure, input validation and sanitization, and caching and error handling.

Expand for full summary

Summary:

The code changes in this pull request focus on improving the documentation, deployment, and localization/internationalization features of the Agama framework, which is used in the Jans Auth Server application. The changes cover a range of topics, including project structure, flow design, error handling, and variable naming conventions, all of which have implications for the overall security of the application.

From an application security perspective, the key points to highlight are:

  1. Sensitive Configuration Data: The documentation emphasizes the importance of not storing real configuration properties in the project.json file, which is a good security practice to avoid exposing sensitive information.
  2. Flow Execution Control: The use of the noDirectLaunch field in the project.json file to restrict direct access to certain flows is a security measure that helps to protect the application.
  3. Consistent Directory Structure: The documentation's emphasis on maintaining a consistent directory structure for web assets helps to reduce the risk of potential security issues related to file inclusion or path traversal vulnerabilities.
  4. Input Validation and Sanitization: The code changes highlight the importance of properly validating and sanitizing user-provided input, especially when rendering templates and handling user data, to prevent vulnerabilities like cross-site scripting (XSS) and SQL injection.
  5. Caching and Error Handling: The changes to the MessagesService and LabelsService classes demonstrate the need to carefully design caching mechanisms and error handling to prevent potential security issues, such as cache poisoning attacks and information disclosure.

Overall, the code changes appear to be focused on improving the security and maintainability of the Agama framework, but it is important to continue reviewing the actual implementation and ensuring that appropriate security measures are in place to protect the Jans Auth Server application and its users.

Files Changed:

  1. docs/agama/gama-format.md: This file has been updated to document the Agama project format, with a focus on managing web assets, sensitive configuration data, and flow execution control.
  2. docs/janssen-server/developer/agama/flows-navigation-ui.md: This file provides documentation on the Agama framework's functionality, including template rendering, data model, asset handling, and user data retrieval.
  3. docs/janssen-server/developer/agama/agama-best-practices.md: This file outlines recommended practices and guidelines for developing Agama applications, with a focus on project reuse, flow design, error handling, and variable naming conventions.
  4. docs/janssen-server/developer/agama/advanced-usages.md: This file provides an in-depth overview of the localization and internationalization features of the Agama engine, including the use of the labels.txt file and access to the Jans Auth Server's resource bundles.
  5. jans-auth-server/agama/engine/src/main/java/io/jans/agama/engine/page/Page.java: The changes in this file focus on improving the organization and maintainability of the Page class, including the use of dependency injection and the handling of the dataModel.
  6. jans-auth-server/agama/engine/src/main/java/io/jans/ads/Deployer.java: This file contains changes related to the deployment and management of Agama projects, including the handling of the deployment lifecycle, flow management, and asset management.
  7. jans-auth-server/agama/engine/src/main/java/io/jans/agama/engine/service/MessagesService.java: The changes in this file focus on improving the performance and reliability of the MessagesService class, including the use of ApplicationScoped and the handling of exceptions.
  8. jans-auth-server/agama/engine/src/main/java/io/jans/agama/engine/service/LabelsService.java: The changes in this file are related to the LabelsService class, which is responsible for managing and retrieving localized labels for the application. The changes highlight the importance of input validation and error handling when dealing with localization and internationalization features.

Code Analysis

We ran 9 analyzers against 8 files and 0 analyzers had findings. 9 analyzers had no findings.

Riskiness

🟢 Risk threshold not exceeded.

View PR in the DryRun Dashboard.

@mo-auto
Copy link
Member

mo-auto commented Nov 15, 2024

Error: Hi @jgomer2001, You did not reference an open issue in your PR. I attempted to create an issue for you.
Please update that issues' title and body and make sure I correctly referenced it in the above PRs body.

@mo-auto mo-auto added area-documentation Documentation needs to change as part of issue or PR comp-agama Touching folder /agama comp-docs Touching folder /docs comp-jans-auth-server Component affected by issue or PR kind-feature Issue or PR is a new feature request labels Nov 15, 2024
Copy link

Copy link

Copy link

@yuriyz yuriyz merged commit d20b4c4 into main Nov 18, 2024
11 checks passed
@yuriyz yuriyz deleted the agama-issue_8675 branch November 18, 2024 09:56
Copy link

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-documentation Documentation needs to change as part of issue or PR comp-agama Touching folder /agama comp-docs Touching folder /docs comp-jans-auth-server Component affected by issue or PR kind-feature Issue or PR is a new feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(agama): facilitate localization
5 participants