generated from PrivateAIM/python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(metadata): begin adding EPs for frontend metadata collection
- Loading branch information
Showing
3 changed files
with
49 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""EPs for various metata for the frontend.""" | ||
|
||
from fastapi import APIRouter | ||
|
||
from gateway.conf import gateway_settings | ||
from gateway.models import KeycloakConfig | ||
|
||
metadata_router = APIRouter( | ||
# dependencies=[Security(oauth2_scheme)], | ||
tags=["Metadata"], | ||
responses={404: {"description": "Not found"}}, | ||
) | ||
|
||
|
||
@metadata_router.get("/metadata/keycloakConfig", response_model=KeycloakConfig) | ||
async def get_keycloak_config(): | ||
"""Return keycloak metadata for the frontend.""" | ||
return { | ||
"realm": gateway_settings.IDP_REALM, | ||
"url": gateway_settings.IDP_URL, | ||
"clientId": "node-ui-app", | ||
} | ||
|
||
|
||
@metadata_router.get("/metadata/version") | ||
async def get_node_version(): | ||
"""Return version of the node software/API.""" | ||
return "0.1.0-version" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters