Commit 6b3b632 1 parent 4b2706d commit 6b3b632 Copy full SHA for 6b3b632
File tree 6 files changed +302
-646
lines changed
6 files changed +302
-646
lines changed Original file line number Diff line number Diff line change 21
21
tags = ['ov' ],
22
22
create_schema = OpenVaultCatalog ,
23
23
update_schema = OpenVaultCatalog ,
24
- create_deps = [Depends ( is_user_authenticated ) ],
24
+ create_deps = [is_user_authenticated ],
25
25
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 ],
31
30
)
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ def redirect_to_admin(request):
33
33
Route ("/" , redirect_to_admin ),
34
34
],
35
35
)
36
- logfire .configure (pydantic_plugin = logfire . PydanticPlugin ( record = 'all' ) )
36
+ logfire .configure ()
37
37
logfire .instrument_fastapi (app )
38
38
39
39
Original file line number Diff line number Diff line change 1
1
from os import environ
2
2
3
- from dotenv import load_dotenv
3
+ try :
4
+ from dotenv import load_dotenv
5
+
6
+ load_dotenv ()
7
+ except ImportError :
8
+ pass
4
9
5
- load_dotenv ()
6
10
7
11
ENVIRONMENT = environ .get ('ENVIRONMENT' , 'development' )
8
12
DB_URL = environ .get ('DB_URL' , 'postgresql://postgres:postgres@localhost:5432/organ' )
14
18
SECRET_KEY = environ .get ('SECRET_KEY' , 'secret' )
15
19
AUTH0_DOMAIN = environ .get ('AUTH0_DOMAIN' )
16
20
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' )
Original file line number Diff line number Diff line change 11
11
12
12
from organ .db import engine
13
13
from organ .models import User
14
+ from organ import config
14
15
15
16
github_client = OAuth2Client (
16
17
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 ,
19
20
scope = ['user:email' ],
20
21
claims = Claims (
21
22
picture = 'avatar_url' ,
26
27
27
28
oauth_config = OAuth2Config (
28
29
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 ,
32
33
clients = [
33
34
github_client ,
34
35
],
You can’t perform that action at this time.
0 commit comments