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

Replacing magic numbers with constant #338

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

hasskell
Copy link
Contributor

Notes

While I was reading though code notice some magic numbers on FIPS password length, nothing really stopping FIPS standards to change password length in future to increase security posture. This will require several modifications in code which is error prone. Replacing magic numbers with MIN_PASSWORD_LENGTH constant.

Testing done

Done testing with mvn clean insatll

[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
Running tests for org.jenkins-ci.plugins:mailer:999999-SNAPSHOT
[INFO] Running hudson.tasks.MailAddressResolverTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.094 s -- in hudson.tasks.MailAddressResolverTest
[INFO] Running hudson.tasks.MailSenderTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.247 s -- in hudson.tasks.MailSenderTest
[INFO] Running hudson.tasks.MailerTest
[INFO] Tests run: 20, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 133.7 s -- in hudson.tasks.MailerTest
[INFO] Running jenkins.plugins.mailer.FipsModeTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 22.00 s -- in jenkins.plugins.mailer.FipsModeTest
[INFO] Running jenkins.plugins.mailer.MailerJCasCCompatibilityTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.165 s -- in jenkins.plugins.mailer.MailerJCasCCompatibilityTest
[INFO] Running jenkins.plugins.mailer.tasks.MailAddressFilterTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.073 s -- in jenkins.plugins.mailer.tasks.MailAddressFilterTest
[INFO] Running jenkins.plugins.mailer.tasks.MimeMessageBuilderTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 9.101 s -- in jenkins.plugins.mailer.tasks.MimeMessageBuilderTest
[INFO] Running org.jenkins_ci.plugins.mailer.InjectedTest
[INFO] Tests run: 80, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.083 s -- in org.jenkins_ci.plugins.mailer.InjectedTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 120, Failures: 0, Errors: 0, Skipped: 0

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • [N/A] Link to relevant issues in GitHub or Jira
  • [N/A] Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@hasskell hasskell requested a review from a team as a code owner January 19, 2025 12:22
Copy link
Member

@rsandell rsandell left a comment

Choose a reason for hiding this comment

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

Perhaps I would have named it something mentioning FiPS to not confuse a first glance reader, but that's just a nit.

@alecharp alecharp added the chore label Jan 20, 2025
@alecharp
Copy link
Member

I won't trigger a release for this change, but thank you for the contribution.

@alecharp alecharp added this pull request to the merge queue Jan 20, 2025
Merged via the queue into jenkinsci:master with commit 80d5088 Jan 20, 2025
17 checks passed
@hasskell
Copy link
Contributor Author

Perhaps I would have named it something mentioning FiPS to not confuse a first glance reader, but that's just a nit.

That makes sense, Ill have another few changes coming up so will address this in upcoming PR

@hasskell
Copy link
Contributor Author

I won't trigger a release for this change, but thank you for the contribution.

Sure, sure, there is no urgency just a code sanity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants