Mark public methods that don't use trans as public in schema

This commit is contained in:
mvdbeek
2024-01-10 08:06:19 +01:00
parent 5e4bcc04ca
commit 27dd87ee86
12 changed files with 30 additions and 34 deletions
@@ -59,6 +59,7 @@ class FastAPIAuthenticate:
summary="Returns returns an API key for authenticated user based on BaseAuth headers.",
)
def get_api_key(self, request: Request) -> APIKeyResponse:
# TODO: use fastapi.security mechanism
authorization = request.headers.get("Authorization")
auth = {"HTTP_AUTHORIZATION": authorization}
return self.authentication_service.get_api_key(auth, request)
@@ -74,6 +74,7 @@ class FastAPIConfiguration:
@router.get(
"/api/version",
public=True,
summary="Return Galaxy version information: major/minor version, optional extra info",
response_description="Galaxy version information: major/minor version, optional extra info",
)
@@ -60,6 +60,7 @@ class FastAPIDatatypes:
@router.get(
"/api/datatypes",
public=True,
summary="Lists all available data types",
response_description="List of data types",
)
@@ -73,6 +74,7 @@ class FastAPIDatatypes:
@router.get(
"/api/datatypes/mapping",
public=True,
summary="Returns mappings for data types and their implementing classes",
response_description="Dictionary to map data types with their classes",
)
@@ -82,6 +84,7 @@ class FastAPIDatatypes:
@router.get(
"/api/datatypes/types_and_mapping",
public=True,
summary="Returns all the data types extensions and their mappings",
response_description="Dictionary to map data types with their classes",
)
@@ -100,6 +103,7 @@ class FastAPIDatatypes:
@router.get(
"/api/datatypes/sniffers",
public=True,
summary="Returns the list of all installed sniffers",
response_description="List of datatype sniffers",
)
@@ -109,6 +113,7 @@ class FastAPIDatatypes:
@router.get(
"/api/datatypes/converters",
public=True,
summary="Returns the list of all installed converters",
response_description="List of all datatype converters",
)
@@ -118,6 +123,7 @@ class FastAPIDatatypes:
@router.get(
"/api/datatypes/edam_formats",
public=True,
summary="Returns a dictionary/map of datatypes and EDAM formats",
response_description="Dictionary/map of datatypes and EDAM formats",
)
@@ -127,6 +133,7 @@ class FastAPIDatatypes:
@router.get(
"/api/datatypes/edam_formats/detailed",
public=True,
summary="Returns a dictionary of datatypes and EDAM format details",
response_description="Dictionary of EDAM format details containing the EDAM iri, label, and definition",
response_model=DatatypesEDAMDetailsDict,
@@ -138,6 +145,7 @@ class FastAPIDatatypes:
@router.get(
"/api/datatypes/edam_data",
public=True,
summary="Returns a dictionary/map of datatypes and EDAM data",
response_description="Dictionary/map of datatypes and EDAM data",
)
@@ -147,6 +155,7 @@ class FastAPIDatatypes:
@router.get(
"/api/datatypes/edam_data/detailed",
public=True,
summary="Returns a dictionary of datatypes and EDAM data details",
response_description="Dictionary of EDAM data details containing the EDAM iri, label, and definition",
response_model=DatatypesEDAMDetailsDict,
@@ -31,6 +31,7 @@ class FastAPIDisplay:
@router.get(
"/api/display_applications",
public=True,
summary="Returns the list of display applications.",
name="display_applications_index",
)
+6 -5
View File
@@ -42,7 +42,7 @@ class DrsApi:
service: DatasetsService = depends(DatasetsService)
config: GalaxyAppConfiguration = depends(GalaxyAppConfiguration)
@router.get("/ga4gh/drs/v1/service-info")
@router.get("/ga4gh/drs/v1/service-info", public=True)
def service_info(self, request: Request) -> Service:
components = request.url.components
hostname = components.hostname
@@ -75,8 +75,8 @@ class DrsApi:
**extra_kwds,
)
@router.get("/ga4gh/drs/v1/objects/{object_id}")
@router.post("/ga4gh/drs/v1/objects/{object_id}") # spec specifies both get and post should work.
@router.get("/ga4gh/drs/v1/objects/{object_id}", public=True)
@router.post("/ga4gh/drs/v1/objects/{object_id}", public=True) # spec specifies both get and post should work.
def get_object(
self,
request: Request,
@@ -85,8 +85,8 @@ class DrsApi:
) -> DrsObject:
return self.service.get_drs_object(trans, object_id, request_url=request.url)
@router.get("/ga4gh/drs/v1/objects/{object_id}/access/{access_id}")
@router.post("/ga4gh/drs/v1/objects/{object_id}/access/{access_id}")
@router.get("/ga4gh/drs/v1/objects/{object_id}/access/{access_id}", public=True)
@router.post("/ga4gh/drs/v1/objects/{object_id}/access/{access_id}", public=True)
def get_access_url(
self,
request: Request,
@@ -98,6 +98,7 @@ class DrsApi:
@router.get(
"/api/drs_download/{object_id}",
public=True,
response_class=FileResponse,
)
def download(self, trans: ProvidesHistoryContext = DependsOnTrans, object_id: str = ObjectIDParam):
+5 -1
View File
@@ -26,7 +26,10 @@ class FastAPILicenses:
licenses_manager: LicensesManager = depends(LicensesManager)
@router.get(
"/api/licenses", summary="Lists all available SPDX licenses", response_description="List of SPDX licenses"
"/api/licenses",
public=True,
summary="Lists all available SPDX licenses",
response_description="List of SPDX licenses",
)
async def index(self) -> List[LicenseMetadataModel]:
"""Returns an index with all the available [SPDX licenses](https://spdx.org/licenses/)."""
@@ -34,6 +37,7 @@ class FastAPILicenses:
@router.get(
"/api/licenses/{id}",
public=True,
summary="Gets the SPDX license metadata associated with the short identifier",
response_description="SPDX license metadata",
)
@@ -33,6 +33,7 @@ class FastAPIShortTermStorage:
@router.get(
"/api/short_term_storage/{storage_request_id}",
public=True,
summary="Serve the staged download specified by request ID.",
response_description="Raw contents of the file.",
response_class=GalaxyFileResponse,
+1
View File
@@ -24,6 +24,7 @@ class FastAPITasks:
@router.get(
"/api/tasks/{task_id}/state",
public=True,
summary="Determine state of task ID",
response_description="String indicating task state.",
)
+1 -1
View File
@@ -54,7 +54,7 @@ class FastAPIToolData:
"/api/tool_data",
summary="Lists all available data tables",
response_description="A list with details on individual data tables.",
require_admin=False,
public=True,
)
async def index(self) -> ToolDataEntryList:
"""Get the list of all available data tables."""
@@ -413,6 +413,7 @@ class FastAPIToolShedRepositories:
@router.get(
"/api/tool_shed_repositories",
public=True,
summary="Lists installed tool shed repositories.",
response_description="A list of installed tool shed repository objects.",
)
@@ -444,6 +445,7 @@ class FastAPIToolShedRepositories:
@router.get(
"/api/tool_shed_repositories/{id}",
public=True,
summary="Show installed tool shed repository.",
)
def show(
+2 -2
View File
@@ -23,12 +23,12 @@ router = Router(tags=["tours"])
class FastAPITours:
registry: ToursRegistry = depends(ToursRegistry) # type: ignore[type-abstract] # https://github.com/python/mypy/issues/4717
@router.get("/api/tours")
@router.get("/api/tours", public=True)
def index(self) -> TourList:
"""Return list of available tours."""
return self.registry.get_tours()
@router.get("/api/tours/{tour_id}")
@router.get("/api/tours/{tour_id}", public=True)
def show(self, tour_id: str) -> TourDetails:
"""Return a tour definition."""
return self.registry.tour_contents(tour_id)