Hiding action endpoints
* adding settings to hide action endpoints Change-Id: I01cf6859cbc1f056d463e48997bbebed6411f24b
This commit is contained in:
parent
48ac1dc081
commit
059c296e75
|
@ -40,6 +40,7 @@ EMAIL_SETTINGS:
|
|||
EMAIL_BACKEND: django.core.mail.backends.console.EmailBackend
|
||||
|
||||
# Application settings:
|
||||
SHOW_ACTION_ENDPOINTS: False
|
||||
|
||||
# setting to control if user name and email are allowed
|
||||
# to have different values.
|
||||
|
|
|
@ -16,6 +16,7 @@ from django.conf.urls import url
|
|||
from stacktask.api.v1 import views
|
||||
from stacktask.api.v1 import tasks
|
||||
from stacktask.api.v1 import openstack
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
|
@ -26,15 +27,19 @@ urlpatterns = [
|
|||
url(r'^notifications/(?P<pk>\w+)/?$', views.NotificationDetail.as_view()),
|
||||
url(r'^notifications/?$', views.NotificationList.as_view()),
|
||||
|
||||
url(r'^actions/CreateProject/?$', tasks.CreateProject.as_view()),
|
||||
url(r'^actions/InviteUser/?$', tasks.InviteUser.as_view()),
|
||||
url(r'^actions/ResetPassword/?$', tasks.ResetPassword.as_view()),
|
||||
url(r'^actions/EditUser/?$', tasks.EditUser.as_view()),
|
||||
|
||||
url(r'^openstack/users/(?P<user_id>\w+)/roles/?$',
|
||||
openstack.UserRoles.as_view()),
|
||||
url(r'^openstack/users/(?P<user_id>\w+)/?$', openstack.UserDetail.as_view()),
|
||||
url(r'^openstack/users/(?P<user_id>\w+)/?$',
|
||||
openstack.UserDetail.as_view()),
|
||||
url(r'^openstack/users/?$', openstack.UserList.as_view()),
|
||||
url(r'^openstack/roles/?$', openstack.RoleList.as_view()),
|
||||
url(r'^openstack/forgotpassword/?$', openstack.ResetPassword.as_view()),
|
||||
]
|
||||
|
||||
if settings.SHOW_ACTION_ENDPOINTS:
|
||||
urlpatterns = urlpatterns + [
|
||||
url(r'^actions/CreateProject/?$', tasks.CreateProject.as_view()),
|
||||
url(r'^actions/InviteUser/?$', tasks.InviteUser.as_view()),
|
||||
url(r'^actions/ResetPassword/?$', tasks.ResetPassword.as_view()),
|
||||
url(r'^actions/EditUser/?$', tasks.EditUser.as_view()),
|
||||
]
|
||||
|
|
|
@ -145,6 +145,8 @@ TOKEN_SUBMISSION_URL = CONFIG['TOKEN_SUBMISSION_URL']
|
|||
|
||||
TOKEN_EXPIRE_TIME = CONFIG['TOKEN_EXPIRE_TIME']
|
||||
|
||||
SHOW_ACTION_ENDPOINTS = CONFIG['SHOW_ACTION_ENDPOINTS']
|
||||
|
||||
# Additonal actions for views:
|
||||
# - The order of the actions matters. These will run after the default action,
|
||||
# in the given order.
|
||||
|
|
|
@ -167,6 +167,8 @@ ROLES_MAPPING = {
|
|||
],
|
||||
}
|
||||
|
||||
SHOW_ACTION_ENDPOINTS = True
|
||||
|
||||
conf_dict = {
|
||||
"SECRET_KEY": SECRET_KEY,
|
||||
"ADDITIONAL_APPS": ADDITIONAL_APPS,
|
||||
|
@ -180,5 +182,6 @@ conf_dict = {
|
|||
"ACTION_SETTINGS": ACTION_SETTINGS,
|
||||
"TOKEN_SUBMISSION_URL": TOKEN_SUBMISSION_URL,
|
||||
"TOKEN_EXPIRE_TIME": TOKEN_EXPIRE_TIME,
|
||||
"ROLES_MAPPING": ROLES_MAPPING
|
||||
"ROLES_MAPPING": ROLES_MAPPING,
|
||||
"SHOW_ACTION_ENDPOINTS": SHOW_ACTION_ENDPOINTS
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue