Skip to content

Commit

Permalink
Merge pull request #251 from lsst-sqre/tickets/DM-44606
Browse files Browse the repository at this point in the history
DM-44606: Allow SecretStr in DatabaseSessionDependency
  • Loading branch information
rra committed May 31, 2024
2 parents f28dc15 + d8871fc commit f98d329
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion changelog.d/20240520_163147_rra_DM_44444.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
### New features

- Allow the database password to be passed to `create_database_engine` and `create_sync_session` as a Pydantic `SecretStr`.
- Allow the database password to be passed to `create_database_engine`, `create_sync_session`, and `DatabaseSessionDependency.initialize` as a Pydantic `SecretStr`.
3 changes: 2 additions & 1 deletion src/safir/dependencies/db_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from collections.abc import AsyncIterator

from pydantic import SecretStr
from sqlalchemy.ext.asyncio import AsyncEngine, async_scoped_session

from ..database import create_async_session, create_database_engine
Expand Down Expand Up @@ -68,7 +69,7 @@ async def aclose(self) -> None:
async def initialize(
self,
url: str,
password: str | None,
password: str | SecretStr | None,
*,
isolation_level: str | None = None,
) -> None:
Expand Down

0 comments on commit f98d329

Please sign in to comment.