You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wait for sidecar in DaprSecretStoreConfiguration (#838)
The secret store configuration provider was trying to access Dapr
during the app startup. If the app started faster than Dapr, it would
get an error trying to access the secrets. This commit lets the
provider wait for the sidecar to come up before making any requests.
If the sidecar does not come up at all, we will still fail.
#779
Signed-off-by: Hal Spang <[email protected]>
/// Adds an <see cref="IConfigurationProvider"/> that reads configuration values from the Dapr Secret Store.
58
90
/// </summary>
@@ -80,6 +112,36 @@ public static IConfigurationBuilder AddDaprSecretStore(
80
112
returnconfigurationBuilder;
81
113
}
82
114
115
+
/// <summary>
116
+
/// Adds an <see cref="IConfigurationProvider"/> that reads configuration values from the Dapr Secret Store.
117
+
/// </summary>
118
+
/// <param name="configurationBuilder">The <see cref="IConfigurationBuilder"/> to add to.</param>
119
+
/// <param name="store">Dapr secret store name.</param>
120
+
/// <param name="metadata">A collection of metadata key-value pairs that will be provided to the secret store. The valid metadata keys and values are determined by the type of secret store used.</param>
121
+
/// <param name="client">The Dapr client</param>
122
+
/// <param name="sidecarWaitTimeout">The <see cref="TimeSpan"/> used to configure the timeout waiting for Dapr.</param>
@@ -85,35 +105,57 @@ public DaprSecretStoreConfigurationProvider(string store, bool normalizeKey, ILi
85
105
this.keyDelimiters=keyDelimiters;
86
106
this.secretDescriptors=secretDescriptors;
87
107
this.client=client;
108
+
this.sidecarWaitTimeout=sidecarWaitTimeout;
88
109
}
89
110
90
111
/// <summary>
91
112
/// Creates a new instance of <see cref="DaprSecretStoreConfigurationProvider"/>.
92
113
/// </summary>
93
-
/// <param name="store">Dapr Secre Store name.</param>
114
+
/// <param name="store">Dapr Secret Store name.</param>
94
115
/// <param name="normalizeKey">Indicates whether any key delimiters should be replaced with the delimiter ":".</param>
95
116
/// <param name="metadata">A collection of metadata key-value pairs that will be provided to the secret store. The valid metadata keys and values are determined by the type of secret store used.</param>
96
117
/// <param name="client">Dapr client used to retrieve Secrets</param>
/// Creates a new instance of <see cref="DaprSecretStoreConfigurationProvider"/>.
128
+
/// </summary>
129
+
/// <param name="store">Dapr Secret Store name.</param>
130
+
/// <param name="normalizeKey">Indicates whether any key delimiters should be replaced with the delimiter ":".</param>
131
+
/// <param name="keyDelimiters">A collection of delimiters that will be replaced by ':' in the key of every secret.</param>
132
+
/// <param name="metadata">A collection of metadata key-value pairs that will be provided to the secret store. The valid metadata keys and values are determined by the type of secret store used.</param>
133
+
/// <param name="client">Dapr client used to retrieve Secrets</param>
/// Creates a new instance of <see cref="DaprSecretStoreConfigurationProvider"/>.
110
145
/// </summary>
111
-
/// <param name="store">Dapr Secre Store name.</param>
146
+
/// <param name="store">Dapr Secret Store name.</param>
112
147
/// <param name="normalizeKey">Indicates whether any key delimiters should be replaced with the delimiter ":".</param>
113
148
/// <param name="keyDelimiters">A collection of delimiters that will be replaced by ':' in the key of every secret.</param>
114
149
/// <param name="metadata">A collection of metadata key-value pairs that will be provided to the secret store. The valid metadata keys and values are determined by the type of secret store used.</param>
115
150
/// <param name="client">Dapr client used to retrieve Secrets</param>
0 commit comments