Skip to content

Commit

Permalink
Testing fixes [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
bczoma authored Mar 19, 2024
1 parent 72b94ff commit 9334d8f
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 40 deletions.
52 changes: 47 additions & 5 deletions ci/module-test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ provider "solacebroker" {

module "testvpn" {
source = "../.."
# version = ""

msg_vpn_name = "testvpn"
acl_profile_name = "testvpn-acl-profile"
Expand Down Expand Up @@ -34,21 +35,61 @@ module "testvpn" {
cert_matching_rule_name = "testvpnCertMatchingRule"
cert_matching_rule_conditions = [
{
source = "issuer"
source = "issuer"
expression = "C = CA, ST = Ontario, L = Kanata, O = Solace Systems, OU = IT, CN = *.messaging.solace"
}
]
cert_matching_rule_attribute_filters = [
{
filter_name = "testFilter"
attribute_name = "username"
filter_name = "testFilter"
attribute_name = "username"
attribute_value = "test"
}
]
authentication_kerberos_enabled = true
}

output "created_msg_vpn" {
value = module.testvpn.msg_vpn
sensitive = true
}

output "created_acl_profile" {
value = module.testvpn.acl_profile
}

output "created_client_profile" {
value = module.testvpn.client_profile
}

output "created_oauth_profile" {
value = module.testvpn.oauth_profile
sensitive = true
}

output "created_oauth_profile_client_required_claims" {
value = module.testvpn.oauth_profile_client_required_claims
}

output "created_oauth_profile_resource_server_required_claims" {
value = module.testvpn.oauth_profile_resource_server_required_claims
}

output "created_cert_matching_rule" {
value = module.testvpn.cert_matching_rule
}

output "created_cert_matching_rule_conditions" {
value = module.testvpn.cert_matching_rule_conditions
}

output "created_cert_matching_rule_attribute_filters" {
value = module.testvpn.cert_matching_rule_attribute_filters
}

module "testvpn2" {
source = "../.."
# version = ""

msg_vpn_name = "testvpn2"
acl_profile_name = "testvpn-acl-profile2"
Expand All @@ -57,7 +98,8 @@ module "testvpn2" {

module "defaultvpn" {
source = "../.."
# version = ""

msg_vpn_name = "default"
enabled = false
msg_vpn_name = "default"
enabled = false
}
14 changes: 7 additions & 7 deletions ci/template-test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ module "testvpn" {
cert_matching_rule_name = "testvpnCertMatchingRule"
cert_matching_rule_conditions = [
{
source = "issuer"
source = "issuer"
expression = "C = CA, ST = Ontario, L = Kanata, O = Solace Systems, OU = IT, CN = *.messaging.solace"
}
]
cert_matching_rule_attribute_filters = [
{
filter_name = "testFilter"
attribute_name = "username"
filter_name = "testFilter"
attribute_name = "username"
attribute_value = "test"
}
]
}

output "created_msg_vpn" {
value = module.testvpn.msg_vpn
value = module.testvpn.msg_vpn
sensitive = true
}

Expand All @@ -61,7 +61,7 @@ output "created_client_profile" {
}

output "created_oauth_profile" {
value = module.testvpn.oauth_profile
value = module.testvpn.oauth_profile
sensitive = true
}

Expand Down Expand Up @@ -96,6 +96,6 @@ module "testvpn2" {
module "defaultvpn" {
source = "../../internal/gen-template"

msg_vpn_name = "default"
enabled = false
msg_vpn_name = "default"
enabled = false
}
2 changes: 1 addition & 1 deletion examples/basic-vpn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ terraform plan
terraform apply
```

Run `terraform destroy` to clean up created resources when no longer needed.
Run `terraform destroy` to clean up created resources when no longer needed. Note that as part of this command there may be a warning about default objects cannot be deleted, this is normal and expected here.

## Additional Documentation

Expand Down
16 changes: 1 addition & 15 deletions examples/basic-vpn/main.tf
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
# Copyright 2024 Solace Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

provider "solacebroker" {
username = "admin"
password = "admin"
Expand All @@ -21,7 +7,7 @@ provider "solacebroker" {
module "testvpn" {
source = "../.."

msg_vpn_name = "myvpn"
msg_vpn_name = "myvpn"

// No need to set the VPN enabled, it defaults to true
// enabled = true
Expand Down
2 changes: 1 addition & 1 deletion internal/gen-template/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ locals {
oauth_profile_client_required_claims_list = tolist(var.oauth_profile_client_required_claims)
oauth_profile_resource_server_required_claims_list = tolist(var.oauth_profile_resource_server_required_claims)
cert_matching_rule_conditions_list = tolist(var.cert_matching_rule_conditions)
cert_matching_rule_attribute_filters_list = tolist(var.cert_matching_rule_attribute_filters)
cert_matching_rule_attribute_filters_list = tolist(var.cert_matching_rule_attribute_filters)
}

resource "solacebroker_msg_vpn" "main" {
Expand Down
4 changes: 2 additions & 2 deletions internal/gen-template/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Output variable definitions

output "msg_vpn" {
value = try(solacebroker_msg_vpn.main, null)
value = try(solacebroker_msg_vpn.main, null)
sensitive = true
}

Expand All @@ -14,7 +14,7 @@ output "client_profile" {
}

output "oauth_profile" {
value = try(solacebroker_msg_vpn_authentication_oauth_profile.main, null)
value = try(solacebroker_msg_vpn_authentication_oauth_profile.main, null)
sensitive = true
}

Expand Down
18 changes: 9 additions & 9 deletions internal/gen-template/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -98,30 +98,30 @@ variable "oauth_profile_client_required_claims" {

variable "oauth_profile_resource_server_required_claims" {
description = "Additional claims to be verified in the access token. Ignored if `oauth_profile_name` is not set"
type = set(object({
type = set(object({
claim_name = string
claim_value = string
}))
default = []
default = []
}

variable "cert_matching_rule_conditions" {
description = "The conditions to be added to the Certification Matching Rule. Ignored if `cert_matching_rule_name` is not set"
type = set(object({
source = string
type = set(object({
source = string
expression = string
}))
default = []
default = []
}

variable "cert_matching_rule_attribute_filters" {
description = "The filters to be added to the Certification Matching Rule. A Cert Matching Rule Attribute Filter compares a username attribute to a string. Ignored if `cert_matching_rule_name` is not set"
type = set(object({
filter_name = string
attribute_name = string
type = set(object({
filter_name = string
attribute_name = string
attribute_value = string
}))
default = []
default = []
}

#AutoAddAttributes

0 comments on commit 9334d8f

Please sign in to comment.