File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed
Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ class Settings(BaseSettings):
1010 VULN_DB_URI : str = ""
1111 VULN_DB_USER : str = ""
1212 VULN_DB_PASSWORD : str = ""
13- ALLOWED_ORIGINS : list [str ] = []
13+ DOCS_URL : str | None = None
14+ SERVICES_ALLOWED_ORIGINS : list [str ] = []
1415 ALGORITHM : str = ""
1516 JWT_ACCESS_SECRET_KEY : str = ""
1617 GITHUB_GRAPHQL_API_KEY : str = ""
Original file line number Diff line number Diff line change 1515from app .limiter import limiter
1616from app .middleware import log_request_middleware
1717from app .router import api_router
18+ from app .config import settings
1819
1920DESCRIPTION = """
2021Depex is a tool that allows you to reason over the entire configuration space of the Software Supply Chain of an open-source software repository.
@@ -27,6 +28,7 @@ async def lifespan(app: FastAPI):
2728
2829app = FastAPI (
2930 title = "Secure Chain Depex Tool" ,
31+ docs_url = settings .DOCS_URL ,
3032 version = "1.0.0" ,
3133 description = DESCRIPTION ,
3234 contact = {
@@ -45,7 +47,7 @@ async def lifespan(app: FastAPI):
4547app .middleware ("http" )(log_request_middleware )
4648app .add_middleware (
4749 CORSMiddleware ,
48- allow_origins = settings .ALLOWED_ORIGINS ,
50+ allow_origins = settings .SERVICES_ALLOWED_ORIGINS ,
4951 allow_credentials = True ,
5052 allow_methods = ["*" ],
5153 allow_headers = ["*" ],
Original file line number Diff line number Diff line change 11# For dockerized backend and database
22GRAPH_DB_URI = ' bolt://neo4j:7687'
33VULN_DB_URI = ' mongodb://mongoSecureChain:mongoSecureChain@mongodb:27017/admin'
4- ALLOWED_ORIGINS = ' ["http://localhost:8000"] '
4+ DOCS_URL = ' /docs ' # Comment this on production
55
66# Databases settings
77GRAPH_DB_USER = ' neo4j'
@@ -10,11 +10,12 @@ VULN_DB_USER='mongoSecureChain'
1010VULN_DB_PASSWORD = ' mongoSecureChain'
1111
1212# Secrets for JWT
13- ALGORITHM = ' your_preferred_algorithm' # e.g., 'HS256'
14- ACCESS_TOKEN_EXPIRE_MINUTES = ' access_token_expire_minutes'
15- REFRESH_TOKEN_EXPIRE_DAYS = ' refresh_token_expire_days'
16- JWT_ACCESS_SECRET_KEY = ' your_access_secret_key' # Need to be equal to the one in other services
17- JWT_REFRESH_SECRET_KEY = ' your_refresh_secret_key'
13+ SECURE_COOKIES = False # Set to True in production
14+ ALGORITHM = ' your_preferred_algorithm' # e.g., 'HS256'
15+ ACCESS_TOKEN_EXPIRE_MINUTES = ' access_token_expire_minutes'
16+ REFRESH_TOKEN_EXPIRE_DAYS = ' refresh_token_expire_days'
17+ JWT_ACCESS_SECRET_KEY = ' your_access_secret_key'
18+ JWT_REFRESH_SECRET_KEY = ' your_refresh_secret_key'
1819
1920# Api key for github services
2021GITHUB_GRAPHQL_API_KEY = ' add_your_api_key'
You can’t perform that action at this time.
0 commit comments