Skip to content

Commit 6485191

Browse files
committed
Added basic FastAPI.
1 parent 60c0165 commit 6485191

File tree

6 files changed

+70
-0
lines changed

6 files changed

+70
-0
lines changed

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM python:3.13-slim
2+
3+
EXPOSE 8000
4+
5+
WORKDIR /app
6+
7+
RUN apt-get update && apt-get install -y gcc libpq-dev
8+
9+
COPY . .
10+
11+
RUN pip install --no-cache-dir -r requirements.txt
12+
13+
ENV PYTHONUNBUFFERED=1
14+
15+
CMD ["uvicorn", "src.stac_auth_proxy.main:app", "--host", "0.0.0.0", "--port", "8000"]

pyproject.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[project]
2+
name = "stac-auth-proxy"
3+
version = "0.1.0"
4+
description = "STAC authentication proxy with FastAPI"
5+
readme = "README.md"
6+
requires-python = ">=3.8"
7+
license = {file = "LICENSE"}
8+
authors = [{name = "Your Name", email = "[email protected]"}]
9+
keywords = ["STAC", "FastAPI", "Authentication", "Proxy"]
10+
classifiers = [
11+
"Programming Language :: Python :: 3",
12+
"Programming Language :: Python :: 3.8",
13+
"License :: OSI Approved :: MIT License",
14+
]
15+
16+
[tool.coverage.run]
17+
branch = true
18+
19+
[tool.isort]
20+
profile = "black"
21+
known_first_party = ["stac_auth_proxy"]
22+
23+
[tool.ruff]
24+
select = ["D", "E", "F"]
25+
ignore = ["E501"]
26+
27+
[build-system]
28+
requires = ["hatchling>=1.12.0"]
29+
build-backend = "hatchling.build"

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pre-commit

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fastapi
2+
httpx
3+
authlib
4+
uvicorn

src/stac_auth_proxy/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"""STAC Auth Proxy package.
2+
3+
This package contains the components for the STAC authentication and proxying system.
4+
It includes FastAPI routes for handling authentication, authorization, and interaction
5+
with some internal STAC API.
6+
"""

src/stac_auth_proxy/main.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""STAC Auth Proxy API.
2+
3+
This module defines the FastAPI application for the STAC Auth Proxy, which handles
4+
authentication, authorization, and proxying of requests to some internal STAC API.
5+
6+
"""
7+
8+
from fastapi import FastAPI
9+
10+
app = FastAPI()
11+
12+
if __name__ == "__main__":
13+
import uvicorn
14+
15+
uvicorn.run(app, host="0.0.0.0", port=8000)

0 commit comments

Comments
 (0)