-
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.
Merge pull request #38 from bento-platform/chore/bento-lib-10-1-0
chore: update bento_lib to 10.1.0 and move service vars to config
- Loading branch information
Showing
5 changed files
with
229 additions
and
210 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import json | ||
|
||
from bento_lib.logging import LogLevelLiteral | ||
from fastapi import Depends | ||
from functools import lru_cache | ||
from pydantic.fields import FieldInfo | ||
|
@@ -27,18 +28,21 @@ class Config(BaseSettings): | |
bento_container_local: bool = False | ||
|
||
service_id: str = str(":".join(list(SERVICE_TYPE.values())[:2])) | ||
service_data_source: Literal["local"] = "local" | ||
service_data: str = "data/" | ||
service_name: str = "Bento Drop Box Service" | ||
service_description: str = "Drop box service for a Bento platform node." | ||
service_contact_url: str = "mailto:[email protected]" | ||
service_url: str = "http://127.0.0.1:5000" # base URL to construct object URIs from | ||
|
||
service_data: str = "data/" | ||
service_data_source: Literal["local"] = "local" | ||
traversal_limit: int = 16 | ||
|
||
bento_authz_service_url: str # Bento authorization service base URL | ||
authz_enabled: bool = True | ||
|
||
cors_origins: tuple[str, ...] | ||
|
||
log_level: Literal["debug", "info", "warning", "error"] = "debug" | ||
log_level: LogLevelLiteral = "debug" | ||
|
||
# Make Config instances hashable + immutable | ||
model_config = SettingsConfigDict(frozen=True) | ||
|
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 |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
from . import __version__ | ||
from .authz import authz_middleware | ||
from .backends.dependency import BackendDependency | ||
from .constants import BENTO_SERVICE_KIND, SERVICE_NAME, SERVICE_TYPE | ||
from .constants import BENTO_SERVICE_KIND, SERVICE_TYPE | ||
from .config import ConfigDependency | ||
from .logger import LoggerDependency | ||
|
||
|
@@ -76,11 +76,11 @@ async def service_info(config: ConfigDependency, logger: LoggerDependency) -> Re | |
# Spec: https://github.com/ga4gh-discovery/ga4gh-service-info | ||
return JSONResponse(await build_service_info({ | ||
"id": config.service_id, | ||
"name": SERVICE_NAME, | ||
"name": config.service_name, | ||
"type": SERVICE_TYPE, | ||
"description": "Drop box service for a Bento platform node.", | ||
"description": config.service_description, | ||
"organization": SERVICE_ORGANIZATION_C3G, | ||
"contactUrl": "mailto:[email protected]", | ||
"contactUrl": config.service_contact_url, | ||
"version": __version__, | ||
"bento": { | ||
"serviceKind": BENTO_SERVICE_KIND | ||
|
Oops, something went wrong.