Git Product home page Git Product logo

Comments (13)

ejucovy avatar ejucovy commented on August 18, 2024

For simplicity I think that we should try to avoid data-overlaps with project exports. So any member-related data which is exported with a project should not be exported with the member. This includes project memberships and roles, mailing list subscriptions and roles, etc.

from opencore.

ejucovy avatar ejucovy commented on August 18, 2024

Site roles will, however, need to be exported; as will account confirmation status. (Unless we just choose to discard unconfirmed members and not provide export/import of them.)

from opencore.

d-mo avatar d-mo commented on August 18, 2024

We should be able to use Izhar's script to export the user data and hashed passwords in csv:
http://blog.kagesenshi.org/2008/05/exporting-plone30-memberdata-and.html

from opencore.

ejucovy avatar ejucovy commented on August 18, 2024

Trying this out by hand .. the passwdlist OOBTree (self.acl_users.source_users._user_passwords) appears to be empty. :(

However, with a member object in hand, a simple member.password returns an algo:hash password string like hmac_sha:XXXXXXX -- though on some member objects it appears to be empty.

Looking through the Products.remember implementation of member._setPassword it looks like we can then simply take that string and set it on the member object like so: member.getField('password').set(member, algo_hash_password_string)

Still need to investigate:

  1. If we retrieve those strings and then re-set them, will the password remain intact? (Should be easy to test e.g. by creating a new member object, setting its password field by hand to the password string from a user account whose account we know, and then testing TTW login.)
  2. Why do some member objects have a null value for the password field?

from opencore.

ejucovy avatar ejucovy commented on August 18, 2024

If we retrieve those strings and then re-set them, will the password remain intact?

This seems to be true. The only catch is that each remember user object maintains its own stored "hmac_key" (in a Products.remember.content.password_hashers.HMACHash object's storage['hmac_key']) which is used in generating a hash of the provided credentials to compare against the stored hash. Each user's "hmac_key" is a simple repr of the member object -- e.g. "<OpenMember at ejucovy>". When doing a simple export/import these hmac_keys should be set correctly, as long as we don't modify any user IDs.

from opencore.

ejucovy avatar ejucovy commented on August 18, 2024

Why do some member objects have a null value for the password field?

Actually this seems to have been an error on my part -- looking through a CSV dump I'm not seeing any missing values offhand.

from opencore.

ejucovy avatar ejucovy commented on August 18, 2024

Meanwhile, here's how we can determine if a user account is pending or confirmed:

from opencore.member.workflow import MemberWorkflowHandler
MemberWorkflowHandler(member_object).is_unconfirmed()

...will return either True (if the member is pending) or False (if the member is confirmed)

from opencore.

ejucovy avatar ejucovy commented on August 18, 2024

Also we need to get user portraits -- we can write them to a folder in a zip file and then put a reference to each one in the appropriate line of the CSV.

from opencore.

ejucovy avatar ejucovy commented on August 18, 2024

Initial script added: 986aebb

Still needs:

  • member creation date
  • site role (admin/member)
  • portrait url
  • actual portraits written to a tempdir
  • the tempdir and the csv written to a ZIP file
  • confirmation code for unconfirmed members? maybe?

from opencore.

ejucovy avatar ejucovy commented on August 18, 2024

Image files are now being written to a tempdir, and referenced in the CSV, in f8f974f

from opencore.

ejucovy avatar ejucovy commented on August 18, 2024

Creation date: b9ee8f8

from opencore.

ejucovy avatar ejucovy commented on August 18, 2024

Updated issue with current to-dos. Original issue content:

First we need to spec out what is involved in user export -- what content and data must be attached to a user export, and how to ensure that the export is lossless.

I believe the biggest questions here are:

  1. Can we export the user's hashed password in a way that keeps his password intact during a subsequent reimport (assuming it's reimported into an opencore instance with the same secret key)
  2. Can we export the user's creation date in a way that can be reimported (less important, but it would be nice to preserve this)

from opencore.

ejucovy avatar ejucovy commented on August 18, 2024

Remaining work: #29, #30, #31

from opencore.

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.