11# ruff: noqa: E501 FA100
22import warnings
3- from typing import Dict , Optional , Sequence
3+ from typing import Sequence
44
55from pydantic import BaseModel , Field , field_validator
66
@@ -17,14 +17,14 @@ class OAuth2Config(BaseModel):
1717 """
1818
1919 # The client ID for the OAuth2 application
20- clientId : Optional [ str ] = Field (alias = "client_id" , default = None )
20+ clientId : str | None = Field (alias = "client_id" , default = None )
2121
2222 # The client secret for the OAuth2 application. This is sensitive information and requires the explicit presence
2323 # of the POWERTOOLS_DEV environment variable.
24- clientSecret : Optional [ str ] = Field (alias = "client_secret" , default = None )
24+ clientSecret : str | None = Field (alias = "client_secret" , default = None )
2525
2626 # The realm in which the OAuth2 application is registered. Optional.
27- realm : Optional [ str ] = Field (default = None )
27+ realm : str | None = Field (default = None )
2828
2929 # The name of the OAuth2 application
3030 appName : str = Field (alias = "app_name" )
@@ -33,7 +33,7 @@ class OAuth2Config(BaseModel):
3333 scopes : Sequence [str ] = Field (default = [])
3434
3535 # Additional query string parameters to be included in the OAuth2 request. Defaults to an empty dictionary.
36- additionalQueryStringParams : Dict [str , str ] = Field (alias = "additional_query_string_params" , default = {})
36+ additionalQueryStringParams : dict [str , str ] = Field (alias = "additional_query_string_params" , default = {})
3737
3838 # Whether to use basic authentication with the access code grant type. Defaults to False.
3939 useBasicAuthenticationWithAccessCodeGrant : bool = Field (
@@ -47,7 +47,7 @@ class OAuth2Config(BaseModel):
4747 model_config = MODEL_CONFIG_ALLOW
4848
4949 @field_validator ("clientSecret" )
50- def client_secret_only_on_dev (cls , v : Optional [ str ] ) -> Optional [ str ] :
50+ def client_secret_only_on_dev (cls , v : str | None ) -> str | None :
5151 if not v :
5252 return None
5353
0 commit comments