Skip to content

Commit

Permalink
fix(app/mymdc): add optional scope for mymdc credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertRosca committed Nov 5, 2024
1 parent 422589c commit 75d6d59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/src/damnit_api/mymdc/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ async def acquire_token(self):
"grant_type": "client_credentials",
"client_id": self.client_id,
"client_secret": self.client_secret.get_secret_value(),
# "scope": "public",
}

if self.scope:
data["scope"] = self.scope

response = await client.post(str(self.token_url), data=data)

data = response.json()
Expand Down
1 change: 1 addition & 0 deletions api/src/damnit_api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class MyMdCCredentials(BaseSettings):
email: str
token_url: HttpUrl
base_url: HttpUrl
scope: str | None = "public"

_access_token: str = ""
_expires_at: datetime = datetime.fromisocalendar(1970, 1, 1).astimezone(UTC)
Expand Down

0 comments on commit 75d6d59

Please sign in to comment.