private async Task SendBulkResponseWithSecrets(Dictionary <string, string> secrets, TestHttpClient.Entry entry)
        {
            var getBulkSecretResponse = new Autogenerated.GetBulkSecretResponse();

            foreach (var secret in secrets)
            {
                var secretsResponse = new Autogenerated.SecretResponse();
                secretsResponse.Secrets[secret.Key] = secret.Value;
                getBulkSecretResponse.Data.Add(secret.Key, secretsResponse);
            }

            var streamContent = await GrpcUtils.CreateResponseContent(getBulkSecretResponse);

            var response = GrpcUtils.CreateResponse(HttpStatusCode.OK, streamContent);

            entry.Completion.SetResult(response);
        }
Ejemplo n.º 2
0
        private async Task SendBulkResponseWithSecrets(Dictionary <string, string> secrets, TestHttpClient.Entry entry)
        {
            var getBulkSecretResponse = new Autogenerated.GetBulkSecretResponse();

            foreach (var secret in secrets)
            {
                var secretsResponse = new Autogenerated.SecretResponse();
                secretsResponse.Secrets[secret.Key] = secret.Value;
                // Bulk secret response is `MapField<string, MapField<string, string>>`. The outer key (string) must be ignored by `DaprSecretStoreConfigurationProvider`.
                getBulkSecretResponse.Data.Add("IgnoredKey" + secret.Key, secretsResponse);
            }

            var streamContent = await GrpcUtils.CreateResponseContent(getBulkSecretResponse);

            var response = GrpcUtils.CreateResponse(HttpStatusCode.OK, streamContent);

            entry.Completion.SetResult(response);
        }