Comments (12)
@topless, @gmist, @mdxs, @joernhees
I pushed the first approach for merging user accounts, any feedback or suggestions would be much appreciated!
There are not many comments or anything but I think it's pretty straight forward..
Some heads up:
- The main goal was to simply merge the external auths so the same user would be able to sign in with multiple accounts
- The reason that I'm not allowing to change the username is to keep things a bit simpler and not overcomplicate stuff, because it has to be unique.
- At the moment you're not able to delete any external auth entity (but it will come as part of the user update and not merge)
- There is no logic for merging more entities than the User because there are none in the core project, but there is a
TODO
that points it out - The user entities that are merged, at the moment being deleted forever.. (maybe they should be deactivated instead?!?)
from gae-init.
man, you're on fire ^^
if i get it correctly there's no way to specify "which" of the users remain...
I encountered this issue in my own code where after merging one needs to rewrite the possibly 1000s of posts/whatever referring to the deprecated user keys, so it might be useful to specify the remaining ("primary") user somehow. The choice of merged_user_db = user_dbs[0]
is non deterministic. One could at least specify the older user, but then users might come along who want the exact opposite.
-- edit:
left a couple comments inline, might be that you can pass in the remaining user's user_key
from gae-init.
You can actually specify which user you want to remain.. That was one of my main requirements to do it nice and easy and finally I think I found a nice and easy way :) here is a screenshot of how it looks like..
You just have to choose which account you want to keep and the rest well be deleted (or maybe I'll change it to inactive in the future..)
from gae-init.
@joernhees I would suggest you just simply clone this project as is and run it locally yo see the merge in action :D It's quite nice actually..
from gae-init.
Thanks, I will have a look one of the next days.
Upfront I will say that I would prefer inactivating merged users. Ideally with some date/time stamp and reference to the "merged into" account, allowing additional processes to look for stuff and clean up. Thus might help address the issue @joernhees described above; for those actions that could take some time and/or would be better coded in another loop, perhaps triggered by some add-to-queue for merged accounts. Just a thought though.
from gae-init.
First of all, nobody should use the merge unless they went through the merge_user_dbs()
function
Line 189 in 388bfde
Which most likely if you have lots of data connected to a user this might a task queue either you want to actually delete them or simply deactivate..
There are some cons when deactivating the user as well though:
- Do something about the
username
so it won' produce any conflict in the future (adding possibly an illegal character in the end) - Possibly the same thing with the
email
field as in normal apps you might want to implement custom login or verified emails and it makes sense to have them unique - Delete all the
auth_ids
entries
In both cases you'll have to deal with references to the deprecated users, so like I said in the beginning every developer should take care of that function before using it..
from gae-init.
+1 for inactive flag. Delete is irreversible, If the project is quite big, then there might be old dependencies or things that other people did which you cannot really predict. Inactive will save us some sweat if something goes the usually the fucked up way.
@joernhees, indeed but I think he is on crack not on fire :)
from gae-init.
So at the moment when merging the deprecated users they are becoming inactive, their auth_ids
are deleted and added an illegal character to their username so it won't affect newly created users.
from gae-init.
With the release 0.11.0 I'm closing this one and from now on any comments regarding merge users could be created as separate issues..
https://github.com/gae-init/gae-init/releases
from gae-init.
Bit late, and only after a few runs; but I like the current flow a lot (that is: merging, and if happy deleting the inactive users). So thanks a lot!
from gae-init.
If you have dependencies while merging one approach is demonstrated in the gae-init-upload and more specifically just look for delete_user_task
& move_resources_task
in the https://github.com/gae-init/gae-init-upload/blob/master/main/user.py
from gae-init.
Excellent, will need to have a look at that later!
from gae-init.
Related Issues (20)
- Google login is not working (not GAE) HOT 1
- AttributeError: 'module' object has no attribute 'get_dbs'
- gulp-help is a blocker to upgrading to gulp4 HOT 2
- Yarn doesn't work with Node v12 HOT 3
- Use of memcache is a blocker to Python 3.7 migration HOT 5
- Trouble running gulp for local testing with grpcio in app.yaml HOT 4
- Can't import numpy HOT 7
- Error with virtualenv unrecognized argument during yarn install
- Requirement for email_validator on local test run not satisfied? HOT 4
- Race condition in deploy vs creation of lib.zip HOT 2
- Inconsistencies in gulpfile task descriptions HOT 3
- Add Twitch Login
- Upgrade to Font Awesome 5
- plan to update to python 3? HOT 1
- Moment.js is a legacy project HOT 1
- Dependabot couldn't authenticate with https://pypi.python.org/simple/
- Import error with latest changes HOT 1
- Travis not running
- Improve cleanup in development HOT 1
- gae-init.appspot.com is down
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gae-init.