Skip to content

realmd: Rearrange permit and deny method#234

Merged
jakub-vavra-cz merged 1 commit intoSSSD:masterfrom
shridhargadekar:realm_e
Feb 25, 2026
Merged

realmd: Rearrange permit and deny method#234
jakub-vavra-cz merged 1 commit intoSSSD:masterfrom
shridhargadekar:realm_e

Conversation

@shridhargadekar
Copy link
Contributor

Simplifying permit and deny method of realm
to write testcases flexibly

realm permit can allow/deny users, groups
realm deny deny log in on entire realm

@gemini-code-assist
Copy link

Summary of Changes

Hello @shridhargadekar, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines the RealmUtils class by simplifying the permit and deny methods. The primary goal is to enhance the flexibility of these methods, enabling more direct and varied testing of realm command functionalities without being constrained by specific parameter structures. This refactoring improves the adaptability of the utility for different realm command invocations.

Highlights

  • Refactored permit method: The permit method in RealmUtils has been refactored to remove the explicit user and withdraw parameters. It now accepts only a generic args list, allowing for more flexible construction of realm permit commands.
  • Refactored deny method: The deny method in RealmUtils has been refactored to directly execute the realm deny command. Previously, it called the permit method with a withdraw=True flag. Similar to permit, it now only accepts a generic args list for flexibility.
  • Simplified realm utility interface: The changes simplify the permit and deny methods of the RealmUtils class, making it easier to write test cases that interact with the realm command-line utility by directly passing arguments.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • sssd_test_framework/utils/realmd.py
    • Removed CLIBuilderArgs import as it is no longer used.
    • Modified the permit method to accept only a list of arguments, removing specific user and withdraw parameters.
    • Modified the deny method to directly execute realm deny with a list of arguments, replacing its previous reliance on the permit method.
    • Updated docstrings for permit and deny to reflect the new parameter structure and functionality.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request simplifies the permit and deny methods in RealmUtils to enhance flexibility for test cases. The changes involve removing specific user and withdraw parameters, allowing the methods to accept a generic list of arguments for the realm command. This makes the methods more adaptable to various realm permit and realm deny scenarios. However, there are a couple of minor issues related to code cleanliness and docstring accuracy that should be addressed.

@aborah-sudo
Copy link
Contributor

@shridhargadekar if there are any existing tests, did you manage to check them with this new setup ?

@shridhargadekar
Copy link
Contributor Author

Hi @aborah-sudo the tests are at realm_permit.
Tests are passing.

@aborah-sudo
Copy link
Contributor

Hi @aborah-sudo the tests are at realm_permit. Tests are passing.

Thanks, code looks good to me.

Simplifying permit and deny method of realm
to write testcases flexibly

`realm permit` can allow/deny users, groups
`realm deny` deny log in on entire realm
@jakub-vavra-cz jakub-vavra-cz merged commit ee0fb02 into SSSD:master Feb 25, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants