Giter Club home page Giter Club logo

password_policy's People

Contributors

adam-bergstein avatar craigmoore avatar damontgomery avatar eclipsegc avatar lahoosascoots avatar nerdstein avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

password_policy's Issues

Event subscriber throwing errors upon install

Fatal error: Call to a member function getValue() on a non-object in /var/www/drupal/modules/contrib/password_policy/src/EventSubscriber/PasswordPolicyEventSubscriber.php on line 32

Error on User Register

Error on new user registration

Drupal\Core\Entity\EntityStorageException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'field_password_expiration_value' at row 1: INSERT INTO {user__field_password_expiration} (entity_id, revision_id, bundle, delta, langcode, field_password_expiration_value) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => 2 [:db_insert_placeholder_1] => 2 [:db_insert_placeholder_2] => user [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => en [:db_insert_placeholder_5] => ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 757 of /opt/devdesktop2/drupal/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

Add administrative bypass permission

Users granted a new "Bypass Password Policies" permission would not be forced to have password policies on user add/edit form.

Useful for user creation and admin resetting of passwords

Full audit

  1. identify anything that is broken
  2. identify any gaps in automated tests
  3. make general observations for improving UX

Cannot edit user form

Uncaught PHP Exception Drupal\Core\Entity\EntityStorageException: "Entity validation was skipped." at /var/www/drupal/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php line 755, referer: http://d8.dev/user/1/edit

Steps:

  1. go to /user/1/edit
  2. try to save form

Evaluate Unit Tests

  • Look at code base and determine what unit tests need created
  • Enhance TravisCI to run

Add configuration dependencies to Password Policy config yml files

Password policy has configuration yml files under config/install. Currently they are not registered back to the password_policy module, and should be so the configuration is installed/uninstalled with the module.

Here are some examples from core that provide the functionality that Password Policy's configuration needs:

core/modules/user/config/optional/rdf.mapping.user.user.yml
dependencies:

  • module:
  • user

The example above demonstrates how configuration can set a dependency for the "user" module (install and uninstall will add/remove config respectively). In our case, we need our configuration to set the dependency of "password_policy" for all config files located under "config/install".

Currently, password_policy.install manually removes the field configuration defined in config/install. By enabling this dependency within Password Policy's "config/install", this means we can remove the code from the uninstall hook that manually removes some of the fields defined in configuration.

Add Behat tests

-Test password reset admin interface
-Test password length module
-Test creating accounts, password enforcement
-Test resetting password

Constraints disappear in add new user.

Replication:

  1. Create a password policy with a length constraint, apply to Authed users.
  2. Navigate to /admin/people/create
  3. Note constraints exist
  4. Type in failing password
  5. Constraints disappear and only read "There are no constraints for the selected user roles"

Add in password confirm functionality

Password confirm had to be stripped out of the user form because it was causing major conflicts when I attempted to validate the password against the applied policies.

Enforce policy when user gains role

Steps:

  • Create a password policy and enable for 'Administrator' role
  • Create a test user with no roles, which has password that fails the policy 'password'
  • Edit the test user and add the 'Administrator' role

Expected:

An error or message would be displayed when adding the role that states the user's password does not meet requirements.

Need to discuss options for what should happen.

Options:

  • Password is marked for force reset
  • User is not saved with form error
  • (other ideas?)

Actual:

The user is saved and can login with the poor password into what should now be a policy enforced role.

User logout creates an infinite loop

This seems to occur after a password has expired (password reset)

I reset a user password and tried to log out. It kept redirecting back to the user edit page infinitely.

password_policy_user_insert runs incorrectly.

function password_policy_user_insert($account) {
  $account = \Drupal::currentUser();
  $date = date('Y-m-d\TH:i:s');
  $user = entity_load('user', $account->id());
  $user->set('field_last_password_reset', $date);
  $user->set('field_password_expiration', '0');
  $user->save();
}

This will run on the creating user, not necessarily the new user.

Should be able to just delete this line:

  $account = \Drupal::currentUser();

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.