How to use the bless.request.bless_request.validate_user function in bless

To help you get started, we’ve selected a few bless examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Netflix / bless / tests / request / test_bless_request.py View on Github external
def test_validate_user_disabled(test_input):
    validate_user(test_input, USERNAME_VALIDATION_OPTIONS.disabled)
github Netflix / bless / tests / request / test_bless_request.py View on Github external
def test_validate_user_debian(test_input):
    validate_user(test_input, USERNAME_VALIDATION_OPTIONS.debian)
github Netflix / bless / tests / request / test_bless_request.py View on Github external
def test_validate_user(test_input):
    validate_user(test_input, USERNAME_VALIDATION_OPTIONS.useradd)
github Netflix / bless / tests / request / test_bless_request.py View on Github external
def test_validate_user_contains_junk(test_input):
    with pytest.raises(ValidationError) as e:
        validate_user(test_input, USERNAME_VALIDATION_OPTIONS.useradd)
    assert str(e.value) == 'Username contains invalid characters.'
github Netflix / bless / tests / request / test_bless_request.py View on Github external
def test_validate_user_blacklist(test_input):
    with pytest.raises(ValidationError) as e:
        validate_user(test_input, USERNAME_VALIDATION_OPTIONS.principal, 'root|admin.*|balrog|.+\'.*')
    assert str(e.value) == 'Username contains invalid characters.'
github Netflix / bless / tests / request / test_bless_request.py View on Github external
def test_validate_user_too_long():
    with pytest.raises(ValidationError) as e:
        validate_user('a33characterusernameyoumustbenuts', USERNAME_VALIDATION_OPTIONS.useradd)
    assert str(e.value) == 'Username is too long.'
github Netflix / bless / tests / request / test_bless_request.py View on Github external
def test_invalid_user_email(test_input):
    with pytest.raises(ValidationError) as e:
        validate_user(test_input, USERNAME_VALIDATION_OPTIONS.email)
    assert str(e.value) == 'Invalid email address.'
github Netflix / bless / tests / request / test_bless_request.py View on Github external
def test_validate_user_email(test_input):
    validate_user(test_input, USERNAME_VALIDATION_OPTIONS.email)
github Netflix / bless / tests / request / test_bless_request.py View on Github external
def test_invalid_call_of_validate_user():
    with pytest.raises(ValidationError) as e:
        validate_user('test', None)
    assert str(e.value) == 'Invalid username validator.'
github Netflix / bless / tests / request / test_bless_request.py View on Github external
def test_validate_user_debian_too_long():
    with pytest.raises(ValidationError) as e:
        validate_user('a33characterusernameyoumustbenuts', USERNAME_VALIDATION_OPTIONS.debian)
    assert str(e.value) == 'Username is too long.'