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

Add case insensitive constraint to username #27266

Merged
merged 1 commit into from Oct 31, 2022

Conversation

ephraimbuddy
Copy link
Contributor

@ephraimbuddy ephraimbuddy commented Oct 25, 2022

This helps us to recognize usernames properly

@ephraimbuddy ephraimbuddy changed the title Don't lowercase username when looking up user Add case insensitive constraint to username Oct 25, 2022
@ephraimbuddy ephraimbuddy force-pushed the case-sensitive branch 2 times, most recently from c2c89fd to e837edf Compare October 25, 2022 23:28
Copy link
Member

@jedcunningham jedcunningham left a comment

Choose a reason for hiding this comment

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

I feel like we should add a pre-migration check to look for duplicates before it fails the migration? Like we do for duplicated connection ids?

Comment on lines 956 to 957
f'Seems you have non unique username in {model.__table__.name} table.\n' # type: ignore
'You have to manage those duplicate usernames '
Copy link
Member

Choose a reason for hiding this comment

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

This needs to say something about mixed-case, as otherwise users could be forgiven for thinking that Test and test are different users.

And "manage" isn't clear either -> "delete or rename"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed. You can take another look. Thanks

@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Oct 26, 2022
@ephraimbuddy ephraimbuddy added this to the Airflow 2.4.3 milestone Oct 26, 2022
This helps us to recognize usernames properly

fixup! Add case insensitive constraint to username

check username is unique in check migrations
if dups:
yield (
f'Seems you have mixed case usernames in {model.__table__.name} table.\n' # type: ignore
'You have to rename or delete those mixed case usernames '
Copy link
Member

Choose a reason for hiding this comment

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

❤️ love the detailed error message

@ephraimbuddy ephraimbuddy merged commit 1d25105 into apache:main Oct 31, 2022
@ephraimbuddy ephraimbuddy deleted the case-sensitive branch October 31, 2022 17:03
ephraimbuddy added a commit that referenced this pull request Nov 9, 2022
This helps us to recognize usernames properly

(cherry picked from commit 1d25105)
ephraimbuddy added a commit that referenced this pull request Nov 9, 2022
This helps us to recognize usernames properly

(cherry picked from commit 1d25105)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:webserver Webserver related Issues type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants