Skip to content

Commit

Permalink
Merge pull request #29 from eodcgmbh/ensure-credentials-endpoint-exists
Browse files Browse the repository at this point in the history
update to latest openeo-fastapi and return to using redirects
  • Loading branch information
SerRichard authored Nov 19, 2024
2 parents a5da4bb + 017b4bb commit bcee922
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 89 deletions.
14 changes: 8 additions & 6 deletions openeo_argoworkflows/api/openeo_argoworkflows_api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from starlette.responses import RedirectResponse

from openeo_fastapi.api.app import OpenEOApi
from openeo_fastapi.api.models import WellKnownOpeneoGetResponse
from openeo_fastapi.api.types import Billing, Plan, FileFormat, GisDataType
from openeo_fastapi.client.core import OpenEOCore

Expand Down Expand Up @@ -85,25 +84,28 @@
"OpenEO-Identifier",
],
)


def redirect_wellknown():
return RedirectResponse("/.well-known/openeo", status_code=200)

api.app.router.add_api_route(
name="redirect_wellknown",
path=f"/{client.settings.OPENEO_VERSION}/.well-known/openeo",
response_model=WellKnownOpeneoGetResponse,
response_model=None,
response_model_exclude_unset=False,
response_model_exclude_none=True,
methods=["GET"],
endpoint=client.get_well_known,
endpoint=redirect_wellknown,
)

api.app.router.add_api_route(
name="redirect_wellknown",
path=f"/openeo/{client.settings.OPENEO_VERSION}/.well-known/openeo",
response_model=WellKnownOpeneoGetResponse,
response_model=None,
response_model_exclude_unset=False,
response_model_exclude_none=True,
methods=["GET"],
endpoint=client.get_well_known,
endpoint=redirect_wellknown,
)

app = api.app
Loading

0 comments on commit bcee922

Please sign in to comment.