Change global package name for authentic2
All packages moved under authentic2 directory authentic2.settings now target media/ templates/ and authentic.db files under the current directory.
This commit is contained in:
parent
f81d565ead
commit
35a32efe02
|
@ -1,6 +1,9 @@
|
|||
recursive-include authentic/locale *
|
||||
recursive-include authentic/templates *.html *.txt *.js
|
||||
recursive-include authentic/media *.css *.js *.ico *.gif
|
||||
recursive-include locale *
|
||||
recusrive-include tests *.dp *.py
|
||||
recursive-include templates *.html *.txt *.js yadis.xrdf
|
||||
recursive-include media *.css *.js *.ico *.gif *.png *.jpg README
|
||||
recursive-include authentic2 README *.html
|
||||
include authentic2/sslauth/authentic_ssl.vhost
|
||||
include ez_setup.py
|
||||
include COPYING
|
||||
include README.rst
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from django.contrib import admin
|
||||
from authentic.admin_log_view.models import Log
|
||||
from authentic2.admin_log_view.models import Log
|
||||
|
||||
admin.site.register(Log)
|
|
@ -43,7 +43,8 @@ and the back url is the one of calling of the defederation function.
|
|||
from django.shortcuts import render_to_response
|
||||
from django.template import RequestContext
|
||||
from django.contrib.auth import views as auth_views
|
||||
import authsaml2.saml2_endpoints
|
||||
import authentic2.authsaml2.saml2_endpoints
|
||||
|
||||
def login(request):
|
||||
authsaml2.saml2_endpoints.register_next_target(request)
|
||||
return auth_views.login(request)
|
||||
|
@ -65,8 +66,9 @@ def login(request):
|
|||
from django.shortcuts import render_to_response
|
||||
from django.template import RequestContext
|
||||
from django.contrib.auth import views as auth_views
|
||||
import authsaml2.saml2_endpoints
|
||||
import authsaml2.saml.common
|
||||
import authentic2.authsaml2.saml2_endpoints
|
||||
import authentic2.authsaml2.saml.common
|
||||
|
||||
def inside(request):
|
||||
authsaml2.saml2_endpoints.register_next_target(request, '/in')
|
||||
return render_to_response('in.html', {'providers_list_federated': authsaml2.saml.common.get_idp_user_federated_list(request),
|
|
@ -1,8 +1,8 @@
|
|||
from django.db import transaction
|
||||
from django.contrib.auth.models import User, UserManager
|
||||
import settings
|
||||
from django.conf import settings
|
||||
from saml2_endpoints import *
|
||||
from saml.common import *
|
||||
from authentic2.saml.common import *
|
||||
|
||||
class AuthenticationError(Exception):
|
||||
pass
|
|
@ -16,9 +16,9 @@ from django.contrib.auth import logout as auth_logout
|
|||
from django.contrib.auth.models import User, AnonymousUser
|
||||
from django.contrib.auth.forms import AuthenticationForm
|
||||
from django.utils.translation import ugettext as _
|
||||
from authentic.saml.common import *
|
||||
from authentic.saml.models import *
|
||||
from authentic.authsaml2.utils import *
|
||||
from authentic2.saml.common import *
|
||||
from authentic2.saml.models import *
|
||||
from authentic2.authsaml2.utils import *
|
||||
|
||||
'''SAMLv2 SP implementation'''
|
||||
|
|
@ -7,7 +7,7 @@ from signals import auth_login
|
|||
from signals import auth_logout
|
||||
from signals import auth_oidlogin
|
||||
from django.conf import settings
|
||||
from admin_log_view.models import info
|
||||
from authentic2.admin_log_view.models import info
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.utils.importlib import import_module
|
||||
|
@ -88,13 +88,13 @@ class AdminBackend(object):
|
|||
return (('/admin', _('Authentic administration')),)
|
||||
return []
|
||||
|
||||
auth_login.connect(LogAuthLogin, dispatch_uid = "authentic.idp")
|
||||
auth_logout.connect(LogAuthLogout, dispatch_uid = "authentic.idp")
|
||||
auth_oidlogin.connect(LogAuthLoginOI, dispatch_uid ="authentic.idp")
|
||||
auth_login.connect(LogAuthLogin, dispatch_uid = "authentic2.idp")
|
||||
auth_logout.connect(LogAuthLogout, dispatch_uid = "authentic2.idp")
|
||||
auth_oidlogin.connect(LogAuthLoginOI, dispatch_uid ="authentic2.idp")
|
||||
|
||||
if settings.AUTH_OPENID:
|
||||
from django_authopenid.signals import oid_register
|
||||
from django_authopenid.signals import oid_associate
|
||||
oid_register.connect(LogRegisteredOI, dispatch_uid = "authentic.idp")
|
||||
oid_associate.connect(LogAssociatedOI, dispatch_uid = "authentic.idp")
|
||||
oid_register.connect(LogRegisteredOI, dispatch_uid = "authentic2.idp")
|
||||
oid_associate.connect(LogAssociatedOI, dispatch_uid = "authentic2.idp")
|
||||
|
|
@ -3,8 +3,8 @@ import urllib
|
|||
from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
import authentic.saml.models as models
|
||||
import authentic.idp.saml.saml2_endpoints as saml2_endpoints
|
||||
import authentic2.saml.models as models
|
||||
import authentic2.idp.saml.saml2_endpoints as saml2_endpoints
|
||||
|
||||
class SamlBackend(object):
|
||||
def service_list(self, request):
|
|
@ -10,8 +10,8 @@ from django.utils.translation import ugettext as _
|
|||
from django.views.decorators.csrf import csrf_exempt
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from authentic.saml.models import *
|
||||
from authentic.saml.common import *
|
||||
from authentic2.saml.models import *
|
||||
from authentic2.saml.common import *
|
||||
from interaction import consent
|
||||
|
||||
def fill_assertion(request, saml_request, assertion, provider_id):
|
|
@ -14,12 +14,12 @@ from django.contrib.auth.decorators import login_required
|
|||
from django.contrib.auth import BACKEND_SESSION_KEY
|
||||
|
||||
|
||||
import authentic.idp as idp
|
||||
import authentic.idp.views as idp_views
|
||||
from authentic.saml.models import *
|
||||
from authentic.saml.common import *
|
||||
import authentic.saml.saml2utils as saml2utils
|
||||
from authentic.idp.models import AuthenticationEvent
|
||||
import authentic2.idp as idp
|
||||
import authentic2.idp.views as idp_views
|
||||
from authentic2.saml.models import *
|
||||
from authentic2.saml.common import *
|
||||
import authentic2.saml.saml2utils as saml2utils
|
||||
from authentic2.idp.models import AuthenticationEvent
|
||||
from common import redirect_to_login, NONCE, kill_django_sessions
|
||||
|
||||
'''SAMLv2 IdP implementation
|
||||
|
@ -99,12 +99,12 @@ def build_assertion(request, login, nid_format = 'transient'):
|
|||
if __user_backend_from_session:
|
||||
backend = request.session[BACKEND_SESSION_KEY]
|
||||
if backend in ('django.contrib.auth.backends.ModelBackend',
|
||||
'authentic.idp.auth_backends.LogginBackend'):
|
||||
'authentic2.idp.auth_backends.LogginBackend'):
|
||||
if ssl:
|
||||
authn_context = lasso.SAML2_AUTHN_CONTEXT_PASSWORD_PROTECTED_TRANSPORT
|
||||
else:
|
||||
authn_context = lasso.SAML2_AUTHN_CONTEXT_PASSWORD
|
||||
elif backend == 'authentic.sslauth.backends.SSLAuthBackend':
|
||||
elif backend == 'authentic2.sslauth.backends.SSLAuthBackend':
|
||||
authn_context = lasso.LASSO_SAML2_AUTHN_CONTEXT_X509
|
||||
else:
|
||||
raise Exception('unknown backend: ' + backend)
|
|
@ -26,8 +26,8 @@ from openid.consumer.discover import DiscoveryFailure
|
|||
from openid.yadis import xri
|
||||
import signals
|
||||
|
||||
import authentic.saml.common
|
||||
import authentic.authsaml2.utils
|
||||
import authentic2.saml.common
|
||||
import authentic2.authsaml2.utils
|
||||
|
||||
OPENID_PROVIDER = ['https://me.yahoo.com//','http://openid.aol.com/','http://.myopenid.com/',
|
||||
'http://.livejournal.com/','http://www.flickr.com/photos//','http://.wordpress.com/'
|
||||
|
@ -37,7 +37,7 @@ OPENID_PROVIDER = ['https://me.yahoo.com//','http://openid.aol.com/','http://.my
|
|||
__logout_redirection_timeout = getattr(settings, 'IDP_LOGOUT_TIMEOUT', 600)
|
||||
|
||||
def accumulate_from_backends(request, method_name):
|
||||
from authentic.idp import get_backends
|
||||
from authentic2.idp import get_backends
|
||||
list = []
|
||||
for backend in get_backends():
|
||||
method = getattr(backend, method_name, None)
|
||||
|
@ -51,22 +51,22 @@ def service_list(request):
|
|||
|
||||
def homepage(request):
|
||||
'''Homepage of the IdP'''
|
||||
import authentic.saml.common
|
||||
import authentic.authsaml2.utils
|
||||
import authentic2.saml.common
|
||||
import authentic2.authsaml2.utils
|
||||
tpl_parameters = {}
|
||||
tpl_parameters['authorized_services'] = service_list(request)
|
||||
if authentic.authsaml2.utils.is_sp_configured():
|
||||
tpl_parameters['provider_active_session'] = authentic.saml.common.get_provider_of_active_session(request)
|
||||
tpl_parameters['provider_name'] = authentic.saml.common.get_provider_of_active_session_name(request)
|
||||
if authentic2.authsaml2.utils.is_sp_configured():
|
||||
tpl_parameters['provider_active_session'] = authentic2.saml.common.get_provider_of_active_session(request)
|
||||
tpl_parameters['provider_name'] = authentic2.saml.common.get_provider_of_active_session_name(request)
|
||||
if settings.IDP_OPENID:
|
||||
tpl_parameters['openid'] = request.user.openid_set
|
||||
tpl_parameters['IDP_OPENID'] = settings.IDP_OPENID
|
||||
return render_to_response('index.html', tpl_parameters, RequestContext(request))
|
||||
|
||||
def authsaml2_login_page(request):
|
||||
if not authentic.authsaml2.utils.is_sp_configured():
|
||||
if not authentic2.authsaml2.utils.is_sp_configured():
|
||||
return {}
|
||||
return {'providers_list': authentic.saml.common.get_idp_list()}
|
||||
return {'providers_list': authentic2.saml.common.get_idp_list()}
|
||||
|
||||
def logout_list(request):
|
||||
'''Return logout links from idp backends'''
|
|
@ -11,9 +11,9 @@ from django.http import HttpResponseRedirect, Http404, HttpResponse
|
|||
from django.shortcuts import render_to_response
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from saml.models import *
|
||||
import saml.saml2utils as saml2utils
|
||||
import saml.saml11utils as saml11utils
|
||||
from models import *
|
||||
import saml2utils
|
||||
import saml11utils
|
||||
|
||||
AUTHENTIC_STATUS_CODE_NS = "http://authentic.entrouvert.org/status_code/"
|
||||
AUTHENTIC_STATUS_CODE_UNKNOWN_PROVIDER = AUTHENTIC_STATUS_CODE_NS + \
|
||||
|
@ -551,7 +551,7 @@ def set_saml2_response_responder_status_code(response, code):
|
|||
|
||||
def error_page(request, message):
|
||||
logging.error('Error returned: %r' % message)
|
||||
return render_to_response('error_authsaml2.html', {'error': message},
|
||||
return render_to_response('error.html', {'msg': message},
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
def soap_fault(request, faultcode='soap:Client', faultstring=None):
|
|
@ -4,11 +4,11 @@ import os
|
|||
|
||||
gettext_noop = lambda s: s
|
||||
|
||||
DEBUG = True
|
||||
USE_DEBUG_TOOLBAR = True
|
||||
DEBUG = False
|
||||
USE_DEBUG_TOOLBAR = False
|
||||
STATIC_SERVE = True
|
||||
TEMPLATE_DEBUG = DEBUG
|
||||
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
|
||||
_PROJECT_PATH = os.path.join(os.path.dirname(__file__), '..')
|
||||
|
||||
ADMINS = (
|
||||
# ('Your Name', 'your_email@domain.com'),
|
||||
|
@ -19,7 +19,7 @@ MANAGERS = ADMINS
|
|||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': os.path.join(PROJECT_PATH, 'authentic.db'),
|
||||
'NAME': 'authentic.db',
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ USE_L10N = True
|
|||
|
||||
# Absolute path to the directory that holds media.
|
||||
# Example: "/home/media/media.lawrence.com/"
|
||||
MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')
|
||||
MEDIA_ROOT = os.path.join(_PROJECT_PATH, 'media')
|
||||
|
||||
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
||||
# trailing slash if there is a path component (optional in other cases).
|
||||
|
@ -86,7 +86,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
|
|||
'django.core.context_processors.media',
|
||||
'django.core.context_processors.request',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
'authentic.core.context_processors.auth_settings',
|
||||
'authentic2.core.context_processors.auth_settings',
|
||||
)
|
||||
|
||||
MIDDLEWARE_CLASSES = (
|
||||
|
@ -97,14 +97,14 @@ MIDDLEWARE_CLASSES = (
|
|||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'authentic.admin_log_view.middleware.LoggerMiddleware',
|
||||
'authentic.idp.middleware.DebugMiddleware'
|
||||
'authentic2.admin_log_view.middleware.LoggerMiddleware',
|
||||
'authentic2.idp.middleware.DebugMiddleware'
|
||||
)
|
||||
|
||||
ROOT_URLCONF = 'authentic.urls'
|
||||
ROOT_URLCONF = 'authentic2.urls'
|
||||
|
||||
TEMPLATE_DIRS = (
|
||||
os.path.join(PROJECT_PATH, 'templates'),
|
||||
os.path.join(_PROJECT_PATH, 'templates'),
|
||||
)
|
||||
|
||||
INSTALLED_APPS = (
|
||||
|
@ -114,12 +114,12 @@ INSTALLED_APPS = (
|
|||
'django.contrib.messages',
|
||||
'django.contrib.admin',
|
||||
'django.contrib.sites',
|
||||
'authentic.saml',
|
||||
'authentic.idp',
|
||||
'authentic.idp.saml',
|
||||
'authentic2.saml',
|
||||
'authentic2.idp',
|
||||
'authentic2.idp.saml',
|
||||
'registration',
|
||||
'authentic.sslauth',
|
||||
'authentic.admin_log_view',
|
||||
'authentic2.sslauth',
|
||||
'authentic2.admin_log_view',
|
||||
)
|
||||
|
||||
MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
|
||||
|
@ -164,26 +164,26 @@ gmsgaiMCgYB/nrTk89Fp7050VKCNnIt1mHAcO9cBwDV8qrJ5O3rIVmrg1T6vn0aY
|
|||
wRiVcNacaP+BivkrMjr4BlsUM6yH4MOBsNhLURiiCL+tLJV7U0DWlCse/doWij4U
|
||||
TKX6tp6oI+7MIJE6ySZ0cBqOiydAkBePZhu57j6ToBkTa0dbHjn1WA==
|
||||
-----END RSA PRIVATE KEY-----'''
|
||||
SAML_METADATA_ROOT = os.path.join(PROJECT_PATH, 'metadata')
|
||||
SAML_METADATA_ROOT = 'metadata'
|
||||
|
||||
# SSL settings
|
||||
AUTH_SSL = True
|
||||
SSLAUTH_CREATE_USER = True
|
||||
AUTHENTICATION_BACKENDS = (
|
||||
'authentic.idp.auth_backends.LogginBackend',
|
||||
'authentic2.idp.auth_backends.LogginBackend',
|
||||
'django.contrib.auth.backends.ModelBackend',
|
||||
'authentic.sslauth.backends.SSLAuthBackend',
|
||||
'authentic2.sslauth.backends.SSLAuthBackend',
|
||||
)
|
||||
|
||||
# IDP
|
||||
IDP_BACKENDS = [ 'authentic.idp.saml.backend.SamlBackend',
|
||||
'authentic.idp.AdminBackend' ]
|
||||
IDP_BACKENDS = [ 'authentic2.idp.saml.backend.SamlBackend',
|
||||
'authentic2.idp.AdminBackend' ]
|
||||
|
||||
#AuthSAML2 Configuration
|
||||
INSTALLED_APPS += ('authentic.authsaml2',)
|
||||
SAML2_BACKEND = 'authentic.authsaml2.backends.AuthSAML2Backend'
|
||||
INSTALLED_APPS += ('authentic2.authsaml2',)
|
||||
SAML2_BACKEND = 'authentic2.authsaml2.backends.AuthSAML2Backend'
|
||||
AUTHENTICATION_BACKENDS += (SAML2_BACKEND,)
|
||||
TEMPLATE_CONTEXT_PROCESSORS += ('authentic.idp.views.authsaml2_login_page',)
|
||||
TEMPLATE_CONTEXT_PROCESSORS += ('authentic2.idp.views.authsaml2_login_page',)
|
||||
|
||||
# OpenID settings
|
||||
AUTH_OPENID = True
|
||||
|
@ -214,6 +214,3 @@ if AUTH_OPENID:
|
|||
if IDP_OPENID:
|
||||
INSTALLED_APPS += ('django_openid_provider',
|
||||
'openid_provider',)
|
||||
TEMPLATE_DIRS = (
|
||||
os.path.join(PROJECT_PATH, 'templates/django_openid_provider'),
|
||||
)
|
|
@ -32,7 +32,7 @@ Add a file django.wsgi, e.g.:
|
|||
"""
|
||||
import os
|
||||
sys.path.append('/Donnees/devs/Authentic/')
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'authentic.settings'
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
|
||||
import django.core.handlers.wsgi
|
||||
application = django.core.handlers.wsgi.WSGIHandler()
|
||||
"""
|
||||
|
@ -43,7 +43,7 @@ Give rights to Apache on your Authentic directory
|
|||
|
||||
Configure Authentic
|
||||
===================
|
||||
in authentic/settings.py:
|
||||
in settings.py:
|
||||
Set AUTH_SSL = True
|
||||
To create a user with the mail adress as identifier:
|
||||
SSLAUTH_CREATE_USER = True
|
|
@ -1,4 +1,4 @@
|
|||
from authentic.sslauth.models import DistinguishedName, ClientCertificate
|
||||
from authentic2.sslauth.models import DistinguishedName, ClientCertificate
|
||||
from django.contrib import admin
|
||||
|
||||
admin.site.register(DistinguishedName)
|
|
@ -2,6 +2,8 @@ from django.http import HttpResponseRedirect
|
|||
from django.contrib.auth import authenticate, login, logout, get_user
|
||||
from django.contrib.auth.models import AnonymousUser
|
||||
|
||||
from authentic2.saml.common import error_page
|
||||
|
||||
# Use of existing application sslauth
|
||||
from util import SSLInfo, settings_get
|
||||
|
||||
|
@ -11,7 +13,7 @@ def process_request(request):
|
|||
|
||||
# Check certificate validity
|
||||
if not ssl_info.verify:
|
||||
return HttpResponseRedirect("/error_ssl/")
|
||||
return error_page('SSL CGI variable VERIFY is missing')
|
||||
|
||||
# Kill another active session
|
||||
logout(request)
|
||||
|
@ -19,9 +21,6 @@ def process_request(request):
|
|||
# return a known user else an anonymous one
|
||||
user = authenticate(ssl_info=ssl_info) or AnonymousUser()
|
||||
|
||||
if user is None:
|
||||
return HttpResponseRedirect("/error_ssl/")
|
||||
|
||||
# Add user entry if unknown
|
||||
# TODO: With Admin set SSLAUTH_CREATE_USER
|
||||
# then define in SSLAUTH_CREATE_USERNAME_CALLBACK = myusernamegen
|
||||
|
@ -43,14 +42,12 @@ def process_request(request):
|
|||
if SSLAuthBackend().create_user(ssl_info):
|
||||
user = authenticate(ssl_info=ssl_info)
|
||||
else:
|
||||
return HttpResponseRedirect("/error_ssl/")
|
||||
return error_page('User unknown for the current SSL context')
|
||||
|
||||
# Check if the user is activated
|
||||
if not user.is_authenticated() or not user.is_active:
|
||||
return HttpResponseRedirect("/error_ssl/")
|
||||
return error_page('User %s is inactive' % user.username)
|
||||
|
||||
# Log user in
|
||||
login(request, user)
|
||||
return HttpResponseRedirect("/")
|
||||
|
||||
|
|
@ -2,29 +2,29 @@ from django.conf.urls.defaults import *
|
|||
from django.contrib import admin
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.views.generic.simple import direct_to_template
|
||||
import authentic.idp.views
|
||||
import authentic.idp.login_views
|
||||
import authentic2.idp.views
|
||||
import authentic2.idp.login_views
|
||||
import settings
|
||||
|
||||
admin.autodiscover()
|
||||
|
||||
urlpatterns = patterns('',
|
||||
(r'^admin/admin_log_view/log/', 'admin_log_view.views.admin_view'),
|
||||
(r'^admin/admin_log_view/log/', 'authentic2.admin_log_view.views.admin_view'),
|
||||
(r'^admin/', include(admin.site.urls)),
|
||||
(r'^idp/', include('authentic.idp.urls')),
|
||||
(r'^$', login_required(authentic.idp.views.homepage), {}, 'index'),
|
||||
(r'^idp/', include('authentic2.idp.urls')),
|
||||
(r'^$', login_required(authentic2.idp.views.homepage), {}, 'index'),
|
||||
)
|
||||
|
||||
if settings.IDP_OPENID:
|
||||
import authentic.django_openid_provider.views
|
||||
import authentic2.django_openid_provider.views
|
||||
import openid_provider.views
|
||||
urlpatterns += patterns('',
|
||||
(r'^openid/$',authentic.django_openid_provider.views.openid_server, {},'openid-provider-root'),
|
||||
(r'^openid/decide/$',authentic.django_openid_provider.views.openid_decide, {},'openid-provider-decide'),
|
||||
(r'^openid/manage/',authentic.django_openid_provider.views.manage_trustroot, {},'manage_trustroot'),
|
||||
(r'^openid/manageid/',authentic.django_openid_provider.views.manage_id, {},'manage_id' ),
|
||||
(r'^openid/manageid_confirm/',authentic.django_openid_provider.views.manage_id_confirm, {}, 'manage_id_confirm'),
|
||||
(r'^openid/addopenid/',authentic.django_openid_provider.views.addopenid, {}, 'add_openid'),
|
||||
(r'^openid/$',authentic2.django_openid_provider.views.openid_server, {},'openid-provider-root'),
|
||||
(r'^openid/decide/$',authentic2.django_openid_provider.views.openid_decide, {},'openid-provider-decide'),
|
||||
(r'^openid/manage/',authentic2.django_openid_provider.views.manage_trustroot, {},'manage_trustroot'),
|
||||
(r'^openid/manageid/',authentic2.django_openid_provider.views.manage_id, {},'manage_id' ),
|
||||
(r'^openid/manageid_confirm/',authentic2.django_openid_provider.views.manage_id_confirm, {}, 'manage_id_confirm'),
|
||||
(r'^openid/addopenid/',authentic2.django_openid_provider.views.addopenid, {}, 'add_openid'),
|
||||
(r'^openid/',include('openid_provider.urls')),
|
||||
url(r'^(?P<id>[a-zA-Z0-9,_,]*/?)/$', openid_provider.views.openid_xrds, {'identity': True}, name='openid-provider-identity'),
|
||||
)
|
||||
|
@ -32,32 +32,32 @@ if settings.IDP_OPENID:
|
|||
if settings.AUTH_OPENID:
|
||||
import django_authopenid
|
||||
urlpatterns += patterns('',
|
||||
(r'^accounts/openid/complete/associate/$', authentic.idp.views.complete_associate,{}, 'user_complete_myassociate'),
|
||||
(r'^accounts/openid/complete/associate/$', authentic2.idp.views.complete_associate,{}, 'user_complete_myassociate'),
|
||||
(r'^accounts/openid/$', 'django.views.generic.simple.redirect_to', {'url': '..'}),
|
||||
(r'^accounts/openid/signin/complete/signin/', authentic.idp.views.complete_signin,{} ,'user_complete_signin'),
|
||||
(r'^accounts/openid/dissociate/$', authentic.idp.views.dissociate,{} ,'user-dissociate'),#
|
||||
(r'^accounts/openid/associate/$', authentic.idp.views.associate,{} ,'user-associate'),#
|
||||
(r'^accounts/openid/signin/complete/signin/', authentic2.idp.views.complete_signin,{} ,'user_complete_signin'),
|
||||
(r'^accounts/openid/dissociate/$', authentic2.idp.views.dissociate,{} ,'user-dissociate'),#
|
||||
(r'^accounts/openid/associate/$', authentic2.idp.views.associate,{} ,'user-associate'),#
|
||||
(r'^accounts/openid/password/change/$', django_authopenid.views.password_change, {}, 'authopenid_password_change'),
|
||||
(r'^accounts/openid/signin/complete/', include ('django_authopenid.urls')),
|
||||
(r'^accounts/openid/signin/',authentic.idp.views.signin,{} ,'user_signin'),
|
||||
(r'^accounts/openid/signin/',authentic2.idp.views.signin,{} ,'user_signin'),
|
||||
)
|
||||
|
||||
urlpatterns += patterns('',
|
||||
(r'^accounts/logout/', 'authentic.idp.views.logout'),
|
||||
(r'^accounts/logout/', 'authentic2.idp.views.logout'),
|
||||
(r'^accounts/$', 'django.views.generic.simple.redirect_to', {'url': '..'}),
|
||||
(r'^accounts/password/change/$','idp.views.password_change'),
|
||||
url(r'^accounts/login', authentic.idp.login_views.login, name='auth_login'),
|
||||
(r'^accounts/password/change/$','authentic2.idp.views.password_change'),
|
||||
url(r'^accounts/login', authentic2.idp.login_views.login, name='auth_login'),
|
||||
(r'^accounts/', include('registration.urls')),
|
||||
)
|
||||
|
||||
urlpatterns += patterns('',
|
||||
(r'^authsaml2/', include('authentic.authsaml2.urls')),
|
||||
(r'^authsaml2/', include('authentic2.authsaml2.urls')),
|
||||
)
|
||||
|
||||
if settings.AUTH_SSL:
|
||||
urlpatterns += patterns('',
|
||||
url(r'^sslauth/$',
|
||||
'authentic.sslauth.login_ssl.process_request',
|
||||
'authentic2.sslauth.login_ssl.process_request',
|
||||
name='user_signin_ssl'),
|
||||
url(r'^error_ssl/$', direct_to_template,
|
||||
{'template': 'error_ssl.html'}, 'error_ssl'),
|
|
@ -1,12 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
<h2>{% trans "Error" %}</h2>
|
||||
{% if error %}
|
||||
<p>{{ error }}</p>
|
||||
{% else %}
|
||||
<p>Unknown error</a></p>
|
||||
{% endif %}
|
||||
<p><a href='/'>Back</a></p>
|
||||
{% endblock %}
|
|
@ -4,7 +4,7 @@ Setting up an Authentic server
|
|||
On installation the package will have created an empty database, you should add
|
||||
a super user, using the following command::
|
||||
|
||||
su authentic -p -c "python /usr/shareyshared/authentic/manage.py createsuperuser"
|
||||
su authentic -p -c "python /usr/share/authentic2/manage.py createsuperuser"
|
||||
|
||||
The package doesn't ship a startup script, that would start Authentic
|
||||
automatically, that is because running an identity server on the builtin HTTP
|
||||
|
@ -13,5 +13,5 @@ server (not HTTPS!) is definitely not a good idea.
|
|||
Even though, if you want a quick look, before configuring properly a real HTTP
|
||||
server, you can use this command::
|
||||
|
||||
su authentic -p -c "python /usr/share/pyshared/authentic/manage.py runserver"
|
||||
su authentic -p -c "python /usr/share/authentic2/manage.py runserver"
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
WSGIScriptAlias / /usr/share/authentic/authentic.wsgi
|
||||
WSGIScriptAlias / /usr/share/authentic2/authentic.wsgi
|
||||
Alias /media/admin/ /usr/share/pyshared/django/contrib/admin/media/
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
etc/authentic
|
||||
usr/share/authentic
|
|
@ -1,4 +0,0 @@
|
|||
import os
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'authentic.settings'
|
||||
import django.core.handlers.wsgi
|
||||
application = django.core.handlers.wsgi.WSGIHandler()
|
|
@ -0,0 +1,2 @@
|
|||
etc/authentic2
|
||||
usr/share/authentic2
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Postinst script for authentic
|
||||
# Postinst script for authentic2
|
||||
#
|
||||
|
||||
set -e
|
||||
|
@ -25,9 +25,9 @@ case "$1" in
|
|||
echo "..done"
|
||||
fi
|
||||
|
||||
mkdir -p /var/lib/authentic
|
||||
chmod 755 /var/lib/authentic
|
||||
chown $AUTHENTIC_USER:$AUTHENTIC_GROUP /var/lib/authentic
|
||||
mkdir -p /var/lib/authentic2
|
||||
chmod 755 /var/lib/authentic2
|
||||
chown $AUTHENTIC_USER:$AUTHENTIC_GROUP /var/lib/authentic2
|
||||
|
||||
;;
|
||||
|
||||
|
@ -40,18 +40,18 @@ case "$1" in
|
|||
;;
|
||||
esac
|
||||
|
||||
rm -f /var/lib/pycentral/authentic.pkgremove
|
||||
rm -f /var/lib/pycentral/authentic2.pkgremove
|
||||
if which pycentral >/dev/null 2>&1; then
|
||||
pycentral pkginstall authentic
|
||||
if grep -qs '^authentic$' /var/lib/pycentral/delayed-pkgs; then
|
||||
sed -i '/^authentic$/d' /var/lib/pycentral/delayed-pkgs
|
||||
pycentral pkginstall authentic2
|
||||
if grep -qs '^authentic2$' /var/lib/pycentral/delayed-pkgs; then
|
||||
sed -i '/^authentic2$/d' /var/lib/pycentral/delayed-pkgs
|
||||
fi
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
if [ -z "$2" ]; then
|
||||
su authentic -p -c "django-admin syncdb --settings authentic.settings --noinput"
|
||||
su authentic -p -c "django-admin syncdb --settings authentic2.settings --noinput"
|
||||
fi
|
||||
;;
|
||||
esac
|
|
@ -0,0 +1,9 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
# Allows to lookup local_settings.py
|
||||
sys.path.append('/etc/authentic2')
|
||||
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'authentic2.settings'
|
||||
import django.core.handlers.wsgi
|
||||
application = django.core.handlers.wsgi.WSGIHandler()
|
|
@ -1,4 +1,4 @@
|
|||
authentic (1.9.0-0) unstable; urgency=low
|
||||
authentic2 (1.9.0-0) unstable; urgency=low
|
||||
|
||||
* Initial packaging.
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
diff --git a/settings.py b/settings.py
|
||||
diff --git a/authentic2/settings.py b/authentic2/settings.py
|
||||
index e65f7ae..3919505 100644
|
||||
--- a/settings.py
|
||||
+++ b/settings.py
|
||||
--- a/authentic2/settings.py
|
||||
+++ b/authentic2/settings.py
|
||||
@@ -19,7 +19,7 @@ MANAGERS = ADMINS
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
- 'NAME': os.path.join(PROJECT_PATH, 'authentic.db'),
|
||||
- 'NAME': 'authentic.db',
|
||||
+ 'NAME': '/var/lib/authentic/authentic.db',
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
diff --git a/settings.py b/settings.py
|
||||
diff --git a/authentic2/settings.py b/authentic2/settings.py
|
||||
index e65f7ae..cb8faec 100644
|
||||
--- a/settings.py
|
||||
+++ b/settings.py
|
||||
--- a/authentic2/settings.py
|
||||
+++ b/authentic2/settings.py
|
||||
@@ -4,8 +4,8 @@ import os
|
||||
|
||||
gettext_noop = lambda s: s
|
||||
|
@ -12,4 +12,3 @@ index e65f7ae..cb8faec 100644
|
|||
+USE_DEBUG_TOOLBAR = False
|
||||
STATIC_SERVE = True
|
||||
TEMPLATE_DEBUG = DEBUG
|
||||
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/make -f
|
||||
|
||||
d=$(CURDIR)/debian/authentic
|
||||
d=$(CURDIR)/debian/authentic2
|
||||
|
||||
%:
|
||||
dh --with quilt --with python-central $@
|
||||
|
@ -10,8 +10,7 @@ override_dh_install:
|
|||
|
||||
override_dh_pycentral:
|
||||
dh_pycentral
|
||||
touch $(d)/etc/authentic/local_settings.py
|
||||
ln -s /etc/authentic/local_settings.py $(d)/usr/share/pyshared/authentic/local_settings.py
|
||||
touch $(d)/etc/authentic2/local_settings.py
|
||||
cp $(CURDIR)/debian/apache2.conf $(d)/usr/share/authentic/
|
||||
cp $(CURDIR)/debian/authentic.wsgi $(d)/usr/share/authentic/
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#!/usr/bin/env python
|
||||
from django.core.management import execute_manager
|
||||
try:
|
||||
import settings # Assumed to be in the same directory.
|
||||
import authentic2.settings # Assumed to be in the same directory.
|
||||
except ImportError:
|
||||
import sys
|
||||
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
execute_manager(settings)
|
||||
execute_manager(authentic2.settings)
|
||||
|
|
19
setup.py
19
setup.py
|
@ -76,23 +76,11 @@ if not os.path.exists("PKG-INFO"):
|
|||
if os.path.exists("authentic/local_settings.pyc"):
|
||||
os.unlink("authentic/local_settings.pyc")
|
||||
|
||||
# Since we don't actually keep our directories in a authentic directory
|
||||
# like we really should, we have to fake it. Prepend "authentic." here,
|
||||
# set package_dir below.
|
||||
authentic_dirs = []
|
||||
|
||||
for dirname in os.listdir("."):
|
||||
if os.path.isdir(dirname) and dirname != 'authentic':
|
||||
authentic_dirs.append(dirname)
|
||||
authentic_dirs.append(dirname + ".*")
|
||||
|
||||
packages = [ package_name for package_name in find_packages(exclude=authentic_dirs) ]
|
||||
|
||||
# Import this now, since authentic is in the right place now.
|
||||
from authentic import VERSION
|
||||
from authentic2 import VERSION
|
||||
|
||||
# Build the authentic package.
|
||||
setup(name="authentic",
|
||||
setup(name="authentic2",
|
||||
version=VERSION,
|
||||
license="GPLv2 or later",
|
||||
description="Authentic, a versatile identity server",
|
||||
|
@ -101,7 +89,7 @@ setup(name="authentic",
|
|||
author_email="authentic-devel@lists.labs.libre-entreprise.org",
|
||||
maintainer="Benjamin Dauvergne",
|
||||
maintainer_email="bdauvergne@entrouvert.com",
|
||||
packages=packages,
|
||||
py_modules=['manage'],
|
||||
cmdclass=cmdclasses,
|
||||
install_requires=[
|
||||
'Django>=1.2.0',
|
||||
|
@ -109,7 +97,6 @@ setup(name="authentic",
|
|||
'django-debug-toolbar',
|
||||
'django-authopenid>=1.0',
|
||||
],
|
||||
include_package_data=True,
|
||||
zip_safe=False,
|
||||
classifiers=[
|
||||
"Development Status :: 2 - Pre-Alpha",
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
{% extends "openid_provider/base.html" %}
|
||||
|
||||
{% load breadcrumbs %}
|
||||
{% block breadcrumbs %}
|
||||
{{ block.super }}
|
||||
{% breadcrumb_url 'Manage OpenID' manage_id %}
|
||||
{% breadcrumb_url 'Error' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ title }}</h1>
|
||||
{{ msg }}
|
||||
{% endblock %}
|
|
@ -0,0 +1,6 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ title }}</h1>
|
||||
{{ trans msg }}
|
||||
{% endblock %}
|
Loading…
Reference in New Issue