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

[BUG] formfield type password length check #1336

Open
falkheiland opened this issue Mar 25, 2024 · 8 comments
Open

[BUG] formfield type password length check #1336

falkheiland opened this issue Mar 25, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@falkheiland
Copy link

when adding a new app and defining a formfield for a long string as a password field - with or without the specification of min and max properties the error message

{{ formfieldname }} must be between and characters

is shown, an installation is not possible. the used length of the used string is 170 chars

@falkheiland falkheiland added the bug Something isn't working label Mar 25, 2024
@hex-developer
Copy link
Contributor

The code for handling password length is here:

case 'password':
if (!validator.isLength(value, { min: field.min || 0, max: field.max || 100 })) {
return translator('APP_INSTALL_FORM_ERROR_BETWEEN_LENGTH', { label: field.label, min: field.min, max: field.max });
}
break;

If min was defined in the form field config, it's value is compared to the input length, otherwise it defaults to 0.
If max was defined in the form field config, it's value is compared to the input length, otherwise it defaults to 100.

If max isn't defined, it makes sense that a 170 char string won't be allowed. Otherwise, there shouldn't be a problem. Do you have a specific app with this issue?

@falkheiland
Copy link
Author

falkheiland commented Apr 14, 2024

when creating an oidc / oauth2 provider in authentik, then there is a client secret created, a string with 129 chars. if you want to create an app, which forces you to have an external auth and you want to support oidc and since this client secret is a secret, it should be treated / used as a password in tipi.

@hex-developer
Copy link
Contributor

That is correct. Maybe that app's password length limit should be changed. You can open an issue on the app store repo.

@meienberger
Copy link
Collaborator

This should not be an issue if max is set to a higher number. Maybe there is a bug somewhere. Have you an app draft to share in which I could reproduce the issue?

@falkheiland
Copy link
Author

falkheiland commented Apr 15, 2024

That is correct. Maybe that app's password length limit should be changed. You can open an issue on the app store repo.

i just now really understood the reply, @hex-developer - sorry :(
if necessary i can recreate the issue. Update: you apparently can just move issue to other repos.

Have you an app draft to share in which I could reproduce the issue?

i changed that fields type in my example to get it working to a string - but i will make a new example / test app!

@falkheiland
Copy link
Author

falkheiland commented Apr 15, 2024

Test Branch:

https://github.com/falkheiland/runtipi-appstore/tree/issue/1336

Test-App:

outline-1 (outline without integrated oidc service, to use with external ones, like authentik etc.)

OIDC_CLIENT_SECRET:

I6jxaHDqtTNjPDxrVAeeZUzHytmZppSxhHyqX6swQx5L89kF0Tg2CQtIECHDkyk0naJglZtLWAGHz931X6FhhgKxxEOCgvf47O6eb9ZwZtdRYDblpPKhQhAz0v5RtJK4

image

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label May 16, 2024
@meienberger meienberger removed the stale label May 16, 2024
@falkheiland falkheiland changed the title [BUG] formfield type password length ceck [BUG] formfield type password length check May 16, 2024
@steveiliop56
Copy link
Collaborator

@meienberger that happened due to the switch to the radix component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants