keycloak-admin 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/Dockerfile +24 -0
  3. data/.github/workflows/ci.yml +80 -0
  4. data/.gitignore +9 -9
  5. data/.rspec +2 -2
  6. data/CHANGELOG.md +194 -183
  7. data/Dockerfile +12 -12
  8. data/Gemfile +3 -3
  9. data/Gemfile.lock +51 -49
  10. data/MIT-LICENSE +20 -20
  11. data/README.md +748 -482
  12. data/bin/console +9 -9
  13. data/keycloak-admin.gemspec +24 -24
  14. data/lib/keycloak-admin/client/attack_detection_client.rb +41 -41
  15. data/lib/keycloak-admin/client/client.rb +56 -56
  16. data/lib/keycloak-admin/client/client_authz_permission_client.rb +81 -0
  17. data/lib/keycloak-admin/client/client_authz_policy_client.rb +76 -0
  18. data/lib/keycloak-admin/client/client_authz_resource_client.rb +93 -0
  19. data/lib/keycloak-admin/client/client_authz_scope_client.rb +71 -0
  20. data/lib/keycloak-admin/client/client_client.rb +71 -71
  21. data/lib/keycloak-admin/client/client_role_client.rb +20 -20
  22. data/lib/keycloak-admin/client/client_role_mappings_client.rb +32 -32
  23. data/lib/keycloak-admin/client/configurable_token_client.rb +35 -35
  24. data/lib/keycloak-admin/client/group_client.rb +148 -131
  25. data/lib/keycloak-admin/client/identity_provider_client.rb +51 -51
  26. data/lib/keycloak-admin/client/realm_client.rb +122 -106
  27. data/lib/keycloak-admin/client/role_client.rb +59 -59
  28. data/lib/keycloak-admin/client/role_mapper_client.rb +47 -45
  29. data/lib/keycloak-admin/client/token_client.rb +29 -29
  30. data/lib/keycloak-admin/client/user_client.rb +266 -266
  31. data/lib/keycloak-admin/configuration.rb +52 -52
  32. data/lib/keycloak-admin/representation/attack_detection_representation.rb +17 -17
  33. data/lib/keycloak-admin/representation/camel_json.rb +12 -12
  34. data/lib/keycloak-admin/representation/client_authz_permission_representation.rb +34 -0
  35. data/lib/keycloak-admin/representation/client_authz_policy_config_representation.rb +15 -0
  36. data/lib/keycloak-admin/representation/client_authz_policy_representation.rb +27 -0
  37. data/lib/keycloak-admin/representation/client_authz_resource_representation.rb +26 -0
  38. data/lib/keycloak-admin/representation/client_authz_scope_representation.rb +17 -0
  39. data/lib/keycloak-admin/representation/client_representation.rb +71 -71
  40. data/lib/keycloak-admin/representation/credential_representation.rb +38 -38
  41. data/lib/keycloak-admin/representation/federated_identity_representation.rb +15 -15
  42. data/lib/keycloak-admin/representation/group_representation.rb +21 -21
  43. data/lib/keycloak-admin/representation/identity_provider_mapper_representation.rb +19 -19
  44. data/lib/keycloak-admin/representation/identity_provider_representation.rb +67 -67
  45. data/lib/keycloak-admin/representation/impersonation_redirection_representation.rb +16 -16
  46. data/lib/keycloak-admin/representation/impersonation_representation.rb +43 -43
  47. data/lib/keycloak-admin/representation/protocol_mapper_representation.rb +19 -19
  48. data/lib/keycloak-admin/representation/realm_representation.rb +14 -14
  49. data/lib/keycloak-admin/representation/representation.rb +23 -23
  50. data/lib/keycloak-admin/representation/role_representation.rb +19 -19
  51. data/lib/keycloak-admin/representation/session_representation.rb +22 -22
  52. data/lib/keycloak-admin/representation/token_representation.rb +39 -39
  53. data/lib/keycloak-admin/representation/user_representation.rb +47 -47
  54. data/lib/keycloak-admin/resource/base_role_containing_resource.rb +28 -28
  55. data/lib/keycloak-admin/resource/group_resource.rb +11 -11
  56. data/lib/keycloak-admin/resource/user_resource.rb +7 -7
  57. data/lib/keycloak-admin/version.rb +3 -3
  58. data/lib/keycloak-admin.rb +84 -75
  59. data/spec/client/attack_detection_client_spec.rb +102 -102
  60. data/spec/client/client_authz_permission_client_spec.rb +170 -0
  61. data/spec/client/client_authz_policy_client_spec.rb +170 -0
  62. data/spec/client/client_authz_resource_client_spec.rb +150 -0
  63. data/spec/client/client_authz_scope_client_spec.rb +134 -0
  64. data/spec/client/client_client_spec.rb +133 -133
  65. data/spec/client/client_role_mappings_client_spec.rb +82 -82
  66. data/spec/client/client_spec.rb +28 -28
  67. data/spec/client/configurable_token_client_spec.rb +34 -34
  68. data/spec/client/group_client_spec.rb +328 -258
  69. data/spec/client/identity_provider_client_spec.rb +92 -92
  70. data/spec/client/realm_client_spec.rb +155 -155
  71. data/spec/client/role_client_spec.rb +79 -79
  72. data/spec/client/role_mapper_client_spec.rb +113 -68
  73. data/spec/client/token_client_spec.rb +68 -68
  74. data/spec/client/user_client_spec.rb +373 -373
  75. data/spec/configuration_spec.rb +113 -113
  76. data/spec/integration/client_authorization_spec.rb +93 -0
  77. data/spec/representation/attack_detection_representation_spec.rb +15 -15
  78. data/spec/representation/client_authz_permission_representation_spec.rb +52 -0
  79. data/spec/representation/client_authz_policy_representation_spec.rb +47 -0
  80. data/spec/representation/client_authz_resource_representation_spec.rb +33 -0
  81. data/spec/representation/client_authz_scope_representation_spec.rb +19 -0
  82. data/spec/representation/client_representation_spec.rb +119 -119
  83. data/spec/representation/group_representation_spec.rb +22 -22
  84. data/spec/representation/identity_provider_mapper_representation_spec.rb +24 -24
  85. data/spec/representation/identity_provider_representation_spec.rb +113 -113
  86. data/spec/representation/impersonation_representation_spec.rb +163 -163
  87. data/spec/representation/protocol_mapper_representation_spec.rb +57 -57
  88. data/spec/representation/role_representation_spec.rb +37 -37
  89. data/spec/representation/session_representation_spec.rb +15 -15
  90. data/spec/representation/user_representation_spec.rb +15 -15
  91. data/spec/resource/group_resource_spec.rb +14 -14
  92. data/spec/resource/user_resource_spec.rb +14 -14
  93. data/spec/spec_helper.rb +37 -37
  94. metadata +29 -9
