107 writes to
Aspire.Hosting (1)
src\Shared\SecretsStore.cs (1)
57
contents
[
secret.Key] = secret.Value;
Aspire.Hosting.Azure (5)
Provisioning\Provisioners\BicepProvisioner.cs (5)
280
az
[
"Tenant"] = context.Tenant.Data.DefaultDomain;
291
resourceConfig
[
"Id"] = deployment.Id.ToString();
294
resourceConfig
[
"Parameters"] = parameters.ToJsonString();
299
resourceConfig
[
"Outputs"] = outputObj.ToJsonString();
303
resourceConfig
[
"CheckSum"] = GetChecksum(resource, parameters);
ConfigurationSchemaGenerator (24)
ConfigSchemaEmitter.cs (24)
62
catObj
[
"$ref"] = "#/definitions/logLevelThreshold";
66
parent
[
"definitions"] = new JsonObject
117
currentNode
[
"type"] = "object";
123
currentNode
[
"properties"] = propertiesNode;
131
propertiesNode
[
pathSegment] = pathSegmentNode;
212
currentNode
[
"type"] = "object";
218
currentNode
[
"properties"] = propertiesNode;
258
currentNode
[
property.ConfigurationKeyName] = propertyNode;
289
currentNode
[
"type"] = typeName;
291
currentNode
[
containerName] = containerNode;
313
parentNode
[
name] = backupNode;
416
propertyNode
[
"description"] = description;
430
propertyNode
[
"default"] = true;
434
propertyNode
[
"default"] = false;
564
propertyNode
[
"type"] = "string";
565
propertyNode
[
"pattern"] = TimeSpanRegex;
581
propertyNode
[
"enum"] = enumNode;
585
propertyNode
[
"type"] = "string";
586
propertyNode
[
"format"] = "uri";
593
propertyNode
[
"type"] = new JsonArray { "number", "string" };
597
propertyNode
[
"type"] = "string";
598
propertyNode
[
"format"] = "uuid";
603
propertyNode
[
"oneOf"] = new JsonArray
622
propertyNode
[
"type"] = GetParsableTypeName(parsable);
dotnet-user-jwts (2)
Helpers\JwtAuthenticationSchemeSettings.cs (2)
34
schemes
[
SchemeName] = settingsObject;
46
config
[
AuthenticationKey] = new JsonObject
Microsoft.AspNetCore.OpenApi (51)
Extensions\JsonNodeSchemaExtensions.cs (50)
87
schema
[
OpenApiSchemaKeywords.TypeKeyword] = "string";
88
schema
[
OpenApiSchemaKeywords.FormatKeyword] = "byte";
92
schema
[
OpenApiSchemaKeywords.MinimumKeyword] = decimal.Parse(rangeAttribute.Minimum.ToString()!, CultureInfo.InvariantCulture);
93
schema
[
OpenApiSchemaKeywords.MaximumKeyword] = decimal.Parse(rangeAttribute.Maximum.ToString()!, CultureInfo.InvariantCulture);
97
schema
[
OpenApiSchemaKeywords.PatternKeyword] = regularExpressionAttribute.Pattern;
102
schema
[
targetKey] = maxLengthAttribute.Length;
107
schema
[
targetKey] = minLengthAttribute.Length;
112
schema
[
$"min{targetKeySuffix}"] = lengthAttribute.MinimumLength;
113
schema
[
$"max{targetKeySuffix}"] = lengthAttribute.MaximumLength;
117
schema
[
OpenApiSchemaKeywords.TypeKeyword] = "string";
118
schema
[
OpenApiSchemaKeywords.FormatKeyword] = "uri";
122
schema
[
OpenApiSchemaKeywords.MinLengthKeyword] = stringLengthAttribute.MinimumLength;
123
schema
[
OpenApiSchemaKeywords.MaxLengthKeyword] = stringLengthAttribute.MaximumLength;
143
schema
[
OpenApiSchemaKeywords.DefaultKeyword] = null;
147
schema
[
OpenApiSchemaKeywords.DefaultKeyword] = JsonSerializer.SerializeToNode(defaultValue, jsonTypeInfo);
176
schema
[
OpenApiSchemaKeywords.NullableKeyword] = openApiSchema.Nullable || (schema[OpenApiSchemaKeywords.TypeKeyword] is JsonArray schemaType && schemaType.GetValues<string>().Contains("null"));
177
schema
[
OpenApiSchemaKeywords.TypeKeyword] = openApiSchema.Type;
178
schema
[
OpenApiSchemaKeywords.FormatKeyword] = openApiSchema.Format;
179
schema
[
OpenApiConstants.SchemaId] = context.TypeInfo.GetSchemaReferenceId();
180
schema
[
OpenApiSchemaKeywords.NullableKeyword] = underlyingType != null;
183
schema
[
OpenApiSchemaKeywords.PatternKeyword] = null;
200
schema
[
OpenApiSchemaKeywords.MinimumKeyword] = minRouteConstraint.Min;
204
schema
[
OpenApiSchemaKeywords.MaximumKeyword] = maxRouteConstraint.Max;
208
schema
[
OpenApiSchemaKeywords.MinLengthKeyword] = minLengthRouteConstraint.MinLength;
212
schema
[
OpenApiSchemaKeywords.MaxLengthKeyword] = maxLengthRouteConstraint.MaxLength;
216
schema
[
OpenApiSchemaKeywords.MinimumKeyword] = rangeRouteConstraint.Min;
217
schema
[
OpenApiSchemaKeywords.MaximumKeyword] = rangeRouteConstraint.Max;
221
schema
[
OpenApiSchemaKeywords.TypeKeyword] = "string";
222
schema
[
OpenApiSchemaKeywords.FormatKeyword] = null;
223
schema
[
OpenApiSchemaKeywords.PatternKeyword] = regexRouteConstraint.Constraint.ToString();
227
schema
[
OpenApiSchemaKeywords.MinLengthKeyword] = lengthRouteConstraint.MinLength;
228
schema
[
OpenApiSchemaKeywords.MaxLengthKeyword] = lengthRouteConstraint.MaxLength;
232
schema
[
OpenApiSchemaKeywords.TypeKeyword] = "number";
233
schema
[
OpenApiSchemaKeywords.FormatKeyword] = constraint is FloatRouteConstraint ? "float" : "double";
237
schema
[
OpenApiSchemaKeywords.TypeKeyword] = "integer";
238
schema
[
OpenApiSchemaKeywords.FormatKeyword] = constraint is LongRouteConstraint ? "int64" : "int32";
242
schema
[
OpenApiSchemaKeywords.TypeKeyword] = "string";
243
schema
[
OpenApiSchemaKeywords.FormatKeyword] = constraint is GuidRouteConstraint ? "uuid" : null;
247
schema
[
OpenApiSchemaKeywords.TypeKeyword] = "boolean";
248
schema
[
OpenApiSchemaKeywords.FormatKeyword] = null;
252
schema
[
OpenApiSchemaKeywords.TypeKeyword] = "string";
253
schema
[
OpenApiSchemaKeywords.FormatKeyword] = null;
257
schema
[
OpenApiSchemaKeywords.TypeKeyword] = "string";
258
schema
[
OpenApiSchemaKeywords.FormatKeyword] = "date-time";
342
mappings
[
$"{discriminator}"] = $"#/components/schemas/{context.TypeInfo.GetSchemaReferenceId()}{jsonDerivedType.GetSchemaReferenceId()}";
345
schema
[
OpenApiSchemaKeywords.DiscriminatorKeyword] = polymorphismOptions.TypeDiscriminatorPropertyName;
346
schema
[
OpenApiSchemaKeywords.DiscriminatorMappingKeyword] = mappings;
359
schema
[
OpenApiConstants.SchemaId] = schemaReferenceId;
379
schema
[
OpenApiSchemaKeywords.NullableKeyword] = true;
394
schema
[
OpenApiSchemaKeywords.NullableKeyword] = true;
Services\Schemas\OpenApiSchemaService.cs (1)
115
schema
[
OpenApiSchemaKeywords.DescriptionKeyword] = descriptionAttribute.Description;
MSBuild (18)
JsonOutputFormatter.cs (17)
40
propertiesNode
[
property] = getProperty(property);
43
_topLevelNode
[
"Properties"] = propertiesNode;
62
jsonItem
[
"Identity"] = item.GetMetadataValue("Identity");
70
jsonItem
[
metadatumName] = item.GetMetadataValue(metadatumName);
76
itemsNode
[
itemName] = itemArray;
79
_topLevelNode
[
"Items"] = itemsNode;
98
jsonItem
[
"Identity"] = item.GetMetadataValue("Identity");
101
jsonItem
[
metadatum.Name] = metadatum.EvaluatedValue;
111
jsonItem
[
metadatumName] = item.GetMetadataValue(metadatumName);
117
itemsNode
[
itemName] = itemArray;
120
_topLevelNode
[
"Items"] = itemsNode;
137
targetResults
[
"Result"] = targetResult.ResultCode.ToString();
142
jsonItem
[
"Identity"] = item.GetMetadata("Identity");
150
jsonItem
[
metadatumName] = item.GetMetadata(metadatumName);
156
targetResults
[
"Items"] = outputArray;
157
targetResultsNode
[
targetName] = targetResults;
160
_topLevelNode
[
"TargetResults"] = targetResultsNode;
XMake.cs (1)
4615
jsonNode
[
featureName] = Features.CheckFeatureAvailability(featureName).ToString();
System.Text.Json (1)
System\Text\Json\Serialization\Converters\Node\JsonObjectConverter.cs (1)
34
jObject
[
propertyName] = jNodeValue;
TestProject.AppHost (2)
TestProgram.cs (2)
232
root
[
project.Name] = projectJson;
235
projectJson
[
"Endpoints"] = endpointsJsonArray;
WasmAppBuilder (3)
wasi\WasiAppBuilder.cs (1)
137
wasmHostProperties
[
"singleFileBundle"] = true;
WasmAppBuilderBaseTask.cs (2)
129
wasmHostProperties
[
"defaultConfig"] = DefaultHostConfig;
131
wasmHostProperties
[
"mainAssembly"] = MainAssemblyName;
73 references to
Aspire.Hosting.Azure (1)
Provisioning\JsonExtensions.cs (1)
12
var node = obj
[
key];
Aspire.Hosting.Tests (18)
Azure\AzureBicepProvisionerTests.cs (7)
27
Assert.Equal("david", parameters
[
"name"]?["value"]?.ToString());
52
Assert.Equal("john", parameters
[
"name"]?["value"]?.ToString());
53
Assert.Equal(20, parameters
[
"age"]?["value"]?.GetValue<int>());
54
Assert.Equal(["a", "b", "c"], parameters
[
"values"]?["value"]?.AsArray()?.Select(v => v?.ToString()) ?? []);
55
Assert.Equal("connection string", parameters
[
"conn"]?["value"]?.ToString());
56
Assert.Equal("value", parameters
[
"jsonObj"]?["value"]?["key"]?.ToString());
57
Assert.Equal("paramValue", parameters
[
"param"]?["value"]?.ToString());
Azure\AzureBicepResourceTests.cs (8)
757
Assert.Equal("azure.bicep.v0", manifest
[
"type"]?.ToString());
758
Assert.Equal("construct1.module.bicep", manifest
[
"path"]?.ToString());
2389
Assert.Equal("{ai.value}", aiManifest
[
"connectionString"]?.ToString());
2390
Assert.Equal("parameter.v0", aiManifest
[
"type"]?.ToString());
2393
Assert.Equal("{servicebus.value}", serviceBusManifest
[
"connectionString"]?.ToString());
2394
Assert.Equal("parameter.v0", serviceBusManifest
[
"type"]?.ToString());
2397
Assert.Equal("{ai.connectionString}", serviceManifest
[
"env"]?["APPLICATIONINSIGHTS_CONNECTION_STRING"]?.ToString());
2398
Assert.Equal("{servicebus.connectionString}", serviceManifest
[
"env"]?["ConnectionStrings__servicebus"]?.ToString());
Utils\ManifestUtils.cs (2)
35
var resourceNode = obj
[
resource.Name];
57
var resourceNode = obj
[
r.Name];
WithEndpointTests.cs (1)
546
Assert.Equal(expectedEnv, manifest
[
"env"]!.ToString());
ConfigurationSchemaGenerator (10)
ConfigSchemaEmitter.cs (10)
116
var backupTypeNode = currentNode
[
"type"];
120
if (currentNode
[
"properties"] is not JsonObject propertiesNode)
128
if (propertiesNode
[
pathSegment] is not JsonObject pathSegmentNode)
211
var backupTypeNode = currentNode
[
"type"];
215
if (currentNode
[
"properties"] is not JsonObject propertiesNode)
255
var backupPropertyNode = currentNode
[
property.ConfigurationKeyName];
286
var backupTypeNode = currentNode
[
"type"];
287
var backupContainerNode = currentNode
[
containerName];
420
var propertyNodeType = propertyNode
[
"type"];
463
if (currentNode is not null && currentNode
[
"description"] is null)
dotnet-user-jwts (6)
Helpers\JwtAuthenticationSchemeSettings.cs (4)
28
if (config
[
AuthenticationKey] is JsonObject authentication)
30
if (authentication
[
SchemesKey] is JsonObject schemes)
70
if (config
[
AuthenticationKey] is JsonObject authentication &&
71
authentication
[
SchemesKey] is JsonObject schemes)
Helpers\SigningKeysHandler.cs (2)
82
var signingKeys = secrets
[
signkingKeysPropertyName].AsArray();
85
var toRemove = signingKeys.SingleOrDefault(key => key
[
"Issuer"].GetValue<string>() == issuer);
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (26)
UserJwtsTests.cs (26)
76
Assert.Equal("dotnet-user-jwts", appSettings
[
"Authentication"]["Schemes"]["Bearer"]["ValidIssuer"].GetValue<string>());
79
Assert.Equal("new-issuer", appSettings
[
"Authentication"]["Schemes"]["Bearer"]["ValidIssuer"].GetValue<string>());
214
Assert.Equal("baz", fooField
[
"Bar"].GetValue<string>());
431
var signingKey = Assert.Single(secretsJson
[
SigningKeysHandler.GetSigningKeyPropertyName(DevJwtsDefaults.Scheme)].AsArray());
432
Assert.Equal(32, signingKey
[
"Length"].GetValue<int>());
433
Assert.True(Convert.TryFromBase64String(signingKey
[
"Value"].GetValue<string>(), new byte[32], out var _));
435
Assert.Equal("baz", fooField
[
"Bar"].GetValue<string>());
459
var signingKey = Assert.Single(secretsJson
[
SigningKeysHandler.GetSigningKeyPropertyName(DevJwtsDefaults.Scheme)].AsArray());
460
Assert.Equal(32, signingKey
[
"Length"].GetValue<int>());
461
Assert.True(Convert.TryFromBase64String(signingKey
[
"Value"].GetValue<string>(), new byte[32], out var _));
463
Assert.Equal("baz", fooField
[
"Bar"].GetValue<string>());
498
var signingKey = Assert.Single(secretsJson
[
SigningKeysHandler.GetSigningKeyPropertyName("test-scheme")].AsArray());
499
Assert.Equal(32, signingKey
[
"Length"].GetValue<int>());
500
Assert.True(Convert.TryFromBase64String(signingKey
[
"Value"].GetValue<string>(), new byte[32], out var _));
501
Assert.Equal("test-issuer", signingKey
[
"Issuer"].GetValue<string>());
520
var signingKeys = secretsJson
[
SigningKeysHandler.GetSigningKeyPropertyName("test-scheme")].AsArray();
522
Assert.NotNull(signingKeys.SingleOrDefault(signingKey => signingKey
[
"Issuer"].GetValue<string>() == "test-issuer"));
523
Assert.NotNull(signingKeys.SingleOrDefault(signingKey => signingKey
[
"Issuer"].GetValue<string>() == "test-issuer-2"));
541
var signingKey1 = Assert.Single(secretsJson
[
SigningKeysHandler.GetSigningKeyPropertyName("test-scheme")].AsArray());
542
Assert.Equal("test-issuer", signingKey1
[
"Issuer"].GetValue<string>());
543
Assert.Equal(32, signingKey1
[
"Length"].GetValue<int>());
544
Assert.True(Convert.TryFromBase64String(signingKey1
[
"Value"].GetValue<string>(), new byte[32], out var _));
545
var signingKey2 = Assert.Single(secretsJson
[
SigningKeysHandler.GetSigningKeyPropertyName("test-scheme-2")].AsArray());
546
Assert.Equal("test-issuer", signingKey2
[
"Issuer"].GetValue<string>());
547
Assert.Equal(32, signingKey2
[
"Length"].GetValue<int>());
548
Assert.True(Convert.TryFromBase64String(signingKey2
[
"Value"].GetValue<string>(), new byte[32], out var _));
Microsoft.AspNetCore.Http.Extensions.Tests (4)
RequestDelegateFactoryTests.cs (2)
1390
Assert.NotNull(deserializedResponseBody
[
"$type"]);
1391
Assert.Equal(nameof(JsonTodoChild), deserializedResponseBody
[
"$type"]!.GetValue<string>());
RequestDelegateGenerator\RequestDelegateCreationTests.Responses.cs (2)
679
Assert.NotNull(node
[
"$type"]);
680
Assert.Equal(nameof(JsonTodoChild), node
[
"$type"]!.GetValue<string>());
Microsoft.AspNetCore.OpenApi (4)
Extensions\JsonNodeSchemaExtensions.cs (4)
101
var targetKey = schema
[
OpenApiSchemaKeywords.TypeKeyword]?.GetValue<string>() == "array" ? OpenApiSchemaKeywords.MaxItemsKeyword : OpenApiSchemaKeywords.MaxLengthKeyword;
106
var targetKey = schema
[
OpenApiSchemaKeywords.TypeKeyword]?.GetValue<string>() == "array" ? OpenApiSchemaKeywords.MinItemsKeyword : OpenApiSchemaKeywords.MinLengthKeyword;
111
var targetKeySuffix = schema
[
OpenApiSchemaKeywords.TypeKeyword]?.GetValue<string>() == "array" ? "Items" : "Length";
176
schema[OpenApiSchemaKeywords.NullableKeyword] = openApiSchema.Nullable || (schema
[
OpenApiSchemaKeywords.TypeKeyword] is JsonArray schemaType && schemaType.GetValues<string>().Contains("null"));
MSBuild (4)
JsonOutputFormatter.cs (4)
35
ErrorUtilities.VerifyThrow(_topLevelNode
[
"Properties"] is null, "Should not add multiple lists of properties to the json format.");
53
ErrorUtilities.VerifyThrow(_topLevelNode
[
"Items"] is null, "Should not add multiple lists of items to the json format.");
89
ErrorUtilities.VerifyThrow(_topLevelNode
[
"Items"] is null, "Should not add multiple lists of items to the json format.");
130
ErrorUtilities.VerifyThrow(_topLevelNode
[
"TargetResults"] is null, "Should not add multiple lists of target results to the json format.");