Skip to content

Commit

Permalink
Test using .get_secret_value()
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
shenanigansd authored Oct 26, 2023
1 parent 952b69e commit 05d2c2e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/loader/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""


from pydantic_settings import BaseSettings, SettingsConfigDict
from pydantic_settings import BaseSettings, SecretStr, SettingsConfigDict


class EnvConfig(BaseSettings):
Expand All @@ -26,10 +26,10 @@ class _Dragonfly(EnvConfig, env_prefix="dragonfly"):

base_url: str = "https://dragonfly.vipyrsec.com"
auth0_domain: str = "vipyrsec.us.auth0.com"
client_id: str
client_secret: str
username: str
password: str
client_id: SecretStr
client_secret: SecretStr
username: SecretStr
password: SecretStr
audience: str = "https://dragonfly.vipyrsec.com"


Expand Down
8 changes: 4 additions & 4 deletions src/loader/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
def get_access_token(*, http_client: Client) -> str:
"""Get an access token from Auth0."""
payload = {
"client_id": Dragonfly.client_id,
"client_secret": Dragonfly.client_secret,
"username": Dragonfly.username,
"password": Dragonfly.password,
"client_id": Dragonfly.client_id.get_secret_value(),
"client_secret": Dragonfly.client_secret.get_secret_value(),
"username": Dragonfly.username.get_secret_value(),
"password": Dragonfly.password.get_secret_value(),
"audience": Dragonfly.audience,
"grant_type": "password",
}
Expand Down

0 comments on commit 05d2c2e

Please sign in to comment.