Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the CA certificate with a os environment #442

Merged
merged 2 commits into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,32 +41,7 @@ func TestAccDataSourceMongoX509AuthDBUser_basic(t *testing.T) {
func TestAccDataSourceMongoX509AuthDBUser_WithCustomerX509(t *testing.T) {
resourceName := "data.mongodbatlas_x509_authentication_database_user.test"
projectID := os.Getenv("MONGODB_ATLAS_PROJECT_ID")
cas := `
-----BEGIN CERTIFICATE-----
MIIEBzCCAu+gAwIBAgIUbwfQS97LZAIc/tPPVRYEWKkDETkwDQYJKoZIhvcNAQEL
BQAwgZIxCzAJBgNVBAYTAkFVMQwwCgYDVQQIDANOU1cxDzANBgNVBAcMBlN5ZG5l
eTEQMA4GA1UECgwHTW9uZ29EQjENMAsGA1UECwwEcm9vdDEbMBkGA1UEAwwScG9w
LW9zLmxvY2FsZG9tYWluMSYwJAYJKoZIhvcNAQkBFhdlZGdhci5sb3BlekBtb25n
b2RiLmNvbTAeFw0yMTAyMjIxODE4NTFaFw0yMTAzMjQxODE4NTFaMIGSMQswCQYD
VQQGEwJBVTEMMAoGA1UECAwDTlNXMQ8wDQYDVQQHDAZTeWRuZXkxEDAOBgNVBAoM
B01vbmdvREIxDTALBgNVBAsMBHJvb3QxGzAZBgNVBAMMEnBvcC1vcy5sb2NhbGRv
bWFpbjEmMCQGCSqGSIb3DQEJARYXZWRnYXIubG9wZXpAbW9uZ29kYi5jb20wggEi
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQClBpr0bTP5AElcNmSLC5ioMYJZ
3LyBCTtcz2YDvrFoaN4UKUvD5pXTkkhSdHRgIpVbvibHQl118haj+gcN9s1GP0lb
6Lz5XPOs6QdjO4fGz9M8WOPFWuAiXmDqqGhobVcSdEFtddtCPE0PAsKmzVBuDd/1
RYGskzLC94f0SL9YYmF6kqXKXTH+D7JHpUWqCms3RCKIc2AYdlU0LD1dqyjabbWN
I2PS4j6xQca9ZfpqlHvUxwAzLuaMAZYHDUQ++uVJi/iHY7Dd2/PA41sUT/ymwmJH
4Zc4Nd73WFtYUBQxHa3sNfhiNFZ4BW6LkBGcPV6+r5AZIe3ZiEP1MuKim91XAgMB
AAGjUzBRMB0GA1UdDgQWBBRTwbI8Tx+JDkNUn7k+JHZ/HHQAnTAfBgNVHSMEGDAW
gBRTwbI8Tx+JDkNUn7k+JHZ/HHQAnTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3
DQEBCwUAA4IBAQAwObUHhCqt9UZAuqvke+HMU9FRiNehEKm+1JygZ2SQSPAnlR2S
+ttihCxjyU5wVgEs8lo/VoPxtc8TfA/rKYn3xhTdqSo9nSOZVS+F8OA2A5ClnTc8
U1l6t5KeQTKOsGFdyc5xzRM2P0nAY6WWB2PpFyPlwCJtPIq2l0my3W2za8m7DCLO
XXJ5LYUZ8kFJKFEnS7F++A7102+tOs/GSeXwg3u9aYhhjwgsHneWzW5YLOtDqIPg
ulnNdinFfGNo57BqKbRlwqdU0HIHLAZPXnftQbKMamxNw2IN169yPJPRNfdPvL/S
5niRVVHHXMoEYp8L9KZ3aJQODnxY05IbTEjP
-----END CERTIFICATE-----
`
cas := os.Getenv("CA_CERT")

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,9 @@ func TestAccResourceMongoDBAtlasX509AuthDBUser_basic(t *testing.T) {
func TestAccResourceMongoDBAtlasX509AuthDBUser_WithCustomerX509(t *testing.T) {
var (
resourceName = "mongodbatlas_x509_authentication_database_user.test"
cas = `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qGSIb3
DQEBCwUAA4IBAQAwObUHhCqt9UZAuqvke+HMU9FRiNehEKm+1JygZ2SQSPAnlR2S
+ttihCxjyU5wVgEs8lo/VoPxtc8TfA/rKYn3xhTdqSo9nSOZVS+F8OA2A5ClnTc8
U1l6t5KeQTKOsGFdyc5xzRM2P0nAY6WWB2PpFyPlwCJtPIq2l0my3W2za8m7DCLO
XXJ5LYUZ8kFJKFEnS7F++A7102+tOs/GSeXwg3u9aYhhjwgsHneWzW5YLOtDqIPg
ulnNdinFfGNo57BqKbRlwqdU0HIHLAZPXnftQbKMamxNw2IN169yPJPRNfdPvL/S
5niRVVHHXMoEYp8L9KZ3aJQODnxY05IbTEjP
-----END CERTIFICATE-----
`
orgID = os.Getenv("MONGODB_ATLAS_ORG_ID")
projectName = acctest.RandomWithPrefix("test-acc")
cas = os.Getenv("CA_CERT")
orgID = os.Getenv("MONGODB_ATLAS_ORG_ID")
projectName = acctest.RandomWithPrefix("test-acc")
)

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -160,33 +135,9 @@ func TestAccResourceMongoDBAtlasX509AuthDBUser_WithDatabaseUser(t *testing.T) {
func TestAccResourceMongoDBAtlasX509AuthDBUser_importWithCustomerX509(t *testing.T) {
var (
resourceName = "mongodbatlas_x509_authentication_database_user.test"
cas = `
-----BEGIN CERTIFICATE-----
MIIEBzCCAu+gAwIBAgIUbwfQS97LZAIc/tPPVRYEWKkDETkwDQYJKoZIhvcNAQEL
BQAwgZIxCzAJBgNVBAYTAkFVMQwwCgYDVQQIDANOU1cxDzANBgNVBAcMBlN5ZG5l
eTEQMA4GA1UECgwHTW9uZ29EQjENMAsGA1UECwwEcm9vdDEbMBkGA1UEAwwScG9w
LW9zLmxvY2FsZG9tYWluMSYwJAYJKoZIhvcNAQkBFhdlZGdhci5sb3BlekBtb25n
b2RiLmNvbTAeFw0yMTAyMjIxODE4NTFaFw0yMTAzMjQxODE4NTFaMIGSMQswCQYD
VQQGEwJBVTEMMAoGA1UECA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P
-----END CERTIFICATE-----`
orgID = os.Getenv("MONGODB_ATLAS_ORG_ID")
projectName = acctest.RandomWithPrefix("test-acc")
cas = os.Getenv("CA_CERT")
orgID = os.Getenv("MONGODB_ATLAS_ORG_ID")
projectName = acctest.RandomWithPrefix("test-acc")
)

resource.ParallelTest(t, resource.TestCase{
Expand Down