Skip to content

Commit eb4d42f

Browse files
authored
Client scope / Include in token scope attribute (#339)
* add include.in.token.scope client scope attribute * add reference for include_in_token_scope * remove default value to keep default value from keycloak
1 parent 149c85b commit eb4d42f

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

REFERENCE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,6 +1943,14 @@ display.on.consent.screen
19431943

19441944
Default value: `true`
19451945

1946+
##### `include_in_token_scope`
1947+
1948+
Valid values: ``true``, ``false``
1949+
1950+
include.in.token.scope
1951+
1952+
Default value: `true`
1953+
19461954
##### `ensure`
19471955

19481956
Valid values: `present`, `absent`

lib/puppet/provider/keycloak_client_scope/kcadm.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def self.instances
3030
attributes = d['attributes'] || {}
3131
client_scope[:consent_screen_text] = attributes['consent.screen.text']
3232
client_scope[:display_on_consent_screen] = attributes['display.on.consent.screen']
33+
client_scope[:include_in_token_scope] = attributes['include.in.token.scope']
3334
client_scopes << new(client_scope)
3435
end
3536
end
@@ -56,6 +57,7 @@ def create
5657
attributes = {}
5758
attributes['consent.screen.text'] = resource[:consent_screen_text]
5859
attributes['display.on.consent.screen'] = resource[:display_on_consent_screen]
60+
attributes['include.in.token.scope'] = resource[:include_in_token_scope]
5961
data[:attributes] = attributes
6062

6163
t = Tempfile.new('keycloak_client_scope')
@@ -107,6 +109,7 @@ def flush
107109
attributes = {}
108110
attributes['consent.screen.text'] = @property_flush[:consent_screen_text] if @property_flush[:consent_screen_text]
109111
attributes['display.on.consent.screen'] = @property_flush[:display_on_consent_screen] if @property_flush[:display_on_consent_screen]
112+
attributes['include.in.token.scope'] = @property_flush[:include_in_token_scope] if @property_flush[:include_in_token_scope]
110113
data[:attributes] = attributes if attributes
111114

112115
t = Tempfile.new('keycloak_client_scope')

lib/puppet/type/keycloak_client_scope.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@
5656
defaultto :true
5757
end
5858

59+
newproperty(:include_in_token_scope, boolean: true) do
60+
desc 'include.in.token.scope'
61+
newvalues(:true, :false)
62+
end
63+
5964
def self.title_patterns
6065
[
6166
[

spec/unit/puppet/type/keycloak_client_scope_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@
7272

7373
# Test boolean properties
7474
[
75-
:display_on_consent_screen
75+
:display_on_consent_screen,
76+
:include_in_token_scope
7677
].each do |p|
7778
it "accepts true for #{p}" do
7879
config[p] = true

0 commit comments

Comments
 (0)