data/spec/spec_helper.rb CHANGED
@@ -1,37 +1,37 @@
1
- require_relative "../lib/keycloak-admin"
2
-
3
- require "byebug"
4
-
5
- def configure
6
- KeycloakAdmin.configure do |config|
7
- config.server_url = "http://auth.service.io/auth"
8
- config.server_domain = "auth.service.io"
9
- config.client_id = "admin-cli"
10
- config.client_secret = "aaaaaaaa"
11
- config.client_realm_name = "master2"
12
- config.use_service_account = true
13
- end
14
- end
15
-
16
- RSpec.configure do |config|
17
- config.expect_with :rspec do |expectations|
18
- expectations.include_chain_clauses_in_custom_matcher_descriptions = true
19
- end
20
-
21
- configure
22
- end
23
-
24
- def stub_token_client
25
- allow_any_instance_of(KeycloakAdmin::TokenClient).to receive(:get).and_return KeycloakAdmin::TokenRepresentation.new(
26
- "test_access_token", "token_type", "expires_in", "refresh_token",
27
- "refresh_expires_in", "id_token", "not_before_policy", "session_state"
28
- )
29
- end
30
-
31
- def stub_net_http_res(res_class, code, message)
32
- net_http_res = double(message: message, code: code)
33
- allow(net_http_res).to receive(:is_a?) do |target_class|
34
- target_class == res_class
35
- end
36
- allow(@response).to receive(:net_http_res).and_return(net_http_res)
37
- end
1
+ require_relative "../lib/keycloak-admin"
2
+
3
+ require "byebug"
4
+
5
+ def configure
6
+ KeycloakAdmin.configure do |config|
7
+ config.server_url = "http://auth.service.io/auth"
8
+ config.server_domain = "auth.service.io"
9
+ config.client_id = "admin-cli"
10
+ config.client_secret = "aaaaaaaa"
11
+ config.client_realm_name = "master2"
12
+ config.use_service_account = true
13
+ end
14
+ end
15
+
16
+ RSpec.configure do |config|
17
+ config.expect_with :rspec do |expectations|
18
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
19
+ end
20
+
21
+ configure
22
+ end
23
+
24
+ def stub_token_client
25
+ allow_any_instance_of(KeycloakAdmin::TokenClient).to receive(:get).and_return KeycloakAdmin::TokenRepresentation.new(
26
+ "test_access_token", "token_type", "expires_in", "refresh_token",
27
+ "refresh_expires_in", "id_token", "not_before_policy", "session_state"
28
+ )
29
+ end
30
+
31
+ def stub_net_http_res(res_class, code, message)
32
+ net_http_res = double(message: message, code: code)
33
+ allow(net_http_res).to receive(:is_a?) do |target_class|
34
+ target_class == res_class
35
+ end
36
+ allow(@response).to receive(:net_http_res).and_return(net_http_res)
37
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keycloak-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lorent Lempereur
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-22 00:00:00.000000000 Z
11
+ date: 2025-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-cookie
@@ -50,28 +50,28 @@ dependencies:
50
50
  requirements:
