Skip to content

Adding authselect common configurations#256

Draft
danlavu wants to merge 1 commit into
SSSD:masterfrom
danlavu:authselect-custom
Draft

Adding authselect common configurations#256
danlavu wants to merge 1 commit into
SSSD:masterfrom
danlavu:authselect-custom

Conversation

@danlavu

@danlavu danlavu commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@danlavu
danlavu marked this pull request as draft July 9, 2026 15:34

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for creating and configuring custom Authselect profiles in the test framework. It updates AuthselectUtils to accept a filesystem utility, handle cleanup of custom profiles, and adds AuthselectCommonConfiguration to set up common PAM configurations like offline logins and SSSD domains. The review feedback suggests removing a redundant runtime import and an unused self statement, stripping leading indentation from the multiline PAM stack strings before writing them to files, and renaming the loop variable files to a singular form for better clarity.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

"AuthselectUtils",
]

from pytest_mh.utils.fs import LinuxFileSystem

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Since from __future__ import annotations is used and LinuxFileSystem is only used as a type hint, the runtime import is redundant. It is already imported under if TYPE_CHECKING: on line 10, so this runtime import can be safely removed.

Comment thread sssd_test_framework/utils/authselect.py Outdated
Comment on lines +144 to +145

self

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The statement self on its own line is redundant and has no effect. It should be removed.

session required pam_unix.so
session optional pam_sss.so forward_pass
"""
if not pam_files:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The multiline string stack contains leading indentation for each line. When written to the PAM configuration files, this leading whitespace will be preserved, making the files messy. It is recommended to strip the leading indentation from each line before writing.

        stack = '\\n'.join(line.strip() for line in stack.splitlines()).strip()\n        if not pam_files:

Comment on lines +180 to +181
for files in pam_files:
self.authselect.fs.write(f"{self.profile_path}/{profile_name}/{files}", stack)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The loop variable files is plural, but it represents a single file name in each iteration. It should be singular (e.g., pam_file or file_name) to improve readability and avoid confusion.

        for pam_file in pam_files:\n            self.authselect.fs.write(f'{self.profile_path}/{profile_name}/{pam_file}', stack)

session required pam_unix.so
session optional pam_sss.so
"""
if not pam_files:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The multiline string stack contains leading indentation for each line. When written to the PAM configuration files, this leading whitespace will be preserved, making the files messy. It is recommended to strip the leading indentation from each line before writing.

        stack = '\\n'.join(line.strip() for line in stack.splitlines()).strip()\n        if not pam_files:

Comment on lines +221 to +222
for files in pam_files:
self.authselect.fs.write(f"{self.profile_path}/{profile_name}/{files}", stack)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The loop variable files is plural, but it represents a single file name in each iteration. It should be singular (e.g., pam_file or file_name) to improve readability and avoid confusion.

        for pam_file in pam_files:\n            self.authselect.fs.write(f'{self.profile_path}/{profile_name}/{pam_file}', stack)

@danlavu
danlavu force-pushed the authselect-custom branch from 9c9c284 to c57dfa0 Compare July 9, 2026 15:50
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.

1 participant