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

webui: Show warning when trying to use non-ASCII LUKS passphrase #5102

Conversation

vojtechtrefny
Copy link
Contributor

We show this warning in the GTK UI so we should show it in the WebUI too.

Resolves: rhbz#2234518

image

Copy link
Member

@jkonecny12 jkonecny12 left a comment

Choose a reason for hiding this comment

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

Looks great to me. You are so fast!

@jkonecny12
Copy link
Member

I just wonder, would someone from the Cockpit team be willing to take a look if there is not a function already for ASCII characters check? @martinpitt

@martinpitt
Copy link
Contributor

martinpitt commented Aug 30, 2023

Something like this?

const onlyAscii = str => [...str].every(char => char.charCodeAt(0) <= 127);

@vojtechtrefny vojtechtrefny force-pushed the master_encryption-ascii-warning branch from 59cff8f to 8214132 Compare August 31, 2023 09:24
We show this warning in the GTK UI so we should show it in the
WebUI too.

Resolves: rhbz#2234518
@vojtechtrefny vojtechtrefny force-pushed the master_encryption-ascii-warning branch from 8214132 to e2bdc86 Compare August 31, 2023 09:24
@vojtechtrefny
Copy link
Contributor Author

/kickstart-test --waive webui-only

Copy link
Contributor

@M4rtinK M4rtinK left a comment

Choose a reason for hiding this comment

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

Looks good to me - just a suggestion about the error message. :)

variant="warning"
component="li"
>
{_("The passphrase you have provided contains non-ASCII characters. You may not be able to switch between keyboard layouts when typing it.")}
Copy link
Contributor

Choose a reason for hiding this comment

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

I would change the formulation a bit, as both sentences look kinda disjoint. Maybe something like:

"The passphrase you have provided contains non-ASCII characters, which you might not be able to enter, as keyboard switching if often not available when LUKS passphrase is requested."

Maybe @VladimirSlavik might also have some ideas. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The message is copied from pyanaconda/core/constants.py to match the warning you get in the GTK UI. If you have some suggestion, we should change it everywhere.

@vojtechtrefny vojtechtrefny merged commit 42e7b19 into rhinstaller:master Aug 31, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants