Skip to content

Commit a42ca36

Browse files
committed
Typo
Original commit: 62714ec
1 parent 29b19ea commit a42ca36

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

doc/security.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ <h3 id="auth-token-rotation-and-dynamic-password">Auth token rotation and dynami
9696
passwordProviderAsync: (builder, token) =&gt; /* code to fetch the new access token */);
9797
await using var dataSource = dataSourceBuilder.Build();
9898
</code></pre>
99-
<p>Every time a new physical connection needs to be opened to PostgreSQL, either the synchronous <code>passwordProvider</code> or the asynchronous <code>passwordProviderAsync</code> will be called (depending whether you used <code>Open()</code> or <code>OpenAsync()</code>). Since modern .NET applications are encouraged to always use synchronous I/O, it's good practice to simply throw in the synchronous password provider, as above.</p>
99+
<p>Every time a new physical connection needs to be opened to PostgreSQL, either the synchronous <code>passwordProvider</code> or the asynchronous <code>passwordProviderAsync</code> will be called (depending whether you used <code>Open()</code> or <code>OpenAsync()</code>). Since modern .NET applications are encouraged to always use asynchronous I/O, it's good practice to simply throw in the synchronous password provider, as above.</p>
100100
<p>Note that since the password provider is invoked <em>every</em> time a physical connection is opened, it shouldn't take too long; typically, this would call into a cloud provider API (e.g. Azure Managed Identity), which itself implements a caching mechanism. However, if no such caching is done and the code could take a while, you can instead instruct Npgsql to cache the auth token for a given amount of time:</p>
101101
<pre><code class="lang-csharp">dataSourceBuilder.UsePeriodicPasswordProvider(
102102
(settings, cancellationToken) =&gt; /* async code to fetch the new access token */,

0 commit comments

Comments
 (0)