Skip to content

Commit

Permalink
fix auth bug from using pydantic.SecretStr
Browse files Browse the repository at this point in the history
  • Loading branch information
elpablete committed Nov 13, 2024
1 parent c4f2e27 commit efa4c58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/enerbitdso/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.16
0.1.17
4 changes: 2 additions & 2 deletions src/enerbitdso/enerbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class ScheduleMeasurementRecord(pydantic.BaseModel):
reactive_energy_exported: float


def get_auth_token(base_url, username, password):
def get_auth_token(base_url: str, username: str, password: pydantic.SecretStr) -> str:
path = "/auth/token/"
data = {"username": username, "password": password}
data = {"username": username, "password": password.get_secret_value()}
with httpx.Client(base_url=base_url, timeout=TIMEOUT, verify=SSL_CONTEXT) as client:
response = client.post(path, data=data)
try:
Expand Down

0 comments on commit efa4c58

Please sign in to comment.