Skip to content

Commit 6b3b632

Browse files
🤖 Update dependencies (#11)
* 🤖 Update dependencies * Engage Actions * Skip dotenv if not installed * Removes depricated parameter * Moves values to config * Try: see if uvicorn 0.31 is breaking proxy headers --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Harpo Harbert <[email protected]>
1 parent 4b2706d commit 6b3b632

File tree

6 files changed

+302
-646
lines changed

6 files changed

+302
-646
lines changed

organ/api.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@
2121
tags=['ov'],
2222
create_schema=OpenVaultCatalog,
2323
update_schema=OpenVaultCatalog,
24-
create_deps=[Depends(is_user_authenticated)],
24+
create_deps=[is_user_authenticated],
2525
read_deps=None,
26-
read_multi_deps=[Depends(is_user_authenticated)],
27-
read_paginated_deps=[Depends(is_user_authenticated)],
28-
update_deps=[Depends(is_user_authenticated)],
29-
delete_deps=[Depends(is_user_authenticated)],
30-
db_delete_deps=[Depends(is_user_authenticated)],
26+
read_multi_deps=[is_user_authenticated],
27+
update_deps=[is_user_authenticated],
28+
delete_deps=[is_user_authenticated],
29+
db_delete_deps=[is_user_authenticated],
3130
)

organ/app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def redirect_to_admin(request):
3333
Route("/", redirect_to_admin),
3434
],
3535
)
36-
logfire.configure(pydantic_plugin=logfire.PydanticPlugin(record='all'))
36+
logfire.configure()
3737
logfire.instrument_fastapi(app)
3838

3939

organ/config.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
from os import environ
22

3-
from dotenv import load_dotenv
3+
try:
4+
from dotenv import load_dotenv
5+
6+
load_dotenv()
7+
except ImportError:
8+
pass
49

5-
load_dotenv()
610

711
ENVIRONMENT = environ.get('ENVIRONMENT', 'development')
812
DB_URL = environ.get('DB_URL', 'postgresql://postgres:postgres@localhost:5432/organ')
@@ -14,3 +18,10 @@
1418
SECRET_KEY = environ.get('SECRET_KEY', 'secret')
1519
AUTH0_DOMAIN = environ.get('AUTH0_DOMAIN')
1620
AUTH0_CLIENT_ID = environ.get('AUTH0_CLIENT_ID')
21+
22+
JWT_SECRET = environ.get('JWT_SECRET')
23+
JWT_EXPIRES = int(environ.get('JWT_EXPIRES', 900))
24+
JWT_ALGORITHM = environ.get('JWT_ALGORITHM', 'HS256')
25+
26+
OAUTH2_GITHUB_CLIENT_ID = environ.get('OAUTH2_GITHUB_CLIENT_ID')
27+
OAUTH2_GITHUB_CLIENT_SECRET = environ.get('OAUTH2_GITHUB_CLIENT_SECRET')

organ/oauth.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111

1212
from organ.db import engine
1313
from organ.models import User
14+
from organ import config
1415

1516
github_client = OAuth2Client(
1617
backend=GithubOAuth2,
17-
client_id=getenv('OAUTH2_GITHUB_CLIENT_ID'),
18-
client_secret=getenv('OAUTH2_GITHUB_CLIENT_SECRET'),
18+
client_id=config.OAUTH2_GITHUB_CLIENT_ID,
19+
client_secret=config.OAUTH2_GITHUB_CLIENT_SECRET,
1920
scope=['user:email'],
2021
claims=Claims(
2122
picture='avatar_url',
@@ -26,9 +27,9 @@
2627

2728
oauth_config = OAuth2Config(
2829
allow_http=True,
29-
jwt_secret=getenv('JWT_SECRET'),
30-
jwt_expires=getenv('JWT_EXPIRES'),
31-
jwt_algorithm=getenv('JWT_ALGORITHM'),
30+
jwt_secret=config.JWT_SECRET,
31+
jwt_expires=config.JWT_EXPIRES,
32+
jwt_algorithm=config.JWT_ALGORITHM,
3233
clients=[
3334
github_client,
3435
],

0 commit comments

Comments
 (0)