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

feat(jans-cli-tui): config-api configuration #9127

Merged
merged 13 commits into from
Sep 2, 2024

Conversation

devrimyatar
Copy link
Contributor

@devrimyatar devrimyatar commented Aug 6, 2024

closes #8598

@ossdhaval This PR needs TUI documentation update. After this PR merged please update TUI docs and add Config API screen:

image

  • Relevant documentation has been updated if any (i.e. user guides, installation and configuration guides, technical design docs etc)

Signed-off-by: Mustafa Baser <mbaser@mail.com>
@devrimyatar devrimyatar added area-documentation Documentation needs to change as part of issue or PR comp-jans-cli-tui Component affected by issue or PR kind-feature Issue or PR is a new feature request labels Aug 6, 2024
@devrimyatar devrimyatar requested review from yuriyz and pujavs August 6, 2024 10:19
Copy link

dryrunsecurity bot commented Aug 6, 2024

DryRun Security Summary

The pull request covers various updates to the Jans CLI-TUI application, including improvements to the handling of list-type values, Admin UI functionality, documentation for the Jans Config-API configuration, and enhancements to utility functions and user interface components, with a focus on ensuring the overall security of the application.

Expand for full summary

Summary:

The code changes in this pull request cover various aspects of the Jans CLI-TUI application, including updates to the handling of list-type values in the getTitledText function, improvements to the Admin UI functionality, documentation updates for the Jans Config-API configuration, and enhancements to the utility functions and user interface components.

From an application security perspective, the changes do not appear to introduce any obvious security vulnerabilities. However, it is important to review the entire codebase and the application's architecture to ensure that it follows best practices for secure application development. Key areas to focus on include input validation, authentication and authorization, logging and auditing, secure communication, and the handling of sensitive data.

The documentation updates for the Jans Config-API configuration are particularly noteworthy, as they highlight several security-related settings and controls, such as API protection, CORS configuration, audit logging, and user attribute validation. These settings are critical for ensuring the overall security of the application.

Files Changed:

  1. jans-cli-tui/cli_tui/jans_cli_tui.py: The changes ensure that list-type values are properly displayed in the TextArea widget, which does not introduce any obvious security concerns.

  2. docs/admin/config-guide/config-api-config/janssen-config-api-configuration.md: The documentation updates provide a comprehensive overview of the different configuration tools available for the Jans Config-API, with a strong emphasis on security-related settings and controls.

  3. jans-cli-tui/cli_tui/plugins/040_admin_ui/main.py: The changes focus on the Admin UI functionality, including the management of admin roles and permissions. While the code appears to handle these operations securely, it is important to ensure that the underlying API endpoints and data validation are also secure.

  4. docs/admin/config-guide/config-tools/config-api/config.md: This documentation update provides detailed information on managing the Jans Config-API configuration, highlighting the security-critical settings such as OAuth authorization, API protection, and user attribute management.

  5. jans-cli-tui/cli_tui/utils/utils.py: The changes introduce a new attribute to the common_data object, which does not appear to have any direct security implications. However, it is recommended to review the get_item_data method and the check_email function to ensure that they handle input validation properly.

  6. jans-cli-tui/cli_tui/plugins/140_config_api/main.py: The changes in this file are focused on the Jans Config API plugin, which allows users to configure various settings related to the Jans Config API. The code appears to handle these operations securely, but it is important to ensure that input validation, authentication, authorization, logging, and secure communication are properly implemented.

  7. jans-cli-tui/cli_tui/utils/background_tasks.py: The changes in this file are focused on improving the efficiency and reliability of the attribute retrieval process, which is an important aspect of the application's functionality. The code demonstrates good practices, such as error handling, pagination, and separation of concerns, which help to mitigate potential security risks.

  8. jans-cli-tui/cli_tui/wui_components/jans_label_container.py: The changes in this file are focused on improving the functionality and appearance of the label container, without introducing any obvious security concerns. However, it is recommended to review the input validation and secure callback implementation.

  9. jans-cli-tui/cli_tui/wui_components/jans_label_widget.py: The changes in this file are focused on improving the functionality of the label widget, including the addition of a filtering mechanism. While the changes do not appear to introduce any security vulnerabilities, it is important to ensure that user input is properly validated and that the application's behavior aligns with the expected permissions and access levels.

