first push

This commit is contained in:
2026-01-18 12:05:56 +03:30
commit cdbb2e11ed
109 changed files with 3083 additions and 0 deletions

60
Authentication/urls.py Normal file
View File

@@ -0,0 +1,60 @@
from django.urls import path, include
from rest_framework import routers
from django.conf import settings
import oauth2_provider.views as oauth2_views
from Authentication.views import (
register,
login,
change_password,
check_otp,
send_otp,
UserIdentityViewSet, store_send_otp, Find_User, Identity, register_all, change_user_mobile, NumberOfActiveUsers,
remove_access_token,check_user_exists, remove_user_role
)
router = routers.DefaultRouter()
router.register('user_identity', UserIdentityViewSet, basename='user_identity')
oauth2_endpoint_views = [
path('authorize/', oauth2_views.AuthorizationView.as_view(), name="authorize"),
path('token/', oauth2_views.TokenView.as_view(), name="token"),
path('register/', register, name="register"),
path('register_all/', register_all, name="register_all"),
path('login/', login, name="login"),
path('change_password/', change_password, name="change_password"),
path('send_otp/', send_otp, name="send_otp"),
path('send/', store_send_otp, name="send"),
path('check_otp/', check_otp, name="check_otp"),
path('find/', Find_User, name="find"),
path('identity/', Identity, name="identity"),
path('active-users/', NumberOfActiveUsers, name="active-users"),
path('remove_access_token/', remove_access_token, name="remove_access_token"),
path('check_user_exists/', check_user_exists, name="check_user_exists"),
path('remove_user_role/', remove_user_role, name="remove_user_role"),
]
if settings.DEBUG:
# OAuth2 Application Management endpoints
oauth2_endpoint_views += [
path('applications/', oauth2_views.ApplicationList.as_view(), name="list"),
path('applications/register/', oauth2_views.ApplicationRegistration.as_view(), name="register"),
path('applications/<pk>/', oauth2_views.ApplicationDetail.as_view(), name="detail"),
path('applications/<pk>/delete/', oauth2_views.ApplicationDelete.as_view(), name="delete"),
path('applications/<pk>/update/', oauth2_views.ApplicationUpdate.as_view(), name="update"),
]
# OAuth2 Token Management endpoints
oauth2_endpoint_views += [
path('authorized-tokens/', oauth2_views.AuthorizedTokensListView.as_view(), name="authorized-token-list"),
path('authorized-tokens/<pk>/delete/', oauth2_views.AuthorizedTokenDeleteView.as_view(),
name="authorized-token-delete"),
]
urlpatterns = [
path('', include(router.urls)),
path('api/', include((oauth2_endpoint_views, 'oauth2_provider.urls'), namespace="oauth2_provider")),
path('change_mobile_number/', change_user_mobile),
]