-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #206 from Chia-Network/wwills2/organizations-proxy
add CADT organizations proxy
- Loading branch information
Showing
3 changed files
with
33 additions
and
4 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
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,20 @@ | ||
from typing import Any | ||
|
||
from fastapi import APIRouter | ||
from fastapi.params import Depends | ||
|
||
from app import crud | ||
from app.config import ExecutionMode, settings | ||
from app.utils import disallow | ||
|
||
router = APIRouter() | ||
|
||
# pass through resource to expose organization data from cadt | ||
@router.get("/", response_model=Any) | ||
@disallow([ExecutionMode.REGISTRY, ExecutionMode.CLIENT]) | ||
async def get_organizations() -> Any: | ||
all_organizations = crud.ClimateWareHouseCrud( | ||
url=settings.CADT_API_SERVER_HOST, | ||
api_key=settings.CADT_API_KEY, | ||
).get_climate_organizations() | ||
return all_organizations |