Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Path in docs #208

Merged
merged 2 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions backend/app/api/api_v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,20 @@


class OrcidOpenId(OpenID):
"""Custom OrcID OpenID client that fetches the user's email from the OrcID API.

"""
Custom OrcID OpenID client that fetches the user's email from the OrcID API.
Note that users must have given access to their email address for "trusted parties".

:param client_id: client ID
:type client_id: str
:param client_secret: client secret
:type client_secret: str
:param openid_configuration_endpoint: OpenID configuration endpoint
:type openid_configuration_endpoint: str
:param name: name of the provider
:type name: str
:param base_scopes: base scopes
:type base_scopes: list, optional
"""

def __init__(
Expand Down
14 changes: 12 additions & 2 deletions backend/app/api/internal/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
@api_router.get("/version")
@api_router.post("/version")
async def version():
"""Return REEV software version"""
"""
Return reev version.

:return: reev version
:rtype: str
"""
if settings.REEV_VERSION:
version = settings.REEV_VERSION
else:
Expand All @@ -26,7 +31,12 @@ async def version():
@api_router.get("/frontend-settings")
@api_router.post("/frontend-settings")
async def matomo():
"""Return Frontend settings"""
"""
Return frontend settings.

:return: frontend settings
:rtype: dict
"""
frontend_settings = {
"matomo_host": settings.MATOMO_HOST,
"matomo_site_id": settings.MATOMO_SITE_ID,
Expand Down
15 changes: 14 additions & 1 deletion backend/app/api/internal/endpoints/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,20 @@
@router.get("/{path:path}")
@router.post("/{path:path}")
async def reverse_proxy(request: Request) -> Response:
"""Implement reverse proxy for internal backend services."""
"""
Reverse proxy to internal services.
Supported services:
- AnnoNARS
- MeHARI
- Viguno
- NGINX
- Dotty

:param request: request
:type request: :class:`fastapi.Request`
:return: response
:rtype: :class:`fastapi.Response`
"""
url = request.url
backend_url = None

Expand Down
32 changes: 29 additions & 3 deletions backend/app/api/internal/endpoints/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,17 @@ def get_legacy_session():

@router.get("/variantvalidator/{path:path}")
async def variantvalidator(request: Request, path: str):
"""Implement reverse proxy for variantvalidator.org."""
"""
Implement VariantValidator API. Proxy requests to the
`VariantValidator <https://rest.variantvalidator.org/>`_ backend.

:param request: request
:type request: :class:`fastapi.Request`
:param path: path to append to the backend URL
:type path: str
:return: response
:rtype: :class:`fastapi.responses.StreamingResponse`
"""
url = request.url

# change grch to GRCh and strip "chr" prefixes
Expand All @@ -97,7 +107,15 @@ async def variantvalidator(request: Request, path: str):

@router.get("/acmg/{path:path}")
async def acmg(request: Request):
"""Implement searching for ACMG classification."""
"""
Implement searching for ACMG classification for SNVs and indels.
Proxy requests to the `WinterVar <http://wintervar.wglab.org/>`_ backend.

:param request: request
:type request: :class:`fastapi.Request`
:return: ACMG classification
:rtype: dict
"""
query_params = request.query_params
chromosome = query_params.get("chromosome")
position = query_params.get("position")
Expand Down Expand Up @@ -128,7 +146,15 @@ async def acmg(request: Request):

@router.get("/cnv/acmg/{path:path}")
async def cnv_acmg(request: Request):
"""Implement searching for ACMG classification for CNVs."""
"""
Implement searching for ACMG classification for CNVs.
Proxy requests to the `WinterVar <http://wintervar.wglab.org/>`_ backend.

:param request: request
:type request: :class:`fastapi.Request`
:return: ACMG classification
:rtype: dict
"""
query_params = request.query_params
chromosome = query_params.get("chromosome")
start = query_params.get("start")
Expand Down
10 changes: 5 additions & 5 deletions docs/api_api_v1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ app.api.api_v1
app.api.api_v1.endpoints.adminmsgs
----------------------------------

.. automodule:: backend.app.api.api_v1.endpoints.adminmsgs
.. automodule:: app.api.api_v1.endpoints.adminmsgs
:members:
:undoc-members:
:show-inheritance:
Expand All @@ -20,7 +20,7 @@ app.api.api_v1.endpoints.adminmsgs
app.api.api_v1.endpoints.auth
-----------------------------

.. automodule:: backend.app.api.api_v1.endpoints.auth
.. automodule:: app.api.api_v1.endpoints.auth
:members:
:undoc-members:
:show-inheritance:
Expand All @@ -30,7 +30,7 @@ app.api.api_v1.endpoints.auth
app.api.api_v1.endpoints.bookmarks
----------------------------------

.. automodule:: backend.app.api.api_v1.endpoints.bookmarks
.. automodule:: app.api.api_v1.endpoints.bookmarks
:members:
:undoc-members:
:show-inheritance:
Expand All @@ -40,7 +40,7 @@ app.api.api_v1.endpoints.bookmarks
app.api.api_v1.endpoints.caseinfo
---------------------------------

.. automodule:: backend.app.api.api_v1.endpoints.caseinfo
.. automodule:: app.api.api_v1.endpoints.caseinfo
:members:
:undoc-members:
:show-inheritance:
Expand All @@ -50,7 +50,7 @@ app.api.api_v1.endpoints.caseinfo
app.api.api_v1.endpoints.utils
------------------------------

.. automodule:: backend.app.api.api_v1.endpoints.utils
.. automodule:: app.api.api_v1.endpoints.utils
:members:
:undoc-members:
:show-inheritance:
Expand Down
2 changes: 1 addition & 1 deletion docs/api_internal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ app.api.internal
app.api.internal.endpoints.remote
---------------------------------

.. automodule:: backend.app.api.internal.endpoints.remote
.. automodule:: app.api.internal.endpoints.remote
:members:
:undoc-members:
:show-inheritance:
Expand Down
8 changes: 4 additions & 4 deletions docs/api_models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ app.models
app.models.adminmsg
-------------------

.. automodule:: backend.app.models.adminmsg
.. automodule:: app.models.adminmsg
:members:

-------------------
app.models.bookmark
-------------------

.. automodule:: backend.app.models.bookmark
.. automodule:: app.models.bookmark
:members:

---------------
app.models.user
---------------

.. automodule:: backend.app.models.user
.. automodule:: app.models.user
:members:

-------------------
app.models.caseinfo
-------------------

.. automodule:: backend.app.models.caseinfo
.. automodule:: app.models.caseinfo
:members:
Loading