mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-02-25 17:36:31 +00:00
Compare commits
4 Commits
516a7f4be5
...
82fea65b5e
Author | SHA1 | Date | |
---|---|---|---|
|
82fea65b5e | ||
|
abc88d0118 | ||
|
b6b81a8b8f | ||
|
d228dbf225 |
@ -2,7 +2,8 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from django.conf import settings
|
||||
from django.conf.urls import url, include
|
||||
from django.conf.urls import include
|
||||
from django.urls import re_path
|
||||
from rest_framework import routers
|
||||
|
||||
from .views import UserInformationView
|
||||
@ -47,7 +48,7 @@ app_name = 'api'
|
||||
# Wire up our API using automatic URL routing.
|
||||
# Additionally, we include login URLs for the browsable API.
|
||||
urlpatterns = [
|
||||
url('^', include(router.urls)),
|
||||
url('^me/', UserInformationView.as_view()),
|
||||
url('^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
|
||||
re_path('^', include(router.urls)),
|
||||
re_path('^me/', UserInformationView.as_view()),
|
||||
re_path('^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
|
||||
]
|
||||
|
@ -44,6 +44,8 @@ class PermissionOAuth2Validator(OAuth2Validator):
|
||||
subset of permissions.
|
||||
"""
|
||||
|
||||
oidc_claim_scope = None # fix breaking change of django-oauth-toolkit 2.0.0
|
||||
|
||||
valid_scopes = set()
|
||||
|
||||
for t in Permission.PERMISSION_TYPES:
|
||||
|
@ -25,8 +25,8 @@ admin_site.register(Site, SiteAdmin)
|
||||
|
||||
# Add external apps model
|
||||
if "oauth2_provider" in settings.INSTALLED_APPS:
|
||||
from oauth2_provider.admin import Application, ApplicationAdmin, Grant, \
|
||||
GrantAdmin, AccessToken, AccessTokenAdmin, RefreshToken, RefreshTokenAdmin
|
||||
from oauth2_provider.admin import ApplicationAdmin, GrantAdmin, AccessTokenAdmin, RefreshTokenAdmin
|
||||
from oauth2_provider.models import Application, Grant, AccessToken, RefreshToken
|
||||
admin_site.register(Application, ApplicationAdmin)
|
||||
admin_site.register(Grant, GrantAdmin)
|
||||
admin_site.register(AccessToken, AccessTokenAdmin)
|
||||
|
@ -90,12 +90,14 @@ MIDDLEWARE = [
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
'django.middleware.locale.LocaleMiddleware',
|
||||
'django.contrib.sites.middleware.CurrentSiteMiddleware',
|
||||
'django_htcpcp_tea.middleware.HTCPCPTeaMiddleware',
|
||||
'note_kfet.middlewares.SessionMiddleware',
|
||||
'note_kfet.middlewares.LoginByIPMiddleware',
|
||||
'note_kfet.middlewares.TurbolinksMiddleware',
|
||||
'note_kfet.middlewares.ClacksMiddleware',
|
||||
]
|
||||
if "django_htcpcp_tea" in INSTALLED_APPS:
|
||||
MIDDLEWARE.append('django_htcpcp_tea.middleware.HTCPCPTeaMiddleware')
|
||||
|
||||
|
||||
ROOT_URLCONF = 'note_kfet.urls'
|
||||
|
||||
@ -263,6 +265,9 @@ OAUTH2_PROVIDER = {
|
||||
'REFRESH_TOKEN_EXPIRE_SECONDS': timedelta(days=14),
|
||||
}
|
||||
|
||||
# PKCE (fix a breaking change of django-oauth-toolkit 2.0.0)
|
||||
PKCE_REQUIRED = False
|
||||
|
||||
# Take control on how widget templates are sourced
|
||||
# See https://docs.djangoproject.com/en/2.2/ref/forms/renderers/#templatessetting
|
||||
FORM_RENDERER = 'django.forms.renderers.TemplatesSetting'
|
||||
|
Loading…
x
Reference in New Issue
Block a user