diff --git a/CHANGELOG.md b/CHANGELOG.md index cc070b2..e49d645 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# Unreleased + +## Added + +* Added `api_key_enabled` attribute to role record. + # v3.0.3 * Allow annotations to be set on a policy resource. diff --git a/lib/conjur/policy/types/records.rb b/lib/conjur/policy/types/records.rb index 281aafc..26f3fd2 100644 --- a/lib/conjur/policy/types/records.rb +++ b/lib/conjur/policy/types/records.rb @@ -71,6 +71,12 @@ def immutable_attribute_names end module ActsAsRole + def self.included(base) + base.module_eval do + attribute :api_key_enabled, kind: :boolean, singular: true, dsl_accessor: true + end + end + def roleid default_account = nil [ account || default_account, role_kind, id ].join(":") end diff --git a/spec/round-trip/yaml/all-types-all-fields.expected.yml b/spec/round-trip/yaml/all-types-all-fields.expected.yml index f05855f..ff4e0f0 100644 --- a/spec/round-trip/yaml/all-types-all-fields.expected.yml +++ b/spec/round-trip/yaml/all-types-all-fields.expected.yml @@ -2,6 +2,7 @@ - !role id: team-1 kind: jenkins-folder + api_key_enabled: true - !resource id: my-secret kind: variable diff --git a/spec/round-trip/yaml/all-types-all-fields.yml b/spec/round-trip/yaml/all-types-all-fields.yml index 842f9eb..ff5b0e8 100644 --- a/spec/round-trip/yaml/all-types-all-fields.yml +++ b/spec/round-trip/yaml/all-types-all-fields.yml @@ -1,6 +1,7 @@ - !role kind: jenkins-folder id: team-1 + api_key_enabled: true - !resource kind: variable