@@ -157,7 +157,7 @@ def _decode_jsonb(value):
157157class SupertokensQuerier (Querier ):
158158 def __init__ (self , recipe_id : str , * , config : KanaeConfig ):
159159 super ().__init__ (
160- self ._get_normalized_host_supertokens (config [ " auth" ][ " connection_uri" ] ),
160+ self ._get_normalized_host_supertokens (config . auth . connection_uri ),
161161 recipe_id ,
162162 )
163163
@@ -463,15 +463,15 @@ def __init__(
463463 supertokens_init (
464464 app_info = InputAppInfo (
465465 app_name = "ucmacm-website" ,
466- api_domain = config [ " auth" ][ " api_domain" ] ,
467- website_domain = config [ " auth" ][ " website_domain" ] ,
466+ api_domain = config . auth . api_domain ,
467+ website_domain = config . auth . website_domain ,
468468 api_base_path = "/auth" ,
469469 website_base_path = "/auth" ,
470470 ),
471471 supertokens_config = SupertokensConfig (
472472 # Force the first one for connection
473- connection_uri = config [ " auth" ][ " connection_uri" ] [0 ],
474- api_key = config [ " auth" ][ " api_key" ] ,
473+ connection_uri = config . auth . connection_uri [0 ],
474+ api_key = config . auth . api_key ,
475475 ),
476476 framework = "fastapi" ,
477477 recipe_list = [
@@ -484,13 +484,13 @@ def __init__(
484484 third_party_id = "google" ,
485485 clients = [
486486 ProviderClientConfig (
487- client_id = config [ " auth" ][ "providers " ][
488- "google "
489- ][ "client_id" ] ,
490- client_secret = config [ " auth" ][ " providers" ] [
487+ client_id = config . auth . providers [ "google " ][
488+ "client_id "
489+ ],
490+ client_secret = config . auth . providers [
491491 "google"
492492 ]["client_secret" ],
493- scope = config [ " auth" ][ " providers" ] ["google" ][
493+ scope = config . auth . providers ["google" ][
494494 "scopes"
495495 ],
496496 ),
@@ -526,7 +526,7 @@ def __init__(
526526 self ._logger = logging .getLogger ("kanae.core" )
527527
528528 self .config = config
529- self .is_prometheus_enabled : bool = config [ " kanae" ][ " prometheus" ] ["enabled" ]
529+ self .is_prometheus_enabled : bool = config . kanae . prometheus ["enabled" ]
530530
531531 _instrumentator_settings = InstrumentatorSettings (metric_namespace = "kanae" )
532532 self .instrumentator = PrometheusInstrumentator (
@@ -561,8 +561,8 @@ def __init__(
561561 )
562562
563563 if self .is_prometheus_enabled :
564- _host = self .config [ " kanae" ] ["host" ]
565- _port = self .config [ " kanae" ] ["port" ]
564+ _host = self .config . kanae . prometheus ["host" ]
565+ _port = self .config . kanae . prometheus ["port" ]
566566
567567 self .instrumentator .start ()
568568
@@ -658,7 +658,7 @@ async def lifespan(self, app: Self):
658658 )
659659
660660 async with asyncpg .create_pool (
661- dsn = self .config [ " postgres_uri" ] , init = init
661+ dsn = self .config . postgres_uri , init = init
662662 ) as app .pool :
663663 yield
664664
0 commit comments