Skip to content

Commit df618e6

Browse files
authored
Merge pull request #70 from kstateome/develop
1.3.0
2 parents 259273f + 076cab6 commit df618e6

File tree

10 files changed

+43
-17
lines changed

10 files changed

+43
-17
lines changed

CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### 1.3.0
2+
- Compatibility with Django 1.10 Middleware (https://github.com/kstateome/django-cas/pull/69)
3+
- Add support for protocol-rooted URL as "next_page" argument for _logout_url constructor (https://github.com/kstateome/django-cas/pull/67)
4+
- Fix typo (https://github.com/kstateome/django-cas/pull/65)
5+
16
### 1.2.0
27

38
- Allow opt out of time delay caused by fetching PGT tickets
@@ -8,4 +13,4 @@
813
### 1.1.1
914

1015
- Add a few logging statements
11-
- Add official change log.
16+
- Add official change log.

CONTRIBUTORS

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
epicserve
22
rlmv
33
bryankaplan
4-
cordmata
4+
cordmata
5+
bltravis
6+
JordanReiter

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
CAS client for Django. This library requires Django 1.5 or above, and Python 2.6, 2.7, 3.4
44

5-
Current version: 1.2.0
5+
Current version: 1.3.0
66

77
This is [K-State's fork](https://github.com/kstateome/django-cas) of [the original](https://bitbucket.org/cpcc/django-cas/overview) and includes [several additional features](https://github.com/kstateome/django-cas/#additional-features) as well as features merged from
88

@@ -14,7 +14,7 @@ This is [K-State's fork](https://github.com/kstateome/django-cas) of [the or
1414

1515
This project is registered on PyPi as django-cas-client. To install::
1616

17-
pip install django-cas-client==1.2.0
17+
pip install django-cas-client==1.3.0
1818

1919

2020
### Add to URLs
@@ -146,7 +146,7 @@ To force the service url to always target HTTPS, set ``CAS_FORCE_SSL_SERVICE_URL
146146

147147
By default, a stub user record will be created on the first successful CAS authentication
148148
using the username in the response. If this behavior is not desired set
149-
``CAS_AUTO_CREATE_USER`` to ``Flase``.
149+
``CAS_AUTO_CREATE_USER`` to ``False``.
150150

151151
## Proxy Tickets
152152

cas/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Django CAS 1.0/2.0 authentication backend"""
1+
default_app_config = 'cas.apps.CASConfig'
22

33
from django.conf import settings
44

cas/apps.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
class CASConfig(AppConfig):
4+
name = 'cas'
5+
verbose_name = "cas"

cas/middleware.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,18 @@
1212
from django.core.urlresolvers import reverse
1313
from django.http import HttpResponseRedirect, HttpResponseForbidden
1414
from django.core.exceptions import ImproperlyConfigured
15+
try:
16+
from django.utils.deprecation import MiddlewareMixin
17+
except ImportError:
18+
MiddlewareMixin = object
1519

1620
from cas.exceptions import CasTicketException
1721
from cas.views import login as cas_login, logout as cas_logout
1822

1923
__all__ = ['CASMiddleware']
2024

2125

22-
class CASMiddleware(object):
26+
class CASMiddleware(MiddlewareMixin):
2327
"""
2428
Middleware that allows CAS authentication on admin pages
2529
"""
@@ -81,7 +85,7 @@ def process_exception(self, request, exception):
8185
return None
8286

8387

84-
class ProxyMiddleware(object):
88+
class ProxyMiddleware(MiddlewareMixin):
8589

8690
# Middleware used to "fake" the django app that it lives at the Proxy Domain
8791
def process_request(self, request):

cas/views.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,13 @@ def _logout_url(request, next_page=None):
141141
url = urlparse.urljoin(settings.CAS_SERVER_URL, 'logout')
142142

143143
if next_page and getattr(settings, 'CAS_PROVIDE_URL_TO_LOGOUT', True):
144-
protocol = ('http://', 'https://')[request.is_secure()]
145-
host = request.get_host()
146-
url += '?' + urlencode({'url': protocol + host + next_page})
144+
parsed_url = urlparse.urlparse(next_page)
145+
if parsed_url.scheme: #If next_page is a protocol-rooted url, skip redirect url construction
146+
url += '?' + urlencode({'service': next_page})
147+
else:
148+
protocol = ('http://', 'https://')[request.is_secure()]
149+
host = request.get_host()
150+
url += '?' + urlencode({'service': protocol + host + next_page})
147151

148152
return url
149153

@@ -254,4 +258,3 @@ def proxy_callback(request):
254258
))
255259
return HttpResponse('PGT storage failed for {request}'.format(request=str(request.GET)),
256260
content_type="text/plain")
257-

docs/source/changelog.rst

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
Changelog
22
=========
33

4-
1.2.0 (Unreleased)
4+
1.3.0
5+
------------------
6+
7+
- Compatibility with Django 1.10 Middleware (https://github.com/kstateome/django-cas/pull/69)
8+
- Add support for protocol-rooted URL as "next_page" argument for _logout_url constructor (https://github.com/kstateome/django-cas/pull/67)
9+
- Fix typo (https://github.com/kstateome/django-cas/pull/65)
10+
11+
1.2.0
512
------------------
613

714
- Allow opt out of time delay caused by fetching PGT tickets
@@ -18,4 +25,4 @@ Changelog
1825
- Add official change log.
1926

2027

21-
Releases before 1.1.1 were tracked on GitHub https://github.com/kstateome/django-cas/releases
28+
Releases before 1.1.1 were tracked on GitHub https://github.com/kstateome/django-cas/releases

docs/source/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@
5858
# built documents.
5959
#
6060
# The short X.Y version.
61-
version = '1.2.0'
61+
version = '1.3.0'
6262
# The full version, including alpha/beta/rc tags.
63-
release = '1.2.0'
63+
release = '1.3.0'
6464

6565
# The language for content autogenerated by Sphinx. Refer to documentation
6666
# for a list of supported languages.

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from setuptools import setup, find_packages
44

5-
version = '1.2.0'
5+
version = '1.3.0'
66

77

88
def read(fname):

0 commit comments

Comments
 (0)