Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
site-kwei
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mediatek
site-kwei
Commits
971aba5c
Unverified
Commit
971aba5c
authored
3 years ago
by
Simon Fernandez
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #1 from GuilhemN/master
Expose CAS server
parents
3db08826
69873810
No related branches found
Branches containing commit
Tags
v1.2.2
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
interludes/cas_model.py
+15
-0
15 additions, 0 deletions
interludes/cas_model.py
interludes/settings.py
+5
-0
5 additions, 0 deletions
interludes/settings.py
interludes/urls.py
+1
-0
1 addition, 0 deletions
interludes/urls.py
with
21 additions
and
0 deletions
interludes/cas_model.py
0 → 100644
+
15
−
0
View file @
971aba5c
from
django.contrib.auth
import
get_user_model
from
cas_server.auth
import
AuthUser
,
DjangoAuthUser
class
InterLudesAuthUser
(
DjangoAuthUser
):
# pragma: no cover
"""
Overrides DjangoAuthUser constructor
"""
def
__init__
(
self
,
username
):
User
=
get_user_model
()
try
:
self
.
user
=
User
.
objects
.
get
(
email
=
username
)
except
User
.
DoesNotExist
:
pass
super
(
DjangoAuthUser
,
self
).
__init__
(
username
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
interludes/settings.py
+
5
−
0
View file @
971aba5c
...
...
@@ -90,6 +90,7 @@ INSTALLED_APPS = [
'
accounts.apps.AccountsConfig
'
,
'
site_settings.apps.SiteSettingsConfig
'
,
'
shared.apps.SharedConfig
'
,
'
cas_server
'
,
]
MIDDLEWARE
=
[
...
...
@@ -190,3 +191,7 @@ EMAIL_SIGNATURE = '-- Site Interludes (mail généré automatiquement)'
# Prefix to mails to users
USER_EMAIL_SUBJECT_PREFIX
=
"
[interludes]
"
# CAS SERVER
CAS_AUTH_CLASS
=
"
interludes.cas_model.InterLudesAuthUser
"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
interludes/urls.py
+
1
−
0
View file @
971aba5c
...
...
@@ -22,4 +22,5 @@ from django.conf.urls.static import static
urlpatterns
=
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
+
[
path
(
'
admin/
'
,
admin
.
site
.
urls
),
path
(
''
,
include
(
'
home.urls
'
)),
path
(
'
cas/
'
,
include
(
'
cas_server.urls
'
,
namespace
=
"
cas_server
"
)),
]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment