2 writes to PasswordParameter
Aspire.Hosting.MongoDB (2)
MongoDBServerResource.cs (1)
32PasswordParameter = passwordParameter;
ReplicaSet\MongoDBReplicaSetBuilderExtensions.cs (1)
484member.Resource.PasswordParameter = builder.Resource.SharedPasswordParameter;
19 references to PasswordParameter
Aspire.Hosting.MongoDB (14)
MongoDBBuilderExtensions.cs (3)
96context.EnvironmentVariables[PasswordEnvVarName] = mongoServerResource.PasswordParameter!; 591if (resource.PasswordParameter is not null) 594context.EnvironmentVariables["ME_CONFIG_MONGODB_ADMINPASSWORD"] = resource.PasswordParameter;
MongoDBServerResource.cs (10)
67/// Gets a value indicating whether <see cref="PasswordParameter"/> was generated for this resource rather than supplied 131if (PasswordParameter is not null) 135builder.Append($"{UserNameParameter:uri}:{PasswordParameter:uri}@"); 139builder.Append($"{DefaultUserName:uri}:{PasswordParameter:uri}@"); 145if (databaseName is not null || PasswordParameter is not null) 155if (PasswordParameter is not null) 165builder.AppendLiteral(PasswordParameter is not null ? "&" : "?"); 175enabledValue: PasswordParameter is not null || ReplicaSetName is not null 201if (PasswordParameter is not null) 203yield return new("Password", ReferenceExpression.Create($"{PasswordParameter}"));
ReplicaSet\MongoDBReplicaSetBuilderExtensions.cs (1)
451if (!member.Resource.PasswordParameterWasGenerated && member.Resource.PasswordParameter != builder.Resource.SharedPasswordParameter)
Aspire.Hosting.MongoDB.Tests (5)
AddMongoDBTests.cs (2)
112Assert.Equal($"mongodb://admin:{dbResource.Parent.PasswordParameter?.Value}@localhost:27017/?authSource=admin&authMechanism=SCRAM-SHA-256", await serverResource.GetConnectionStringAsync()); 116Assert.Equal($"mongodb://admin:{dbResource.Parent.PasswordParameter?.Value}@localhost:27017/mydatabase?authSource=admin&authMechanism=SCRAM-SHA-256", connectionString);
MongoDbFunctionalTests.cs (1)
212var password = mongodb1.Resource.PasswordParameter!.Value;
ReplicaSet\AddMongoDBReplicaSetTests.cs (2)
396Assert.Same(password.Resource, mongo1.Resource.PasswordParameter); 407Assert.Same(rs.Resource.SharedPasswordParameter, mongo1.Resource.PasswordParameter);