This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 308
implement encrypted national identities #4000
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Apr 30, 2016
1 task
Redid the commit for very minor doc and whitespace tweaks. Previous commit was c55614d. |
chadwhitacre
force-pushed
the
encrypted-identities
branch
from
May 2, 2016 01:48
c55614d
to
7422191
Compare
Per #3976 (comment), we should require a verified email before storing an identity. |
Started a punchlist in the description. |
3 tasks
I wrote some code to rekey def rekey(db, packer):
"""Rekey the encrypted data in our database.
:param GratipayDB db: a database object
:param EncryptingPacker packer:
This script features prominently in our procedure for rekeying our
encrypted data, as documented in the "[Keep
Secrets](http://inside.gratipay.com/howto/keep-secrets)" howto. It operates
by loading records from `participant_identities` in batches of 100 based on
a `_last_keyed` field. It updates `_last_keyed` atomically with the rekeyed
`info`, so it can safely be rerun in the face of network failure, etc.
"""
n = 0
while 1:
m = _rekey_one_batch(db, packer)
if m == 0:
break
n += m
return n
def _rekey_one_batch(db, packer):
batch = db.all("""
SELECT id, info
FROM participant_identities
WHERE _last_keyed < date_trunc('month', now())
LIMIT 100
""")
if not batch:
return 0
for rec in batch:
plaintext = packer.unpack(rec.info)
new_token = packer.pack(plaintext)
db.run( "UPDATE participant_identities SET info=%s, _last_keyed=now() WHERE id=%s"
, (new_token, rec.id)
)
return True |
8 tasks
chadwhitacre
force-pushed
the
add-countries
branch
from
May 8, 2016 18:23
fd1ca95
to
f366481
Compare
chadwhitacre
force-pushed
the
encrypted-identities
branch
from
May 8, 2016 18:29
7422191
to
8f22a0e
Compare
Old head was 8f22a0e. |
chadwhitacre
force-pushed
the
encrypted-identities
branch
2 times, most recently
from
May 9, 2016 12:33
10da54e
to
292ab36
Compare
chadwhitacre
force-pushed
the
add-countries
branch
from
May 11, 2016 18:38
8a65cdf
to
ba8c6e1
Compare
Add countries
chadwhitacre
force-pushed
the
encrypted-identities
branch
from
May 11, 2016 19:29
292ab36
to
7f2666c
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
⬑ #3994
⬑ #3976
← #3999 — #4001 →
Punchlist
Participant.clear_personal_information
take_over
master
once add schema and Python for countries #3999 lands → Encrypted identities #4028