Skip to content

Commit

Permalink
Configuration for cilogon_tokenauth
Browse files Browse the repository at this point in the history
  • Loading branch information
ericblau committed Dec 9, 2024
1 parent 55fa4bb commit f35255e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
'web',
'dal',
'dal_select2',
'cilogon_tokenauth',
]

MIDDLEWARE = [
Expand Down Expand Up @@ -351,7 +352,9 @@
STATICFILES_DIRS = (
os.path.join( os.path.dirname(__file__), '../static' ),
)

# For cilogon_tokenauth
CLIENT_KEY = CONF.get('CLIENT_KEY', None)
CLIENT_SECRET = CONF.get('CLIENT_SECRET', None)
#
# 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
REST_FRAMEWORK = {
Expand All @@ -367,6 +370,9 @@
'DEFAULT_PAGINATION_CLASS': "rest_framework.pagination.PageNumberPagination",
'PAGE_SIZE': 25,
'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema',
'DEFAULT_AUTHENTICATION_CLASSES': [
'cilogon_tokenauth.auth.CITokenAuthentication',
],
}

# REST_AUTH_REGISTER_PERMISSION_CLASSES = (
Expand Down Expand Up @@ -411,6 +417,10 @@
'services': {
'handlers': ['file'],
'level': 'DEBUG'
},
'cilogon_tokenauth': {
'handlers': ['file'],
'level': 'DEBUG'
}
}
}
4 changes: 3 additions & 1 deletion Operations_Warehouse_Django/glue2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,9 @@ class Software_Full(APIView):
'''
GLUE2 Software detailed information ApplicationHandle, ApplicationEnvironment, ...
'''
permission_classes = (IsAuthenticatedOrReadOnly,)
authentication_Classes = [ 'cilogon_tokenauth.auth.TokenAuthentication']
#permission_classes = (IsAuthenticatedOrReadOnly,)
permission_classes = (IsAuthenticated,)
serializer_class = Software_Community_Serializer
def get(self, request, format=None, **kwargs):
if 'id' in self.kwargs:
Expand Down

0 comments on commit f35255e

Please sign in to comment.