Skip to content
Snippets Groups Projects
Commit 1682801e authored by Mohamed Anis Koubaa's avatar Mohamed Anis Koubaa :speech_balloon:
Browse files

implement Authentication.

parent cce7378f
No related branches found
No related tags found
No related merge requests found
......@@ -4,4 +4,9 @@
A user plugs in the EDR at a certain location, connects it with its laptop and starts the recording of a campaign. At the same time the user starts the publishing tool REGIMO (from this git repository). All new created files are tracked by the tool and automatically uploaded to the cloud and then published to the databus using its cloud URL.
### Use Case #2 (Secondary use case)
The existing database of the EDR is analyzed and all existing valid data sets (correct filesystem structure and metadata json files exist) get published to the cloud and registered in the databus.
\ No newline at end of file
The existing database of the EDR is analyzed and all existing valid data sets (correct filesystem structure and metadata json files exist) get published to the cloud and registered in the databus.
### use
poetry export --without-hashes --format=requirements.txt > requirements.txt
to export an actual requirements.txt
\ No newline at end of file
[tool.poetry]
name = "backend_regimo"
version = "0.1.0"
description = "This is the backend for Regimo. Regimo is a tool to register data on a databus."
authors = ["Anis Koubaa <mohamed.koubaa@kit.edu>"]
license = "MIT"
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
fastapi = "^0.100.0"
uvicorn = "^0.24.0"
oep-client = "^0.17.0"
openpyxl = "^3.1.5"
omi = "^0.2.0"
pyjwt = "^2.10.1"
[tool.poetry.group.test.dependencies]
pytest = "^8"
[tool.poetry.group.dev.dependencies]
datamodel-code-generator = "^0.26.5"
reuse = "^5.0.2"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
\ No newline at end of file
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi import Depends, FastAPI
from fastapi.security import OAuth2PasswordBearer
from typing import Annotated
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["http://localhost:8080"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
@app.get("/")
def home():
return "Hello, World!"
return "Hello, my secure World!"
@app.get("/manifest")
def get_artifacts():
return "Here are some artifacts"
@app.get("/items/")
async def read_items(token: Annotated[str, Depends(oauth2_scheme)]):
return {"token": token}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment