diff --git a/openbb_platform/platform/core/README.md b/openbb_platform/platform/core/README.md index c59b71275ad..473e75121ec 100644 --- a/openbb_platform/platform/core/README.md +++ b/openbb_platform/platform/core/README.md @@ -355,7 +355,7 @@ To apply an environment variable use one of the following: The variables we use are: -- `OPENBB_API_AUTH`: enables API authentication for command endpoints +- `OPENBB_API_AUTH`: enables API endpoint authentication - `OPENBB_API_USERNAME`: sets API username - `OPENBB_API_PASSWORD`: sets API password - `OPENBB_API_AUTH_EXTENSION`: specifies which authentication extension to use @@ -454,13 +454,13 @@ We provide a `.dockerfile`` in OpenBB [repo](https://github.com/OpenBB-finance/O To build the image, you can run the following command from the repo root: ```bash -docker build -f build/docker/api.dockerfile -t openbb-sdk:latest . +docker build -f build/docker/api.dockerfile -t openbb-platform:latest . ``` To run this newly-built image: ```bash -docker run --rm -p 8000:8000 -v ~/.openbb_platform:/root/.openbb_platform openbb-sdk:latest +docker run --rm -p 8000:8000 -v ~/.openbb_platform:/root/.openbb_platform openbb-platform:latest ``` This will mount the local `~/.openbb_platform` directory into the Docker container so you can use the API keys from there and it will expose the API on port `8000`. diff --git a/openbb_platform/platform/core/openbb_core/api/auth/user.py b/openbb_platform/platform/core/openbb_core/api/auth/user.py index 9328024650c..dab13cca5a9 100644 --- a/openbb_platform/platform/core/openbb_core/api/auth/user.py +++ b/openbb_platform/platform/core/openbb_core/api/auth/user.py @@ -8,7 +8,7 @@ from openbb_core.app.service.user_service import UserService from openbb_core.env import Env from typing_extensions import Annotated -security = HTTPBasic() +security = HTTPBasic() if Env().API_AUTH else lambda: None async def authenticate_user( diff --git a/openbb_platform/platform/core/openbb_core/api/rest_api.py b/openbb_platform/platform/core/openbb_core/api/rest_api.py index 5c4a59ab14e..641b91b9a29 100644 --- a/openbb_platform/platform/core/openbb_core/api/rest_api.py +++ b/openbb_platform/platform/core/openbb_core/api/rest_api.py @@ -39,7 +39,7 @@ AppLoader.from_routers( app=app, routers=[AuthService().router, router_system, router_coverage, router_commands] if Env().DEV_MODE - else [router_coverage, router_commands], + else [router_commands], prefix="/api/v1", ) diff --git a/openbb_platform/platform/core/openbb_core/env.py b/openbb_platform/platform/core/openbb_core/env.py index 02c89b3fca8..3ce1ed909ba 100644 --- a/openbb_platform/platform/core/openbb_core/env.py +++ b/openbb_platform/platform/core/openbb_core/env.py @@ -19,7 +19,7 @@ class Env(metaclass=SingletonMeta): @property def API_AUTH(self) -> bool: - """API authentication: enables commands authentication in FastAPI""" + """API authentication: enables API endpoint authentication""" return self.str2bool(self._environ.get("OPENBB_API_AUTH", False)) @property