def oauth_application_detail(auth, **kwargs): """Show detail for a single OAuth application""" client_id = kwargs.get("client_id") # The client ID must be an active and existing record, and the logged-in user must have permission to view it. try: # record = ApiOAuth2Application.find_one(Q("client_id", "eq", client_id)) except NoResultsFound: raise HTTPError(http.NOT_FOUND) if record.owner != auth.user: raise HTTPError(http.FORBIDDEN) if record.is_active is False: raise HTTPError(http.GONE) app_detail_url = api_v2_url("applications/{}/".format(client_id)) # Send request to this URL return {"app_list_url": "", "app_detail_url": app_detail_url}
def oauth_application_detail(auth, **kwargs): """Show detail for a single OAuth application""" client_id = kwargs.get('client_id') # The client ID must be an active and existing record, and the logged-in user must have permission to view it. try: # record = ApiOAuth2Application.find_one(Q('client_id', 'eq', client_id)) except NoResultsFound: raise HTTPError(http.NOT_FOUND) if record.owner != auth.user: raise HTTPError(http.FORBIDDEN) if record.is_active is False: raise HTTPError(http.GONE) app_detail_url = api_v2_url( "applications/{}/".format(client_id)) # Send request to this URL return {"app_list_url": '', "app_detail_url": app_detail_url}
def oauth_application_detail(auth, **kwargs): """Show detail for a single OAuth application""" # TODO: Remove dev_only restriction when APIv2 is released into production client_id = kwargs.get('client_id') # The client ID must be an active and existing record, and the logged-in user must have permission to view it. try: # record = ApiOAuth2Application.find_one(Q('client_id', 'eq', client_id)) except NoResultsFound: raise HTTPError(http.NOT_FOUND) if record.owner != auth.user: raise HTTPError(http.FORBIDDEN) if record.is_active is False: raise HTTPError(http.GONE) app_detail_url = api_v2_url("applications/{}/".format(client_id)) # Send request to this URL return {"app_list_url": '', "app_detail_url": app_detail_url}
def absolute_url(self, obj): obj = ApiOAuth2Application.find_one( Q('client_id', 'eq', obj['client_id'])) return obj.absolute_url
def absolute_url(self, obj): obj = ApiOAuth2Application.find_one(Q('client_id', 'eq', obj['client_id'])) return obj.absolute_url
def absolute_url(self, obj): obj = ApiOAuth2Application.find_one(Q("client_id", "eq", obj["client_id"])) return obj.absolute_url