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

User and role bug fixed #435

Merged

Conversation

ajithandrewj
Copy link

Description

The below issue is fixed
1 Incorrect error message, for bad password.

Type of Change

  • [ yes ] Bug fix
  • [ no ] New feature
  • [ no ] Breaking change
  • [ no ] Documentation update

Checklist

  • [ yes ] My code follows the style guidelines of this project
  • [ yes ] I have performed a self-review of my own code
  • [ yes ] I have commented my code, particularly in hard-to-understand areas
  • [ no ] I have made corresponding changes to the documentation
  • [ yes ] My changes generate no new warnings
  • [ yes ] I have added tests that prove my fix is effective or that my feature works
  • [ yes ] New and existing unit tests pass locally with my changes
  • [ no ] Any dependent changes have been merged and published in downstream modules
  • [ yes ] All the sanity checks have been completed and the sanity test cases have been executed

Ansible Best Practices

  • [ yes ] Tasks are idempotent (can be run multiple times without changing state)
  • [ no ] Variables and secrets are handled securely (e.g., using ansible-vault or environment variables)
  • [ yes ] Playbooks are modular and reusable
  • [ no ] Handlers are used for actions that need to run on change

Documentation

  • [ yes ] All options and parameters are documented clearly.
  • [ yes ] Examples are provided and tested.
  • [ yes ] Notes and limitations are clearly stated.

Screenshots (if applicable)

Notes to Reviewers

for password_regex in password_regexs:
if password_regex.match(password):
is_valid_password = True
is_valid_password_check1 = True
Copy link
Owner

Choose a reason for hiding this comment

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

        self.log("Password meets character type and length requirements.", "INFO")

Copy link
Author

Choose a reason for hiding this comment

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

Updated the code accordingly.

- The password must include characters from at least three of the following classes:
lowercase letters, uppercase letters, digits, and special characters.
"""
is_valid_password = False
is_valid_password_check1 = False
Copy link
Owner

Choose a reason for hiding this comment

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

meets_character_requirements = False

Copy link
Author

Choose a reason for hiding this comment

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

Updated the code accordingly.

- The password must include characters from at least three of the following classes:
lowercase letters, uppercase letters, digits, and special characters.
"""
is_valid_password = False
is_valid_password_check1 = False
is_valid_password_check2 = False
Copy link
Owner

Choose a reason for hiding this comment

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

passes_sequence_repetition_check = False

Copy link
Author

Choose a reason for hiding this comment

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

Updated the code accordingly.

for password_regex in password_regexs:
if password_regex.match(password):
is_valid_password = True
is_valid_password_check1 = True
break

Copy link
Owner

Choose a reason for hiding this comment

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

if not meets_character_requirements:
    self.log("Password failed character type and length validation.", "ERROR")

Copy link
Author

Choose a reason for hiding this comment

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

Updated the code accordingly.

if not is_valid_password:
self.log("Checking that the password does not contain repetitive or sequential characters.", "DEBUG")
if re.match(password_sequence_repetitive_regex, password):
is_valid_password_check2 = True
Copy link
Owner

Choose a reason for hiding this comment

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

    passes_sequence_repetition_check = True
    self.log("Password passed repetitive and sequential character checks.", "INFO")
else:
    self.log("Password failed repetitive or sequential character validation.", "ERROR")

Copy link
Author

Choose a reason for hiding this comment

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

Updated the code accordingly.

Copy link
Author

Choose a reason for hiding this comment

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

Also tested the changes Madhan

@madhansansel madhansansel merged commit 564df71 into madhansansel:main Oct 17, 2024
6 checks passed
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.

2 participants