Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

Commit

Permalink
turn off auth
Browse files Browse the repository at this point in the history
  • Loading branch information
faysal-ishtiaq committed Feb 28, 2022
1 parent 569d4ef commit 2dd2074
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/opencdms_api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine
from starlette.middleware.wsgi import WSGIMiddleware
from typing import List
from opencdms.models.climsoft.v4_1_1_core import Station
from climsoft_api.main import get_app as get_climsoft_app
from tempestas_api.wsgi import application as surface_application
from mch_api.api_mch import app as mch_api_application
from fastapi import FastAPI, Depends, Request
from fastapi import FastAPI, Request
from sqlalchemy.orm.session import Session
from passlib.hash import django_pbkdf2_sha256 as handler
from src.opencdms_api.middleware import AuthMiddleWare, ClimsoftRBACMiddleware
from src.opencdms_api.schema import StationSchema
from src.opencdms_api.deps import get_session
from src.opencdms_api.db import SessionLocal
from src.opencdms_api import models
from src.opencdms_api.router import router
Expand Down Expand Up @@ -41,13 +37,21 @@ def get_app():
]
)
climsoft_app = get_climsoft_app()
# if settings.SURFACE_API_ENABLED is True:
# app.mount("/surface", AuthMiddleWare(WSGIMiddleware(surface_application)))
# if settings.MCH_API_ENABLED is True:
# app.mount("/mch", AuthMiddleWare(WSGIMiddleware(mch_api_application)))
# if settings.CLIMSOFT_API_ENABLED is True:
# app.mount("/climsoft", ClimsoftRBACMiddleware(climsoft_app))
# app.mount("/pygeoapi", AuthMiddleWare(WSGIMiddleware(pygeoapi_app)))
#
if settings.SURFACE_API_ENABLED is True:
app.mount("/surface", AuthMiddleWare(WSGIMiddleware(surface_application)))
app.mount("/surface", WSGIMiddleware(surface_application))
if settings.MCH_API_ENABLED is True:
app.mount("/mch", AuthMiddleWare(WSGIMiddleware(mch_api_application)))
app.mount("/mch", WSGIMiddleware(mch_api_application))
if settings.CLIMSOFT_API_ENABLED is True:
app.mount("/climsoft", ClimsoftRBACMiddleware(climsoft_app))
app.mount("/pygeoapi", AuthMiddleWare(WSGIMiddleware(pygeoapi_app)))
app.mount("/climsoft", climsoft_app)
app.mount("/pygeoapi", WSGIMiddleware(pygeoapi_app))

app.include_router(router)

Expand Down

0 comments on commit 2dd2074

Please sign in to comment.