diff options
| author | 2026-07-03 15:49:08 +0200 | |
|---|---|---|
| committer | 2026-07-03 15:49:14 +0200 | |
| commit | 7784c60c03ec277b456db6e2709383e302d9382b (patch) | |
| tree | a008def666f04041fe77740693d42cfef89af558 /ttun_server/__init__.py | |
| parent | fb28c648390464c75ba4903b0e1e0ff2642c8ffb (diff) | |
| download | server-7784c60c03ec277b456db6e2709383e302d9382b.tar.gz server-7784c60c03ec277b456db6e2709383e302d9382b.tar.bz2 server-7784c60c03ec277b456db6e2709383e302d9382b.zip | |
Added basic oauth flow
Diffstat (limited to 'ttun_server/__init__.py')
| -rw-r--r-- | ttun_server/__init__.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ttun_server/__init__.py b/ttun_server/__init__.py index d54227a..4af6ca0 100644 --- a/ttun_server/__init__.py +++ b/ttun_server/__init__.py | |||
| @@ -2,10 +2,11 @@ import logging | |||
| 2 | import os | 2 | import os |
| 3 | 3 | ||
| 4 | from fastapi import FastAPI | 4 | from fastapi import FastAPI |
| 5 | from starlette.routing import Host, Route, WebSocketRoute | 5 | from starlette.routing import Host, Route, WebSocketRoute, Mount |
| 6 | 6 | ||
| 7 | from authentication.endpoints import authentication, oauth | ||
| 7 | from proxy import app as proxy_app | 8 | from proxy import app as proxy_app |
| 8 | from ttun_server.endpoints import health, base_endpoints | 9 | from ttun_server.endpoints import health |
| 9 | from ttun_server.websockets import tunnel | 10 | from ttun_server.websockets import tunnel |
| 10 | 11 | ||
| 11 | logging.basicConfig(level=getattr(logging, os.environ.get('LOG_LEVEL', 'INFO'))) | 12 | logging.basicConfig(level=getattr(logging, os.environ.get('LOG_LEVEL', 'INFO'))) |
| @@ -13,6 +14,8 @@ logging.basicConfig(level=getattr(logging, os.environ.get('LOG_LEVEL', 'INFO'))) | |||
| 13 | app = FastAPI( | 14 | app = FastAPI( |
| 14 | debug=True, | 15 | debug=True, |
| 15 | routes=[ | 16 | routes=[ |
| 17 | Mount('/auth/', app=authentication), | ||
| 18 | Mount('/oauth/', app=oauth), | ||
| 16 | WebSocketRoute('/tunnel/', endpoint=tunnel), | 19 | WebSocketRoute('/tunnel/', endpoint=tunnel), |
| 17 | Route('/health/', endpoint=health), | 20 | Route('/health/', endpoint=health), |
| 18 | Host(f'{{subdomain}}.{os.environ['TUNNEL_DOMAIN']}', app=proxy_app) | 21 | Host(f'{{subdomain}}.{os.environ['TUNNEL_DOMAIN']}', app=proxy_app) |
