Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-openid-auth
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-openid-auth
Commits
a32cd791
Commit
a32cd791
authored
Apr 23, 2015
by
Natalia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure that we handle unicode everywhere.
parent
1a9fd76c
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
74 additions
and
12 deletions
+74
-12
django_openid_auth/admin.py
+4
-4
django_openid_auth/auth.py
+5
-2
django_openid_auth/exceptions.py
+2
-0
django_openid_auth/forms.py
+2
-0
django_openid_auth/management/commands/openid_cleanup.py
+2
-0
django_openid_auth/models.py
+3
-4
django_openid_auth/signals.py
+2
-0
django_openid_auth/store.py
+2
-0
django_openid_auth/teams.py
+2
-0
django_openid_auth/tests/helpers.py
+2
-0
django_openid_auth/tests/test_admin.py
+3
-1
django_openid_auth/tests/test_auth.py
+2
-0
django_openid_auth/tests/test_models.py
+2
-0
django_openid_auth/tests/test_settings.py
+30
-0
django_openid_auth/tests/test_store.py
+2
-0
django_openid_auth/tests/test_views.py
+3
-1
django_openid_auth/tests/urls.py
+2
-0
django_openid_auth/urls.py
+2
-0
django_openid_auth/views.py
+2
-0
tox.ini
+0
-0
No files found.
django_openid_auth/admin.py
View file @
a32cd791
...
...
@@ -27,11 +27,15 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from
__future__
import
unicode_literals
from
urllib
import
urlencode
from
urlparse
import
parse_qsl
,
urlparse
from
django.conf
import
settings
from
django.contrib
import
admin
from
django.http
import
HttpResponseRedirect
from
django_openid_auth
import
views
from
django_openid_auth.models
import
Nonce
,
Association
,
UserOpenID
from
django_openid_auth.store
import
DjangoOpenIDStore
...
...
@@ -78,10 +82,6 @@ if original_admin_login is None:
original_admin_login
=
admin
.
sites
.
AdminSite
.
login
from
django.http
import
HttpResponseRedirect
from
django_openid_auth
import
views
def
_openid_login
(
instance
,
request
,
error_message
=
''
,
extra_context
=
None
):
# Support for allowing openid authentication for /admin
# (django.contrib.admin)
...
...
django_openid_auth/auth.py
View file @
a32cd791
...
...
@@ -28,6 +28,8 @@
"""Glue between OpenID and django.contrib.auth."""
from
__future__
import
unicode_literals
__metaclass__
=
type
import
re
...
...
@@ -166,7 +168,7 @@ class OpenIDBackend:
if
len
(
split_names
)
==
2
:
first_name
,
last_name
=
split_names
else
:
first_name
=
u
''
first_name
=
''
last_name
=
fullname
verification_scheme_map
=
getattr
(
...
...
@@ -195,7 +197,8 @@ class OpenIDBackend:
if
nickname
is
None
or
nickname
==
''
:
raise
MissingUsernameViolation
()
# If we don't have a nickname, and we're not being strict, use default
# If we don't have a nickname, and we're not being strict, use a
# default
nickname
=
nickname
or
'openiduser'
# See if we already have this nickname assigned to a username
...
...
django_openid_auth/exceptions.py
View file @
a32cd791
...
...
@@ -28,6 +28,8 @@
"""Exception classes thrown by OpenID Authentication and Validation."""
from
__future__
import
unicode_literals
class
DjangoOpenIDException
(
Exception
):
pass
...
...
django_openid_auth/forms.py
View file @
a32cd791
...
...
@@ -27,6 +27,8 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from
__future__
import
unicode_literals
from
django
import
forms
from
django.contrib.auth.admin
import
UserAdmin
from
django.contrib.auth.forms
import
UserChangeForm
...
...
django_openid_auth/management/commands/openid_cleanup.py
View file @
a32cd791
...
...
@@ -26,6 +26,8 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from
__future__
import
unicode_literals
from
django.core.management.base
import
NoArgsCommand
from
django_openid_auth.store
import
DjangoOpenIDStore
...
...
django_openid_auth/models.py
View file @
a32cd791
...
...
@@ -27,11 +27,10 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from
django.contrib.auth.models
import
(
Permission
,
User
,
)
from
__future__
import
unicode_literals
from
django.db
import
models
from
django.contrib.auth.models
import
Permission
,
User
class
Nonce
(
models
.
Model
):
...
...
django_openid_auth/signals.py
View file @
a32cd791
...
...
@@ -27,6 +27,8 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from
__future__
import
unicode_literals
import
django.dispatch
...
...
django_openid_auth/store.py
View file @
a32cd791
...
...
@@ -27,6 +27,8 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from
__future__
import
unicode_literals
import
base64
import
time
...
...
django_openid_auth/teams.py
View file @
a32cd791
...
...
@@ -64,6 +64,8 @@ will be provided:
@since: 2.1.1
"""
from
__future__
import
unicode_literals
from
openid
import
oidutil
from
openid.extension
import
Extension
from
openid.message
import
(
...
...
django_openid_auth/tests/helpers.py
View file @
a32cd791
from
__future__
import
unicode_literals
from
django.test.utils
import
override_settings
...
...
django_openid_auth/tests/test_admin.py
View file @
a32cd791
...
...
@@ -28,6 +28,8 @@
"""Tests for the django_openid_auth Admin login form replacement."""
from
__future__
import
unicode_literals
from
django.conf
import
settings
from
django.contrib.auth.models
import
User
...
...
@@ -48,7 +50,7 @@ class SiteAdminTests(TestCase):
staff member, then they get a failure response.
"""
User
.
objects
.
create_user
(
username
=
u'testing'
,
email
=
'testing@example.com'
,
password
=
u
'test'
)
username
=
'testing'
,
email
=
'testing@example.com'
,
password
=
'test'
)
assert
self
.
client
.
login
(
username
=
'testing'
,
password
=
'test'
)
response
=
self
.
client
.
get
(
'/admin/'
,
follow
=
True
)
self
.
assertContains
(
...
...
django_openid_auth/tests/test_auth.py
View file @
a32cd791
...
...
@@ -26,6 +26,8 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from
__future__
import
unicode_literals
from
django.contrib.auth.models
import
Group
,
Permission
,
User
from
django.test
import
TestCase
from
django.test.utils
import
override_settings
...
...
django_openid_auth/tests/test_models.py
View file @
a32cd791
...
...
@@ -26,6 +26,8 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from
__future__
import
unicode_literals
from
django.contrib.auth.models
import
User
from
django.test
import
TestCase
...
...
django_openid_auth/tests/test_settings.py
View file @
a32cd791
# django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2013 Canonical Ltd.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from
__future__
import
unicode_literals
from
unittest
import
skipIf
from
django
import
VERSION
...
...
django_openid_auth/tests/test_store.py
View file @
a32cd791
...
...
@@ -26,6 +26,8 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from
__future__
import
unicode_literals
import
time
from
django.test
import
TestCase
...
...
django_openid_auth/tests/test_views.py
View file @
a32cd791
...
...
@@ -27,6 +27,8 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from
__future__
import
unicode_literals
import
cgi
from
urlparse
import
parse_qs
...
...
@@ -258,7 +260,7 @@ class RelyingPartyTests(TestCase):
response
=
self
.
client
.
post
(
self
.
login_url
,
{
'openid_identifier'
:
'http://example.com/identity'
,
'next'
:
u
'/files/ñandú.jpg'
.
encode
(
'utf-8'
)})
'next'
:
'/files/ñandú.jpg'
.
encode
(
'utf-8'
)})
self
.
assertContains
(
response
,
'OpenID transaction in progress'
)
def
test_login_no_next
(
self
):
...
...
django_openid_auth/tests/urls.py
View file @
a32cd791
...
...
@@ -26,6 +26,8 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from
__future__
import
unicode_literals
from
django.conf.urls
import
patterns
,
include
from
django.http
import
HttpResponse
...
...
django_openid_auth/urls.py
View file @
a32cd791
...
...
@@ -27,6 +27,8 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from
__future__
import
unicode_literals
from
django.conf.urls
import
patterns
,
url
urlpatterns
=
patterns
(
...
...
django_openid_auth/views.py
View file @
a32cd791
...
...
@@ -27,6 +27,8 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from
__future__
import
unicode_literals
import
re
import
urllib
from
urlparse
import
urlsplit
...
...
tox.ini
View file @
a32cd791
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment