Skip to content

Commit

Permalink
Merge pull request #15 from enerBit/v0.1.17
Browse files Browse the repository at this point in the history
fix auth bug from using pydantic.SecretStr
  • Loading branch information
elpablete authored Nov 13, 2024
2 parents c4f2e27 + efa4c58 commit f2caa01
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 f2caa01

Please sign in to comment.