Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do we need to 'pinEncryptedFieldsToUser' when moving services? #2

Open
splendido opened this issue Jun 14, 2014 · 2 comments
Open

do we need to 'pinEncryptedFieldsToUser' when moving services? #2

splendido opened this issue Jun 14, 2014 · 2 comments

Comments

@splendido
Copy link
Owner

Looking at the accounts-base code, it seems that services' data is possibly added to the user object somehow encrypted with the user._id. See this:

https://github.com/meteor/meteor/blob/devel/packages/accounts-base/accounts_server.js#L1136

the function pinEncryptedFieldsToUser is defined here:

https://github.com/meteor/meteor/blob/devel/packages/accounts-base/accounts_server.js#L919

So the question is: when we merge to accounts moving services from one to another with someting like _.defaults(dst_user.services, src_user.services); is it fine or should we re-encrypt all services' data fields with the new dst_user._id?

...in any case, at the first log in using a particular service the above cited function will be re run and all service data re-encrypted!

So the actual question is: could it be that some particular service data field contains information that will be needed before the next log in with that service?

@praneybehl
Copy link

I believe, that re-encrypting the data would be a better option.

@splendido
Copy link
Owner Author

At the moment the function pinEncryptedFieldsToUser is not available from outside the accounts-base package, and this is why I'm not using it. At that time I was not so keen to copy the function over to accounts-meld, which would result harder to maintain...
The solution would be asking to make it available as Accounts.pinEncryptedFieldsToUser but this would be useless to the most.

Actually I had no time to better investigate its functioning and everything is working good.
Do you have a better idea about what is its aim?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants