Skip to content

Commit

Permalink
Merge pull request #60 from nitmir/dev
Browse files Browse the repository at this point in the history
Update to version 1.2.0

v1.2.0 - 2020-07-05
===================

Added
-----

* Bootstrap 4 templates
* Support for Django 2.2 and 3.0

Fixes
-----

* Replace calls to add_description_unit. As of Sphinx 2.4, the deprecated
  add_description_unit function has been removed.
* Fix CRYPT-DES hash method for LDAP
* Fix various spelling miskate in README.rst
* Service URL: keep blank GET arguments

Changed
-------

* Use python3 for flake8, check_rst and coverage
* Update README.rst quickstart for using python3 by default

Removed
-------

* Drop support for Django 2.0 and 2.1 as it reached end of life.
  We still keep Django 1.11 as it is the last supported release
  by python2 AND the currently packaged version of Django in
  Debian Buster (current stable).
  • Loading branch information
nitmir authored Jul 5, 2020
2 parents 6ee7038 + c3e2fde commit f15d0fa
Show file tree
Hide file tree
Showing 34 changed files with 538 additions and 163 deletions.
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
language: python
matrix:
include:
- python: "2.7"
- python: "3.8"
env: TOX_ENV=flake8
- python: "2.7"
- python: "3.8"
env: TOX_ENV=check_rst
- python: "2.7"
env: TOX_ENV=py27-django111
Expand All @@ -19,7 +19,13 @@ matrix:
env: TOX_ENV=py35-django21
- python: "3.6"
env: TOX_ENV=py36-django21
- python: "2.7"
- python: "3.7"
env: TOX_ENV=py37-django22
- python: "3.8"
env: TOX_ENV=py38-django22
- python: "3.8"
env: TOX_ENV=py38-django30
- python: "3.8"
env: TOX_ENV=coverage
cache:
directories:
Expand Down
10 changes: 7 additions & 3 deletions .update_coverage
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash
BASEDIR="$1"
set -x
set -e
BASEDIR="$(realpath "$1")"
PROJECT_NAME="$2"

TITLE="Coverage report of $PROJECT_NAME"
Expand Down Expand Up @@ -31,7 +33,7 @@ fi

VENV="$(mktemp -d)"
HTMLREPORT="$(mktemp -d)"
virtualenv "$VENV"
virtualenv -p python3 "$VENV"
"$VENV/bin/pip" install coverage
"$VENV/bin/coverage" html --title "$TITLE" --directory "$HTMLREPORT"
rm -rf "$VENV"
Expand All @@ -43,12 +45,14 @@ cd "$BASEDIR"

rm -rf "$HTMLREPORT"


set +x
echo "curl https://badges.genua.fr/coverage/ ..."
curl https://badges.genua.fr/coverage/ \
-F "secret=$COVERAGE_TOKEN" \
-F "tar=@$BASEDIR/coverage.tar.gz" \
-F "project=$PROJECT_NAME" \
-F "branch=$BRANCH"

set -x
rm "$BASEDIR/coverage.tar.gz"

32 changes: 32 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,38 @@ All notable changes to this project will be documented in this file.
.. contents:: Table of Contents
:depth: 2

v1.2.0 - 2020-07-05
===================

Added
-----

* Bootstrap 4 templates
* Support for Django 2.2 and 3.0

Fixes
-----

* Replace calls to add_description_unit. As of Sphinx 2.4, the deprecated
add_description_unit function has been removed.
* Fix CRYPT-DES hash method for LDAP
* Fix various spelling miskate in README.rst
* Service URL: keep blank GET arguments

Changed
-------

* Use python3 for flake8, check_rst and coverage
* Update README.rst quickstart for using python3 by default

Removed
-------

* Drop support for Django 2.0 and 2.1 as it reached end of life.
We still keep Django 1.11 as it is the last supported release
by python2 AND the currently packaged version of Django in
Debian Buster (current stable).

v1.1.0 - 2019-03-02
===================

Expand Down
241 changes: 121 additions & 120 deletions README.rst

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cas_server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""A django CAS server application"""

#: version of the application
VERSION = '1.1.0'
VERSION = '1.2.0'

#: path the the application configuration class
default_app_config = 'cas_server.apps.CasAppConfig'
7 changes: 6 additions & 1 deletion cas_server/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@
#
# (c) 2015-2016 Valentin Samir
"""django config module"""
from django.utils.translation import ugettext_lazy as _
from django.apps import AppConfig

import sys
if sys.version_info < (3, ):
from django.utils.translation import ugettext_lazy as _
else:
from django.utils.translation import gettext_lazy as _


class CasAppConfig(AppConfig):
"""
Expand Down
17 changes: 12 additions & 5 deletions cas_server/default_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
"""Default values for the app's settings"""
from django.conf import settings
from django.templatetags.static import static
from django.utils.translation import ugettext_lazy as _

from importlib import import_module

import sys
if sys.version_info < (3, ):
from django.utils.translation import ugettext_lazy as _
else:
from django.utils.translation import gettext_lazy as _


try:
#: URL to the logo showed in the up left corner on the default templates.
Expand All @@ -39,17 +44,19 @@
"bootstrap3_js": "//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js",
"html5shiv": "//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js",
"respond": "//oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js",
"bootstrap4_css": "//stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css",
"bootstrap4_js": "//stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js",
"jquery": "//code.jquery.com/jquery.min.js",
}
#: Path to the template showed on /login then the user is not autenticated.
CAS_LOGIN_TEMPLATE = 'cas_server/login.html'
CAS_LOGIN_TEMPLATE = 'cas_server/bs4/login.html'
#: Path to the template showed on /login?service=... then the user is authenticated and has asked
#: to be warned before being connected to a service.
CAS_WARN_TEMPLATE = 'cas_server/warn.html'
CAS_WARN_TEMPLATE = 'cas_server/bs4/warn.html'
#: Path to the template showed on /login then to user is authenticated.
CAS_LOGGED_TEMPLATE = 'cas_server/logged.html'
CAS_LOGGED_TEMPLATE = 'cas_server/bs4/logged.html'
#: Path to the template showed on /logout then to user is being disconnected.
CAS_LOGOUT_TEMPLATE = 'cas_server/logout.html'
CAS_LOGOUT_TEMPLATE = 'cas_server/bs4/logout.html'
#: Should we redirect users to /login after they logged out instead of displaying
#: :obj:`CAS_LOGOUT_TEMPLATE`.
CAS_REDIRECT_TO_LOGIN_AFTER_LOGOUT = False
Expand Down
7 changes: 6 additions & 1 deletion cas_server/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@

from django import forms
from django.forms import widgets
from django.utils.translation import ugettext_lazy as _

import cas_server.utils as utils
import cas_server.models as models

import sys
if sys.version_info < (3, ):
from django.utils.translation import ugettext_lazy as _
else:
from django.utils.translation import gettext_lazy as _