Code Analysis

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

Riskiness

🟢 Risk threshold not exceeded.

View PR in the DryRun Dashboard.

@devrimyatar devrimyatar requested a review from ossdhaval August 6, 2024 10:21
@ossdhaval
Copy link
Contributor

Hi @devrimyatar Thanks for high-lighting the need for update to the documentation for this PR.

There are two things that I can suggest. And these are what we are striving to achieve too with respect to how we tackle the documentation.

  1. Let's make the documentation changes part of the same development PR where the code is being changed. Meaning the code and docs should flow together.
  2. Developers have to contribute/update/create the related documentation. I'll review the doc changes to ensure that they are consistent with the other existing documentation, the documentation guidelines and bit of proofreading too.

Both of the above points will help us keep up the documentation with the constantly evolving code and the Janssen Server's feature set.

For this PR, mention me in the PR comments once you add the documentation that is ready for review.

yuriyz
yuriyz previously approved these changes Aug 6, 2024
@yuriyz yuriyz enabled auto-merge (squash) August 6, 2024 11:39
Signed-off-by: Mustafa Baser <mbaser@mail.com>
@devrimyatar devrimyatar marked this pull request as draft August 11, 2024 09:22
auto-merge was automatically disabled August 11, 2024 09:22

Pull request was converted to draft

@devrimyatar devrimyatar marked this pull request as ready for review August 28, 2024 09:58
Copy link

Copy link

Copy link

Copy link

Copy link

Copy link

Copy link

Copy link

Quality Gate Passed Quality Gate passed for 'keycloak-integration-parent'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

@ossdhaval
Copy link
Contributor

There is this document that has a good amount of overlap with your document. I'll need to merge contents.

Signed-off-by: ossdhaval <343411+ossdhaval@users.noreply.github.com>
Signed-off-by: ossdhaval <343411+ossdhaval@users.noreply.github.com>
Signed-off-by: ossdhaval <343411+ossdhaval@users.noreply.github.com>
@ossdhaval ossdhaval requested a review from yuriyz September 2, 2024 07:31
Copy link

sonarqubecloud bot commented Sep 2, 2024

Quality Gate Failed Quality Gate failed for 'jans-cli'

Failed conditions
14 New Code Smells (required ≤ 8)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Copy link

sonarqubecloud bot commented Sep 2, 2024

@devrimyatar devrimyatar merged commit bdf5707 into main Sep 2, 2024
11 checks passed
@devrimyatar devrimyatar deleted the jans-cli-tui-config-api-config-8598 branch September 2, 2024 08:47
yuriyz pushed a commit that referenced this pull request Nov 7, 2024
* feat(jans-cli-tui): config-api configuration

Signed-off-by: Mustafa Baser <mbaser@mail.com>

* fix(jans-cli-tui): display save info on dialog for config-api config

Signed-off-by: Mustafa Baser <mbaser@mail.com>

* docs(jans-cli-tui): config-api configuratios

Signed-off-by: Mustafa Baser <mbaser@mail.com>

* docs(jans-cli-tui): config-api swagger reference

Signed-off-by: Mustafa Baser <mbaser@mail.com>

* docs(config-api): update config api

Signed-off-by: ossdhaval <343411+ossdhaval@users.noreply.github.com>

* docs: edit the update section

Signed-off-by: ossdhaval <343411+ossdhaval@users.noreply.github.com>

* docs: proofreading changes

Signed-off-by: ossdhaval <343411+ossdhaval@users.noreply.github.com>

---------

Signed-off-by: Mustafa Baser <mbaser@mail.com>
Signed-off-by: ossdhaval <343411+ossdhaval@users.noreply.github.com>
Co-authored-by: ossdhaval <343411+ossdhaval@users.noreply.github.com>
Former-commit-id: bdf5707
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-jans-cli-tui 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.

UI for managing Config API configuration properties
4 participants