Merge lp:~fmarier/django-openid-auth/django-openid-auth into lp:~django-openid-auth/django-openid-auth/trunk

Proposed by François Marier
Status: Needs review
Proposed branch: lp:~fmarier/django-openid-auth/django-openid-auth
Merge into: lp:~django-openid-auth/django-openid-auth/trunk
Diff against target: 100 lines (+84/-1)
2 files modified
django_openid_auth/migrations/0002_auto__chg_field_nonce_salt.py (+83/-0)
django_openid_auth/models.py (+1/-1)
To merge this branch: bzr merge lp:~fmarier/django-openid-auth/django-openid-auth
Reviewer Review Type Date Requested Status
François Marier (community) Needs Resubmitting
Michael Hall Needs Fixing
Review via email: mp+197281@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Hall (mhall119) wrote :

Without commenting on the code change itself, this should at a minimum also contain a South migration for databases that have already been initialized.

review: Needs Fixing
109. By François Marier

Add a South migration for the expanded salt field

Generated with "manage.py schemamigration django_openid_auth --auto" and
then hand-edited to match the style of the initial migration.

Revision history for this message
François Marier (fmarier) wrote :

> Without commenting on the code change itself, this should at a minimum also
> contain a South migration for databases that have already been initialized.

Good catch. South migration added.

review: Needs Resubmitting

Unmerged revisions

109. By François Marier

Add a South migration for the expanded salt field

Generated with "manage.py schemamigration django_openid_auth --auto" and
then hand-edited to match the style of the initial migration.

108. By François Marier

Expand the salt field for the nonce

This should fix the problem reported by someone using the id.koumbit.net
OpenID provider. The size of the salt needs to be larger to accomodate that
provider.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'django_openid_auth/migrations/0002_auto__chg_field_nonce_salt.py'
2--- django_openid_auth/migrations/0002_auto__chg_field_nonce_salt.py 1970-01-01 00:00:00 +0000
3+++ django_openid_auth/migrations/0002_auto__chg_field_nonce_salt.py 2013-11-30 23:04:27 +0000
4@@ -0,0 +1,83 @@
5+# -*- coding: utf-8 -*-
6+import datetime
7+from south.db import db
8+from south.v2 import SchemaMigration
9+from django.db import models
10+
11+
12+class Migration(SchemaMigration):
13+
14+ def forwards(self, orm):
15+ # Changing field 'Nonce.salt'
16+ db.alter_column('django_openid_auth_nonce', 'salt', self.gf('django.db.models.fields.CharField')(max_length=128))
17+
18+
19+ def backwards(self, orm):
20+ # Changing field 'Nonce.salt'
21+ db.alter_column('django_openid_auth_nonce', 'salt', self.gf('django.db.models.fields.CharField')(max_length=40))
22+
23+
24+ models = {
25+ u'auth.group': {
26+ 'Meta': {'object_name': 'Group'},
27+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
28+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
29+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
30+ },
31+ u'auth.permission': {
32+ 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
33+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
34+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
35+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
36+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
37+ },
38+ u'auth.user': {
39+ 'Meta': {'object_name': 'User'},
40+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
41+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
42+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
43+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
44+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
45+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
46+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
47+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
48+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
49+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
50+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
51+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
52+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
53+ },
54+ u'contenttypes.contenttype': {
55+ 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
56+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
57+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
58+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
59+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
60+ },
61+ u'django_openid_auth.association': {
62+ 'Meta': {'object_name': 'Association'},
63+ 'assoc_type': ('django.db.models.fields.TextField', [], {'max_length': '64'}),
64+ 'handle': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
65+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
66+ 'issued': ('django.db.models.fields.IntegerField', [], {}),
67+ 'lifetime': ('django.db.models.fields.IntegerField', [], {}),
68+ 'secret': ('django.db.models.fields.TextField', [], {'max_length': '255'}),
69+ 'server_url': ('django.db.models.fields.TextField', [], {'max_length': '2047'})
70+ },
71+ u'django_openid_auth.nonce': {
72+ 'Meta': {'object_name': 'Nonce'},
73+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
74+ 'salt': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
75+ 'server_url': ('django.db.models.fields.CharField', [], {'max_length': '2047'}),
76+ 'timestamp': ('django.db.models.fields.IntegerField', [], {})
77+ },
78+ u'django_openid_auth.useropenid': {
79+ 'Meta': {'object_name': 'UserOpenID'},
80+ 'claimed_id': ('django.db.models.fields.TextField', [], {'unique': 'True', 'max_length': '2047'}),
81+ 'display_id': ('django.db.models.fields.TextField', [], {'max_length': '2047'}),
82+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
83+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"})
84+ }
85+ }
86+
87+ complete_apps = ['django_openid_auth']
88
89=== modified file 'django_openid_auth/models.py'
90--- django_openid_auth/models.py 2013-06-21 17:48:28 +0000
91+++ django_openid_auth/models.py 2013-11-30 23:04:27 +0000
92@@ -37,7 +37,7 @@
93 class Nonce(models.Model):
94 server_url = models.CharField(max_length=2047)
95 timestamp = models.IntegerField()
96- salt = models.CharField(max_length=40)
97+ salt = models.CharField(max_length=128)
98
99 def __unicode__(self):
100 return u"Nonce: %s, %s" % (self.server_url, self.salt)

Subscribers

People subscribed via source and target branches