51
51
  - - '='
52
52
  - !ruby/object:Gem::Version
53
- version: 3.12.0
53
+ version: 3.13.2
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - '='
59
59
  - !ruby/object:Gem::Version
60
- version: 3.12.0
60
+ version: 3.13.2
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: byebug
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - '='
66
66
  - !ruby/object:Gem::Version
67
- version: 11.1.3
67
+ version: 12.0.0
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - '='
73
73
  - !ruby/object:Gem::Version
74
- version: 11.1.3
74
+ version: 12.0.0
75
75
  description: Keycloak Admin REST API client written in Ruby
76
76
  email:
77
77
  - lorent.lempereur.dev@gmail.com
@@ -79,6 +79,8 @@ executables: []
79
79
  extensions: []
80
80
  extra_rdoc_files: []
81
81
  files:
82
+ - ".github/workflows/Dockerfile"
83
+ - ".github/workflows/ci.yml"
82
84
  - ".gitignore"
83
85
  - ".rspec"
84
86
  - CHANGELOG.md
@@ -92,6 +94,10 @@ files:
92
94
  - lib/keycloak-admin.rb
93
95
  - lib/keycloak-admin/client/attack_detection_client.rb
94
96
  - lib/keycloak-admin/client/client.rb
97
+ - lib/keycloak-admin/client/client_authz_permission_client.rb
98
+ - lib/keycloak-admin/client/client_authz_policy_client.rb
99
+ - lib/keycloak-admin/client/client_authz_resource_client.rb
100
+ - lib/keycloak-admin/client/client_authz_scope_client.rb
95
101
  - lib/keycloak-admin/client/client_client.rb
96
102
  - lib/keycloak-admin/client/client_role_client.rb
97
103
  - lib/keycloak-admin/client/client_role_mappings_client.rb
@@ -106,6 +112,11 @@ files:
106
112
  - lib/keycloak-admin/configuration.rb
107
113
  - lib/keycloak-admin/representation/attack_detection_representation.rb
108
114
  - lib/keycloak-admin/representation/camel_json.rb
115
+ - lib/keycloak-admin/representation/client_authz_permission_representation.rb
116
+ - lib/keycloak-admin/representation/client_authz_policy_config_representation.rb
117
+ - lib/keycloak-admin/representation/client_authz_policy_representation.rb
118
+ - lib/keycloak-admin/representation/client_authz_resource_representation.rb
119
+ - lib/keycloak-admin/representation/client_authz_scope_representation.rb
109
120
  - lib/keycloak-admin/representation/client_representation.rb
110
121
  - lib/keycloak-admin/representation/credential_representation.rb
111
122
  - lib/keycloak-admin/representation/federated_identity_representation.rb
@@ -126,6 +137,10 @@ files:
126
137
  - lib/keycloak-admin/resource/user_resource.rb
127
138
  - lib/keycloak-admin/version.rb
128
139
  - spec/client/attack_detection_client_spec.rb
140
+ - spec/client/client_authz_permission_client_spec.rb
141
+ - spec/client/client_authz_policy_client_spec.rb
142
+ - spec/client/client_authz_resource_client_spec.rb
143
+ - spec/client/client_authz_scope_client_spec.rb
129
144
  - spec/client/client_client_spec.rb
130
145
  - spec/client/client_role_mappings_client_spec.rb
131
146
  - spec/client/client_spec.rb
@@ -138,7 +153,12 @@ files:
138
153
  - spec/client/token_client_spec.rb
139
154
  - spec/client/user_client_spec.rb
140
155
  - spec/configuration_spec.rb
156
+ - spec/integration/client_authorization_spec.rb
141
157
  - spec/representation/attack_detection_representation_spec.rb
158
+ - spec/representation/client_authz_permission_representation_spec.rb
159
+ - spec/representation/client_authz_policy_representation_spec.rb
160
+ - spec/representation/client_authz_resource_representation_spec.rb
161
+ - spec/representation/client_authz_scope_representation_spec.rb
142
162
  - spec/representation/client_representation_spec.rb
143
163
  - spec/representation/group_representation_spec.rb
144
164
  - spec/representation/identity_provider_mapper_representation_spec.rb
@@ -155,7 +175,7 @@ homepage: https://github.com/looorent/keycloak-admin-ruby
155
175
  licenses:
156
176
  - MIT
157
177
  metadata: {}
158
- post_install_message:
178
+ post_install_message:
159
179
  rdoc_options: []
160
180
  require_paths:
161
181
  - lib
@@ -171,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
191
  version: '0'
172
192
  requirements: []
173
193
  rubygems_version: 3.4.10
174
- signing_key:
194
+ signing_key:
175
195
  specification_version: 4
176
196
  summary: Keycloak Admin REST API client written in Ruby
177
197
  test_files: []