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