Skip to content

Commit

Permalink
start cleanning
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-chervet committed Nov 1, 2024
1 parent f251970 commit c5471a2
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 27 deletions.
4 changes: 2 additions & 2 deletions deploy/kubernetes/api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ spec:
value: "production"
resources:
limits:
memory: "240Mi"
memory: "200Mi"
cpu: "200m"
requests:
ephemeral-storage: "100Mi"
memory: "240Mi"
memory: "200Mi"
cpu: "200m"
2 changes: 2 additions & 0 deletions production/api/app/app_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class AppSettings:
url_slimfaas: str
server_host: str
server_port: int
oidc_issuer: Optional[str] = None
oidc_authority: Optional[str] = "true"


class Settings:
Expand Down
10 changes: 10 additions & 0 deletions production/api/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ async def health():

if __name__ == "__main__":
import uvicorn
from oidc.authentication_middleware import authentication_middleware, XHttpServiceGet

app_settings = app_settings_factory_get()
if app_settings.oidc_enable == "true":
exclude_urls = ["/health", "/version", "/metrics", "/docs", "/openapi_json"]
app.add_middleware(authentication_middleware(
app_settings.oidc_authority,
["api"],
"api",
exclude_urls,
XHttpServiceGet(http_service_factory_get().get_http_async_client())
))
uvicorn.run(app, host=app_settings.server_host, port=app_settings.server_port)
File renamed without changes.
4 changes: 3 additions & 1 deletion production/api/app/settings.development.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"redis_port": 6379,
"url_slimfaas": "http://slimfaas:5000",
"server_host": "localhost",
"server_port": 8000
"server_port": 8000,
"oidc_authority": "https://demo.duendesoftware.com",
"oidc_enable" : true
}
4 changes: 3 additions & 1 deletion production/api/app/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"redis_port": 6379,
"url_slimfaas": "http://slimfaas:5000",
"server_host": "0.0.0.0",
"server_port": 8000
"server_port": 8000,
"oidc_authority": "https://demo.duendesoftware.com",
"oidc_enable" : true
}
4 changes: 3 additions & 1 deletion production/api/app/settings.production.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"redis_port": 6379,
"url_slimfaas": "http://slimfaas:5000",
"server_host": "0.0.0.0",
"server_port": 8000
"server_port": 8000,
"oidc_authority": "https://demo.duendesoftware.com",
"oidc_enable" : true
}
3 changes: 0 additions & 3 deletions production/ia-worker/app/app_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ class AppSettings:
url_slimfaas: str
server_host: str
server_port: int
oidc_issuer: Optional[str] = None
oidc_authority: Optional[str] = "true"



class Settings:
Expand Down
10 changes: 0 additions & 10 deletions production/ia-worker/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,6 @@ async def health():

if __name__ == "__main__":
import uvicorn
from oidc.authentication_middleware import authentication_middleware, XHttpServiceGet

app_settings = app_settings_factory_get()
if app_settings.oidc_enable == "true":
exclude_urls = ["/health", "/version", "/metrics", "/docs", "/openapi_json"]
app.add_middleware(authentication_middleware(
app_settings.oidc_authority,
["api"],
"api",
exclude_urls,
XHttpServiceGet(http_service_factory_get().get_http_async_client())
))
uvicorn.run(app, host=app_settings.server_host, port=app_settings.server_port)
4 changes: 1 addition & 3 deletions production/ia-worker/app/settings.development.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
"redis_port": 6379,
"url_slimfaas": "http://slimfaas:5000",
"server_host": "localhost",
"server_port": 8000,
"oidc_authority": "https://demo.duendesoftware.com",
"oidc_enable" : true
"server_port": 8000
}
4 changes: 1 addition & 3 deletions production/ia-worker/app/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
"redis_port": 6379,
"url_slimfaas": "http://slimfaas:5000",
"server_host": "0.0.0.0",
"server_port": 8000,
"oidc_authority": "https://demo.duendesoftware.com",
"oidc_enable" : true
"server_port": 8000
}
4 changes: 1 addition & 3 deletions production/ia-worker/app/settings.production.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
"redis_port": 6379,
"url_slimfaas": "http://slimfaas:5000",
"server_host": "0.0.0.0",
"server_port": 8000,
"oidc_authority": "https://demo.duendesoftware.com",
"oidc_enable" : true
"server_port": 8000
}

0 comments on commit c5471a2

Please sign in to comment.