Skip to content

Commit

Permalink
Refactor advanced attributes of authorization profile resource
Browse files Browse the repository at this point in the history
  • Loading branch information
danischm committed Dec 2, 2023
1 parent a54f486 commit e532067
Show file tree
Hide file tree
Showing 13 changed files with 173 additions and 134 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.7 (unreleased)

- BREAKING CHANGE: Refactor `advanced_attributes` of `ise_authorization_profile` resource and data source

## 0.1.6

- Add `ise_downloadable_acl` resource and data source
Expand Down
11 changes: 6 additions & 5 deletions docs/data-sources/authorization_profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ data "ise_authorization_profile" "example" {

Read-Only:

- `attribute_1_dictionary_name` (String) Dictionary name
- `attribute_1_name` (String) Attribute name
- `attribute_1_value_type` (String) Advanced attribute value type
- `attribute_2_value` (String) Attribute value
- `attribute_2_value_type` (String) Advanced attribute value type
- `attribute_left_dictionary_name` (String) Dictionary name
- `attribute_left_name` (String) Attribute name
- `attribute_right_dictionary_name` (String) Dictionary name, only required when `attribute_right_value_type` is `AdvancedDictionaryAttribute`
- `attribute_right_name` (String) Attribute name, only required when `attribute_right_value_type` is `AdvancedDictionaryAttribute`
- `attribute_right_value` (String) Attribute value, only required when `attribute_right_value_type` is `AttributeValue`
- `attribute_right_value_type` (String) Advanced attribute value type
4 changes: 4 additions & 0 deletions docs/guides/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ description: |-

# Changelog

## 0.1.7 (unreleased)

- BREAKING CHANGE: Refactor `advanced_attributes` of `ise_authorization_profile` resource and data source

## 0.1.6

- Add `ise_downloadable_acl` resource and data source
Expand Down
23 changes: 11 additions & 12 deletions docs/resources/authorization_profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ resource "ise_authorization_profile" "example" {
reauthentication_timer = 1
advanced_attributes = [
{
attribute_1_value_type = "AdvancedDictionaryAttribute"
attribute_1_dictionary_name = "Cisco"
attribute_1_name = "cisco-av-pair"
attribute_2_value_type = "AttributeValue"
attribute_2_value = "set_nadprofile_vlan=true,vlan=TEST,tag=1"
attribute_left_dictionary_name = "Cisco"
attribute_left_name = "cisco-av-pair"
attribute_right_value_type = "AttributeValue"
attribute_right_value = "set_nadprofile_vlan=true,vlan=TEST,tag=1"
}
]
airespace_ipv6_acl = "ACL1"
Expand Down Expand Up @@ -119,14 +118,14 @@ resource "ise_authorization_profile" "example" {
<a id="nestedatt--advanced_attributes"></a>
### Nested Schema for `advanced_attributes`

Required:
Optional:

- `attribute_1_dictionary_name` (String) Dictionary name
- `attribute_1_name` (String) Attribute name
- `attribute_1_value_type` (String) Advanced attribute value type
- Choices: `AdvancedDictionaryAttribute`, `AttributeValue`
- `attribute_2_value` (String) Attribute value
- `attribute_2_value_type` (String) Advanced attribute value type
- `attribute_left_dictionary_name` (String) Dictionary name
- `attribute_left_name` (String) Attribute name
- `attribute_right_dictionary_name` (String) Dictionary name, only required when `attribute_right_value_type` is `AdvancedDictionaryAttribute`
- `attribute_right_name` (String) Attribute name, only required when `attribute_right_value_type` is `AdvancedDictionaryAttribute`
- `attribute_right_value` (String) Attribute value, only required when `attribute_right_value_type` is `AttributeValue`
- `attribute_right_value_type` (String) Advanced attribute value type
- Choices: `AdvancedDictionaryAttribute`, `AttributeValue`

## Import
Expand Down
9 changes: 4 additions & 5 deletions examples/resources/ise_authorization_profile/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ resource "ise_authorization_profile" "example" {
reauthentication_timer = 1
advanced_attributes = [
{
attribute_1_value_type = "AdvancedDictionaryAttribute"
attribute_1_dictionary_name = "Cisco"
attribute_1_name = "cisco-av-pair"
attribute_2_value_type = "AttributeValue"
attribute_2_value = "set_nadprofile_vlan=true,vlan=TEST,tag=1"
attribute_left_dictionary_name = "Cisco"
attribute_left_name = "cisco-av-pair"
attribute_right_value_type = "AttributeValue"
attribute_right_value = "set_nadprofile_vlan=true,vlan=TEST,tag=1"
}
]
airespace_ipv6_acl = "ACL1"
Expand Down
44 changes: 28 additions & 16 deletions gen/definitions/authorization_profile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ attributes:
- model_name: WebRedirectionType
data_path: [AuthorizationProfile, webRedirection]
type: String
enum_values: [CentralizedWebAuth, HotSpot, NativeSupplicanProvisioning, ClientProvisioning]
enum_values:
[
CentralizedWebAuth,
HotSpot,
NativeSupplicanProvisioning,
ClientProvisioning,
]
description: "This type must fit the `web_redirection_portal_name`"
example: CentralizedWebAuth
- model_name: acl
Expand Down Expand Up @@ -178,7 +184,7 @@ attributes:
tf_name: reauthentication_connectivity
type: String
enum_values: [DEFAULT, RADIUS_REQUEST]
description: Maintain Connectivity During Reauthentication
description: Maintain Connectivity During Reauthentication
example: DEFAULT
- model_name: timer
data_path: [AuthorizationProfile, reauth]
Expand All @@ -195,41 +201,47 @@ attributes:
attributes:
- model_name: AdvancedAttributeValueType
data_path: [leftHandSideDictionaryAttribue]
tf_name: attribute_1_value_type
type: String
enum_values: [AdvancedDictionaryAttribute, AttributeValue]
description: Advanced attribute value type
id: true
example: AdvancedDictionaryAttribute
value: AdvancedDictionaryAttribute
- model_name: dictionaryName
data_path: [leftHandSideDictionaryAttribue]
tf_name: attribute_1_dictionary_name
tf_name: attribute_left_dictionary_name
type: String
id: true
description: Dictionary name
example: Cisco
- model_name: attributeName
data_path: [leftHandSideDictionaryAttribue]
tf_name: attribute_1_name
tf_name: attribute_left_name
type: String
id: true
description: Attribute name
example: cisco-av-pair
- model_name: AdvancedAttributeValueType
tf_name: attribute_2_value_type
tf_name: attribute_right_value_type
data_path: [rightHandSideAttribueValue]
type: String
enum_values: [AdvancedDictionaryAttribute, AttributeValue]
description: Advanced attribute value type
id: true
example: AttributeValue
- model_name: value
data_path: [rightHandSideAttribueValue]
tf_name: attribute_2_value
tf_name: attribute_right_value
type: String
id: true
description: Attribute value
description: Attribute value, only required when `attribute_right_value_type` is `AttributeValue`
example: set_nadprofile_vlan=true,vlan=TEST,tag=1
- model_name: dictionaryName
data_path: [rightHandSideAttribueValue]
tf_name: attribute_right_dictionary_name
type: String
description: Dictionary name, only required when `attribute_right_value_type` is `AdvancedDictionaryAttribute`
example: Cisco
exclude_test: true
- model_name: attributeName
data_path: [rightHandSideAttribueValue]
tf_name: attribute_right_name
type: String
description: Attribute name, only required when `attribute_right_value_type` is `AdvancedDictionaryAttribute`
example: cisco-av-pair
exclude_test: true
- model_name: ipv6DaclName
data_path: [AuthorizationProfile]
type: String
Expand Down
12 changes: 6 additions & 6 deletions gen/templates/model.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 13 additions & 9 deletions internal/provider/data_source_ise_authorization_profile.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 8 additions & 10 deletions internal/provider/data_source_ise_authorization_profile_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e532067

Please sign in to comment.