class BootsrapForm(forms.Form):
"""
Expand Down
7 changes: 6 additions & 1 deletion cas_server/management/commands/cas_clean_federate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@
#
# (c) 2016 Valentin Samir
from django.core.management.base import BaseCommand
from django.utils.translation import ugettext_lazy as _

from ... import models

import sys
if sys.version_info < (3, ):
from django.utils.translation import ugettext_lazy as _
else:
from django.utils.translation import gettext_lazy as _


class Command(BaseCommand):
args = ''
Expand Down
7 changes: 6 additions & 1 deletion cas_server/management/commands/cas_clean_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@
# (c) 2016 Valentin Samir
"""Clean deleted sessions management command"""
from django.core.management.base import BaseCommand
from django.utils.translation import ugettext_lazy as _

from ... import models

import sys
if sys.version_info < (3,):
from django.utils.translation import ugettext_lazy as _
else:
from django.utils.translation import gettext_lazy as _


class Command(BaseCommand):
"""Clean deleted sessions"""
Expand Down
7 changes: 6 additions & 1 deletion cas_server/management/commands/cas_clean_tickets.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@
# (c) 2016 Valentin Samir
"""Clean old trickets management command"""
from django.core.management.base import BaseCommand
from django.utils.translation import ugettext_lazy as _

from ... import models

import sys
if sys.version_info < (3, ):
from django.utils.translation import ugettext_lazy as _
else:
from django.utils.translation import gettext_lazy as _


class Command(BaseCommand):
"""Clean old trickets"""
Expand Down
12 changes: 10 additions & 2 deletions cas_server/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@
from django.db import models
from django.db.models import Q
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
try:
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
except ImportError:
def python_2_unicode_compatible(func):
"""
We use Django >= 3.0 with Python >= 3.4, we don't need Python 2 compatibility.
"""
return func
from django.utils.translation import gettext_lazy as _
from django.core.mail import send_mail

import re
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions cas_server/static/cas_server/bs4/fa-lock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions cas_server/static/cas_server/bs4/fa-user.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions cas_server/static/cas_server/bs4/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
html, body {
height: 100%;
background-color: #eee;
}
.cover-container {
max-width: 50em;
}

/* Page title */
#app-name {
color: #000;
text-shadow: 0 .05rem .2rem rgba(255, 255, 255, .5);
}
#app-name img {
width: 110px;
margin-right: 1rem;
}
@media screen and (max-width: 680px) {
#app-name img {
display: block;
margin: auto;
}
}

/* Add icons to login form */
/* Font-Awesome attribution is already done inside SVG files */
.form-signin input[type="text"] {
background: right 1rem top 50% / 5% no-repeat url('fa-user.svg');
padding-right: 3rem;
}
.form-signin input[type="password"] {
background: right 1rem top 50% / 5% no-repeat url('fa-lock.svg');
padding-right: 3rem;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<script src="{{settings.CAS_COMPONENT_URLS.respond}}"></script>
<![endif]-->
{% if settings.CAS_FAVICON_URL %}<link rel="shortcut icon" href="{{settings.CAS_FAVICON_URL}}" />{% endif %}
<link href="{% static "cas_server/styles.css" %}" rel="stylesheet">
<link href="{% static "cas_server/bs3/styles.css" %}" rel="stylesheet">
</head>
<body>
<div id="wrap">
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "cas_server/base.html" %}
{% extends "cas_server/bs3/base.html" %}
{% load i18n %}
{% block content %}
<div class="alert alert-success" role="alert">{% blocktrans %}<h3>Log In Successful</h3>You have successfully logged into the Central Authentication Service.<br/>For security reasons, please Log Out and Exit your web browser when you are done accessing services that require authentication!{% endblocktrans %}</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "cas_server/base.html" %}
{% extends "cas_server/bs3/base.html" %}
{% load i18n %}

{% block ante_messages %}
Expand All @@ -9,7 +9,7 @@ <h2 class="form-signin-heading">{% trans "Please log in" %}</h2>
{% block content %}
<form class="form-signin" method="post" id="login_form"{% if post_url %} action="{{post_url}}"{% endif %}>
{% csrf_token %}
{% include "cas_server/form.html" %}
{% include "cas_server/bs3/form.html" %}
{% if auto_submit %}<noscript>{% endif %}
<button class="btn btn-primary btn-block btn-lg" type="submit">{% trans "Login" %}</button>
{% if auto_submit %}</noscript>{% endif %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "cas_server/base.html" %}
{% extends "cas_server/bs3/base.html" %}
{% load static %}
{% load i18n %}
{% block content %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{% extends "cas_server/base.html" %}
{% extends "cas_server/bs3/base.html" %}
{% load static %}
{% load i18n %}

{% block content %}
<form class="form-signin" method="post">
{% csrf_token %}
{% include "cas_server/form.html" %}
{% include "cas_server/bs3/form.html" %}
<button class="btn btn-primary btn-block btn-lg" type="submit">{% trans "Connect to the service" %}</button>
</form>
{% endblock %}
Loading

0 comments on commit f15d0fa

Please sign in to comment.