keycloak-ruby-client 0.0.7 → 0.0.8
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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/keycloak/client.rb +6 -4
- data/lib/keycloak/model/base_representation.rb +5 -0
- data/lib/keycloak/utils/representation_iterator.rb +1 -1
- data/lib/keycloak/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15e664b3d8f91b89f7f6486f322a364a5b201045
|
4
|
+
data.tar.gz: a87cad169868812f3504296963c5306ea62f8c9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f4a1411d8033cfb0a1b9c4e551377266d3ced6c801e32ece8908220438735d0a899cf57728be994635284d7167a13932f663464cecd1771ccce3db1b1126fe7
|
7
|
+
data.tar.gz: 5931bbeb64841be046af2877ae8df52669c44e504ae1e32a515ceca1e39ff17fdc544247f329e3b8cd18b6a571aa75a4c94e81d532b4c56f38ecfc1b8c2f1d2d
|
data/README.md
CHANGED
@@ -103,7 +103,7 @@ client.create_user(user_rep, mapping_roles)
|
|
103
103
|
|
104
104
|
# NOTE: It's worth noting that `to_a` may be costly if you have a large dataset of users,
|
105
105
|
# which could cause out-of-memory, but using `each` instead of `to_a` could save you if
|
106
|
-
# you really want
|
106
|
+
# you really want iterate all users.
|
107
107
|
client.find_users.to_a.each { |user| puts user.to_json } # possibly out of memory
|
108
108
|
client.find_users.each { |user| puts user.to_json } # no risk of out of memory
|
109
109
|
|
data/lib/keycloak/client.rb
CHANGED
@@ -39,8 +39,9 @@ module Keycloak
|
|
39
39
|
}, try_refresh_token: false).body
|
40
40
|
@access_token = res["access_token"]
|
41
41
|
@refresh_token = res["refresh_token"]
|
42
|
-
|
43
|
-
@
|
42
|
+
now = DateTime.now
|
43
|
+
@refresh_expires_in = now + res["refresh_expires_in"].seconds
|
44
|
+
@expires_in = now + res["expires_in"].seconds
|
44
45
|
true
|
45
46
|
end
|
46
47
|
|
@@ -55,8 +56,9 @@ module Keycloak
|
|
55
56
|
}, try_refresh_token: false)
|
56
57
|
@access_token = res["access_token"]
|
57
58
|
@refresh_token = res["refresh_token"]
|
58
|
-
|
59
|
-
@
|
59
|
+
now = DateTime.now
|
60
|
+
@refresh_expires_in = now + res["refresh_expires_in"].seconds
|
61
|
+
@expires_in = now + res["expires_in"].seconds
|
60
62
|
end
|
61
63
|
|
62
64
|
def access_token_expired?
|
@@ -11,6 +11,11 @@ module Keycloak
|
|
11
11
|
def field(name, type = :any)
|
12
12
|
define_reader name, type
|
13
13
|
define_writer name, type
|
14
|
+
snake_case_name = name.to_s.underscore
|
15
|
+
if name.to_s != snake_case_name
|
16
|
+
alias_method snake_case_name, name
|
17
|
+
alias_method "#{snake_case_name}=", "#{name}="
|
18
|
+
end
|
14
19
|
|
15
20
|
name_sym = name.to_sym
|
16
21
|
attributes << name_sym
|
@@ -4,7 +4,7 @@ module Keycloak
|
|
4
4
|
#
|
5
5
|
# NOTE: It's worth noting that `to_a` may be costly if you have a large dataset of users,
|
6
6
|
# which could cause out-of-memory, but using `each` instead of `to_a` could save you if
|
7
|
-
# you really want
|
7
|
+
# you really want iterate all users.
|
8
8
|
class RepresentationIterator
|
9
9
|
DEFAULT_PER_PAGE = 30
|
10
10
|
|
data/lib/keycloak/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keycloak-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fuxin Hao
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|