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

fix: ensure GeneratePassword returns password with mixed cases #8904

Conversation

yipeng1030
Copy link
Contributor

@yipeng1030 yipeng1030 commented Feb 10, 2025

fix #8837

Problem: Mixed-case password doesn't guarantee having both uppercase and lowercase.
Fix: Introduce EnsureMixedCase() post-processor to guarantee at least one uppercase and one lowercase.
Testing: Verified consistent generation with same seed, plus enforced mixed-case distribution.

@github-actions github-actions bot added the size/L Denotes a PR that changes 100-499 lines. label Feb 10, 2025
@apecloud-bot apecloud-bot added pre-approve Fork PR Pre Approve Test and removed pre-approve Fork PR Pre Approve Test labels Feb 10, 2025
@yipeng1030 yipeng1030 changed the title fix: ensure GeneratePassword return password with both upper and lower case fix: ensure GeneratePassword returns password with mixed cases Feb 10, 2025
@yipeng1030 yipeng1030 marked this pull request as ready for review February 10, 2025 04:54
@yipeng1030 yipeng1030 requested a review from a team as a code owner February 10, 2025 04:54
Copy link

codecov bot commented Feb 10, 2025

Codecov Report

Attention: Patch coverage is 78.00000% with 11 lines in your changes missing coverage. Please review.

Project coverage is 60.18%. Comparing base (a5bcd50) to head (92f2889).
Report is 99 commits behind head on main.

Files with missing lines Patch % Lines
pkg/common/password.go 78.00% 7 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8904      +/-   ##
==========================================
- Coverage   60.28%   60.18%   -0.10%     
==========================================
  Files         376      387      +11     
  Lines       45858    46865    +1007     
==========================================
+ Hits        27645    28208     +563     
- Misses      15614    15958     +344     
- Partials     2599     2699     +100     
Flag Coverage Δ
unittests 60.18% <78.00%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@apecloud-bot apecloud-bot added pre-approve Fork PR Pre Approve Test and removed pre-approve Fork PR Pre Approve Test labels Feb 10, 2025
pkg/common/password.go Outdated Show resolved Hide resolved
@yipeng1030 yipeng1030 requested a review from Y-Rookie as a code owner February 10, 2025 07:59
@apecloud-bot apecloud-bot added pre-approve Fork PR Pre Approve Test and removed pre-approve Fork PR Pre Approve Test labels Feb 10, 2025
@apecloud-bot apecloud-bot added pre-approve Fork PR Pre Approve Test and removed pre-approve Fork PR Pre Approve Test labels Feb 10, 2025
@yipeng1030 yipeng1030 force-pushed the feature/support_generate_mix_upper_and_lower_password branch from 27b892b to f7db26f Compare February 10, 2025 10:41
@apecloud-bot apecloud-bot added pre-approve Fork PR Pre Approve Test and removed pre-approve Fork PR Pre Approve Test labels Feb 10, 2025
@yipeng1030 yipeng1030 merged commit 972c0d8 into apecloud:main Feb 10, 2025
18 checks passed
@github-actions github-actions bot added this to the Release 0.9.3 milestone Feb 10, 2025
@yipeng1030
Copy link
Contributor Author

/cherry-pick release-1.0-beta

@apecloud-bot
Copy link
Collaborator

🤖 says: cherry pick action finished successfully 🎉!
See: https://github.com/apecloud/kubeblocks/actions/runs/13240140750

apecloud-bot pushed a commit that referenced this pull request Feb 10, 2025
@yipeng1030
Copy link
Contributor Author

/cherry-pick release-0.9

@apecloud-bot
Copy link
Collaborator

🤖 says: Error cherry-picking.

CONFLICT (modify/delete): controllers/apps/cluster/transformer_cluster_sharding_account.go deleted in HEAD and modified in 972c0d8 (fix: ensure GeneratePassword returns password with mixed cases (#8904)). Version 972c0d8 (fix: ensure GeneratePassword returns password with mixed cases (#8904)) of controllers/apps/cluster/transformer_cluster_sharding_account.go left in tree.
CONFLICT (modify/delete): controllers/apps/component/transformer_component_account.go deleted in HEAD and modified in 972c0d8 (fix: ensure GeneratePassword returns password with mixed cases (#8904)). Version 972c0d8 (fix: ensure GeneratePassword returns password with mixed cases (#8904)) of controllers/apps/component/transformer_component_account.go left in tree.
Auto-merging pkg/common/password.go
Auto-merging pkg/common/password_test.go
error: could not apply 972c0d8... fix: ensure GeneratePassword returns password with mixed cases (#8904)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config advice.mergeConflict false"

@apecloud-bot
Copy link
Collaborator

🤖 says: ‼️ cherry pick action failed.
See: https://github.com/apecloud/kubeblocks/actions/runs/13302963925

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pre-approve Fork PR Pre Approve Test size/L Denotes a PR that changes 100-499 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement] passwordGenerationPolicy support both upper and lower case guaranteed
4 participants