@@ -755,14 +755,18 @@ def processes():
755755 def processes_from_namespace (namespace ):
756756 # TODO: this endpoint is in draft at the moment
757757 # see https://github.com/Open-EO/openeo-api/issues/310, https://github.com/Open-EO/openeo-api/pull/348
758- # TODO: convention for user namespace? use '@' instead of "u:"
759758 # TODO: unify with `/processes` endpoint?
759+ # TODO #377 pagination?
760+ _log .warning (f"Usage of non-standard endpoint `/processes/{ namespace } `" )
760761 full = smart_bool (request .args .get ("full" , False ))
761762 target_version = None
763+ # TODO: convention for user namespace? use '@' instead of "u:"
762764 if namespace .startswith ("u:" ) and backend_implementation .user_defined_processes :
763765 user_id = namespace .partition ("u:" )[- 1 ]
764- user_udps = [p for p in backend_implementation .user_defined_processes .get_for_user (user_id ) if p .public ]
765- processes = [udp .to_api_dict (full = full , user = User (user_id = user_id )) for udp in user_udps ]
766+ udp_listing = backend_implementation .user_defined_processes .list_for_user (user_id , public_only = True )
767+ response = udp_listing .to_response_dict (
768+ full = full , target_version = target_version , user = User (user_id = user_id )
769+ )
766770 elif ":" not in namespace :
767771 process_registry = backend_implementation .processing .get_process_registry (
768772 api_version = requested_api_version ()
@@ -777,7 +781,6 @@ def processes_from_namespace(namespace):
777781 ]
778782 else :
779783 raise OpenEOApiException ("Could not handle namespace {n!r}" .format (n = namespace ))
780- # TODO: pagination links?
781784 return jsonify (
782785 {
783786 "version" : target_version ,
@@ -1766,7 +1769,7 @@ def udp_get(process_graph_id: str, user: User):
17661769 def udp_list_for_user (user : User ):
17671770 pagination = PaginationRequest .from_request (request = flask .request )
17681771 udps = backend_implementation .user_defined_processes .list_for_user (user_id = user .user_id , pagination = pagination )
1769- return jsonify (udps .to_response_dict ())
1772+ return jsonify (udps .to_response_dict (full = False , user = user ))
17701773
17711774 @api_endpoint
17721775 @blueprint .route ('/process_graphs/<process_graph_id>' , methods = ['DELETE' ])
0 commit comments