Giter Club home page Giter Club logo

Comments (2)

jombooth avatar jombooth commented on June 13, 2024

Hi @staubertTim,

You can add additional validators here, assuming you're building LS from source:

# Password validation:
# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'},
{'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'},
{'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator'},
{'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'},
]

I would have thought testtest would be blocked by CommonPasswordValidator, but not sure on that.

from label-studio.

staubertTim avatar staubertTim commented on June 13, 2024

Hi @jombooth,

thank you for taking the time to answer!
That's what I thought as well so I went ahead and changed those - WITH NO EFFECT.
I'm afraid these Django Validators are not even used. You can verify that by using these Validators and then building from source:

AUTH_PASSWORD_VALIDATORS = [
{'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
'OPTIONS': {'min_length': 10},
},
{'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator'},
{'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'},
]

Normally Label Studio Passwords need to be 8 characters long and I would expect that they now need to be ten characters long - which is NOT the case, although this parameter is build in by default into the MinimumLengthValidator.

I then traced error messages from the frontend and realized that password checking is done in label_studio/users/forms.py
in the class UserSignupForm and the clean_password method where the only applied check is:

if len(password) < PASS_MIN_LENGTH:
raise forms.ValidationError(PASS_LENGTH_ERROR)

Once I changed PASS_MIN_LENGTH to 10 I could actually only use passwords that are ten characters long.
I will now try to monkey-patch this method in my docker build. But still I think it is suboptimal to have these Django validators and not apply them (if I am not mistaken).

Is this intended or a bug? Happy to hear your thoughts.

from label-studio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.