keycloak-ruby-client 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e506562cf3e553040e4f4f23a7f6f78ef40fc4a7
4
- data.tar.gz: b2e074df8ee9aca46efb6f8e221db6d5a4593a65
3
+ metadata.gz: 15e664b3d8f91b89f7f6486f322a364a5b201045
4
+ data.tar.gz: a87cad169868812f3504296963c5306ea62f8c9c
5
5
  SHA512:
6
- metadata.gz: ac725a942db34e82d87af10f9c9d2793903e5f57b6093a0bf37f830ab2ca1b75e8e7f449c5b466750aaf7b15659ba582f2371a57d98d139e992cca32a53a0194
7
- data.tar.gz: b8fae9a84b37e6384999de49e6d1b643d12c0b119429cbb587cae3f67904223529ba99fc0035f565110b6687e4588895ae476921ce733f569fcc41cdde8bb3ae
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 traverse all users.
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
 
@@ -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
- @refresh_expires_in = DateTime.now + res["refresh_expires_in"].seconds
43
- @expires_in = DateTime.now + res["expires_in"].seconds
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
- @refresh_expires_in = DateTime.now + res["refresh_expires_in"].seconds
59
- @expires_in = DateTime.now + res["expires_in"].seconds
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 traverse all users.
7
+ # you really want iterate all users.
8
8
  class RepresentationIterator
9
9
  DEFAULT_PER_PAGE = 30
10
10
 
@@ -1,3 +1,3 @@
1
1
  module Keycloak
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
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.7
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-22 00:00:00.000000000 Z
11
+ date: 2019-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails