generated from equinor/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: configure basic authentication for publishing (#77)
Co-authored-by: Henrik Simonsen Knutsen <[email protected]>
- Loading branch information
Showing
5 changed files
with
153 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
mock_provider "azurerm" {} | ||
|
||
run "setup_tests" { | ||
module { | ||
source = "./tests/setup-unit-tests" | ||
} | ||
} | ||
|
||
run "linux_basic_authentication_disabled" { | ||
command = plan | ||
|
||
variables { | ||
app_name = run.setup_tests.app_name | ||
resource_group_name = run.setup_tests.resource_group_name | ||
location = run.setup_tests.location | ||
app_service_plan_id = run.setup_tests.app_service_plan_id | ||
storage_account_id = run.setup_tests.storage_account_id | ||
log_analytics_workspace_id = run.setup_tests.log_analytics_workspace_id | ||
|
||
ftp_publish_basic_authentication_enabled = false | ||
webdeploy_publish_basic_authentication_enabled = false | ||
} | ||
|
||
assert { | ||
condition = azurerm_linux_function_app.this[0].ftp_publish_basic_authentication_enabled == false | ||
error_message = "Basic authentication enabled for the FTP client." | ||
} | ||
|
||
assert { | ||
condition = azurerm_linux_function_app.this[0].webdeploy_publish_basic_authentication_enabled == false | ||
error_message = "Basic authentication enabled for the WebDeploy client." | ||
} | ||
} | ||
|
||
run "linux_basic_authentication_enabled" { | ||
command = plan | ||
|
||
variables { | ||
app_name = run.setup_tests.app_name | ||
resource_group_name = run.setup_tests.resource_group_name | ||
location = run.setup_tests.location | ||
app_service_plan_id = run.setup_tests.app_service_plan_id | ||
storage_account_id = run.setup_tests.storage_account_id | ||
log_analytics_workspace_id = run.setup_tests.log_analytics_workspace_id | ||
|
||
ftp_publish_basic_authentication_enabled = true | ||
webdeploy_publish_basic_authentication_enabled = true | ||
} | ||
|
||
assert { | ||
condition = azurerm_linux_function_app.this[0].ftp_publish_basic_authentication_enabled == true | ||
error_message = "Basic authentication disabled for the FTP client." | ||
} | ||
|
||
assert { | ||
condition = azurerm_linux_function_app.this[0].webdeploy_publish_basic_authentication_enabled == true | ||
error_message = "Basic authentication disabled for the WebDeploy client." | ||
} | ||
} | ||
|
||
run "windows_basic_authentication_disabled" { | ||
command = plan | ||
|
||
variables { | ||
app_name = run.setup_tests.app_name | ||
resource_group_name = run.setup_tests.resource_group_name | ||
location = run.setup_tests.location | ||
kind = "Windows" | ||
app_service_plan_id = run.setup_tests.app_service_plan_id | ||
storage_account_id = run.setup_tests.storage_account_id | ||
log_analytics_workspace_id = run.setup_tests.log_analytics_workspace_id | ||
|
||
ftp_publish_basic_authentication_enabled = false | ||
webdeploy_publish_basic_authentication_enabled = false | ||
} | ||
|
||
assert { | ||
condition = azurerm_windows_function_app.this[0].ftp_publish_basic_authentication_enabled == false | ||
error_message = "Basic authentication enabled for the FTP client." | ||
} | ||
|
||
assert { | ||
condition = azurerm_windows_function_app.this[0].webdeploy_publish_basic_authentication_enabled == false | ||
error_message = "Basic authentication enabled for the WebDeploy client." | ||
} | ||
} | ||
|
||
run "windows_basic_authentication_enabled" { | ||
command = plan | ||
|
||
variables { | ||
app_name = run.setup_tests.app_name | ||
resource_group_name = run.setup_tests.resource_group_name | ||
location = run.setup_tests.location | ||
kind = "Windows" | ||
app_service_plan_id = run.setup_tests.app_service_plan_id | ||
storage_account_id = run.setup_tests.storage_account_id | ||
log_analytics_workspace_id = run.setup_tests.log_analytics_workspace_id | ||
|
||
ftp_publish_basic_authentication_enabled = true | ||
webdeploy_publish_basic_authentication_enabled = true | ||
} | ||
|
||
assert { | ||
condition = azurerm_windows_function_app.this[0].ftp_publish_basic_authentication_enabled == true | ||
error_message = "Basic authentication disabled for the FTP client." | ||
} | ||
|
||
assert { | ||
condition = azurerm_windows_function_app.this[0].webdeploy_publish_basic_authentication_enabled == true | ||
error_message = "Basic authentication disabled for the WebDeploy client." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters