Skip to content

Commit

Permalink
🤖 Update dependencies (#11)
Browse files Browse the repository at this point in the history
* 🤖 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]>
  • Loading branch information
github-actions[bot] and mrharpo authored Oct 3, 2024
1 parent 4b2706d commit 6b3b632
Show file tree
Hide file tree
Showing 6 changed files with 302 additions and 646 deletions.
11 changes: 5 additions & 6 deletions organ/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
tags=['ov'],
create_schema=OpenVaultCatalog,
update_schema=OpenVaultCatalog,
create_deps=[Depends(is_user_authenticated)],
create_deps=[is_user_authenticated],
read_deps=None,
read_multi_deps=[Depends(is_user_authenticated)],
read_paginated_deps=[Depends(is_user_authenticated)],
update_deps=[Depends(is_user_authenticated)],
delete_deps=[Depends(is_user_authenticated)],
db_delete_deps=[Depends(is_user_authenticated)],
read_multi_deps=[is_user_authenticated],
update_deps=[is_user_authenticated],
delete_deps=[is_user_authenticated],
db_delete_deps=[is_user_authenticated],
)
2 changes: 1 addition & 1 deletion organ/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def redirect_to_admin(request):
Route("/", redirect_to_admin),
],
)
logfire.configure(pydantic_plugin=logfire.PydanticPlugin(record='all'))
logfire.configure()
logfire.instrument_fastapi(app)


Expand Down
15 changes: 13 additions & 2 deletions organ/config.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
from os import environ

from dotenv import load_dotenv
try:
from dotenv import load_dotenv

load_dotenv()
except ImportError:
pass

load_dotenv()

ENVIRONMENT = environ.get('ENVIRONMENT', 'development')
DB_URL = environ.get('DB_URL', 'postgresql://postgres:postgres@localhost:5432/organ')
Expand All @@ -14,3 +18,10 @@
SECRET_KEY = environ.get('SECRET_KEY', 'secret')
AUTH0_DOMAIN = environ.get('AUTH0_DOMAIN')
AUTH0_CLIENT_ID = environ.get('AUTH0_CLIENT_ID')

JWT_SECRET = environ.get('JWT_SECRET')
JWT_EXPIRES = int(environ.get('JWT_EXPIRES', 900))
JWT_ALGORITHM = environ.get('JWT_ALGORITHM', 'HS256')

OAUTH2_GITHUB_CLIENT_ID = environ.get('OAUTH2_GITHUB_CLIENT_ID')
OAUTH2_GITHUB_CLIENT_SECRET = environ.get('OAUTH2_GITHUB_CLIENT_SECRET')
11 changes: 6 additions & 5 deletions organ/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@

from organ.db import engine
from organ.models import User
from organ import config

github_client = OAuth2Client(
backend=GithubOAuth2,
client_id=getenv('OAUTH2_GITHUB_CLIENT_ID'),
client_secret=getenv('OAUTH2_GITHUB_CLIENT_SECRET'),
client_id=config.OAUTH2_GITHUB_CLIENT_ID,
client_secret=config.OAUTH2_GITHUB_CLIENT_SECRET,
scope=['user:email'],
claims=Claims(
picture='avatar_url',
Expand All @@ -26,9 +27,9 @@

oauth_config = OAuth2Config(
allow_http=True,
jwt_secret=getenv('JWT_SECRET'),
jwt_expires=getenv('JWT_EXPIRES'),
jwt_algorithm=getenv('JWT_ALGORITHM'),
jwt_secret=config.JWT_SECRET,
jwt_expires=config.JWT_EXPIRES,
jwt_algorithm=config.JWT_ALGORITHM,
clients=[
github_client,
],
Expand Down
Loading

0 comments on commit 6b3b632

Please sign in to comment.