keycloak-admin 0.5 → 0.6

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: 70b6714622b54d9fc925675f2a99a78fe0bdab18
4
- data.tar.gz: c7afa5ac9282faee2fe4e0d61dd754bf4f842d7a
3
+ metadata.gz: 24748705bdb51378a194d5619011da0754aa0e1c
4
+ data.tar.gz: 79a523aeedff44f1f27401733e4ef23a444cf4d8
5
5
  SHA512:
6
- metadata.gz: 1e64662dee5bc2671394248a01f2f89a3feb1497a06089ce5a0ddbc483ba0eb2e9bd8e5630ac9cb5690dfd8472e4d75fd854a7dde53049cee89c14cc994deca2
7
- data.tar.gz: e02240453e10ef9f56e5cc27ca60b55355941ef31d4b48e2b80fd10bcb475c7a6ee2107ec1e2f1b908c230fe10b7fc4c35b61cbbcd04193c1a2d15976027063c
6
+ metadata.gz: 6df37036270ff57a96df074cdd02a750ee599ec7213f63c58d9be5c81cac390441ba6bf377e28003d25dc1ff4efbfa678e7b56ecfd171bafd1ddf638417ffda3
7
+ data.tar.gz: 08bfb61a6fc72f53bb178572650b677570f6be3ef140aa3d94fd04fb68194d85a76de294d02ac332219dd6743732017eccfe26487d9236312e2860deb7bfb2bf
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- keycloak-admin (0.5)
4
+ keycloak-admin (0.6)
5
5
  http-cookie (~> 1.0, >= 1.0.3)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -12,7 +12,7 @@ This gem *does not* require Rails.
12
12
  For example, using `bundle`, add this line to your Gemfile.
13
13
 
14
14
  ```ruby
15
- gem "keycloak-admin", "0.5"
15
+ gem "keycloak-admin", "0.6"
16
16
  ```
17
17
 
18
18
  ## Login
@@ -113,7 +113,7 @@ Returns the provided `user`, which must be of type `KeycloakAdmin::UserRepresent
113
113
  KeycloakAdmin.realm("a_realm").users.save(user)
114
114
  ```
115
115
 
116
- ### Create and save a user with password
116
+ ### Create and save a user with password and a locale
117
117
 
118
118
  Returns the created user of type `KeycloakAdmin::UserRepresentation`.
119
119
 
@@ -122,7 +122,8 @@ username = "pioupioux"
122
122
  email = "pioupioux@email.com"
123
123
  password = "acme0"
124
124
  email_verified = true
125
- KeycloakAdmin.realm("a_realm").users.create!(username, email, password, email_verified)
125
+ locale = "en"
126
+ KeycloakAdmin.realm("a_realm").users.create!(username, email, password, email_verified, locale)
126
127
  ```
127
128
 
128
129
  ### Reset a password
@@ -6,8 +6,8 @@ module KeycloakAdmin
6
6
  @realm_client = realm_client
7
7
  end
8
8
 
9
- def create!(username, email, password, email_verified)
10
- user = save(build(username, email, password, email_verified))
9
+ def create!(username, email, password, email_verified, locale)
10
+ user = save(build(username, email, password, email_verified, locale))
11
11
  search(user.email)&.first
12
12
  end
13
13
 
@@ -75,12 +75,14 @@ module KeycloakAdmin
75
75
 
76
76
  private
77
77
 
78
- def build(username, email, password, email_verified)
79
- user = UserRepresentation.new
80
- user.email = email
81
- user.username = username
82
- user.email_verified = email_verified
83
- user.enabled = true
78
+ def build(username, email, password, email_verified, locale)
79
+ user = UserRepresentation.new
80
+ user.email = email
81
+ user.username = username
82
+ user.email_verified = email_verified
83
+ user.enabled = true
84
+ user.attributes = {}
85
+ user.attributes[:locale] = locale if locale
84
86
  user.add_credential(CredentialRepresentation.from_password(password))
85
87
  user
86
88
  end
@@ -1,3 +1,3 @@
1
1
  module KeycloakAdmin
2
- VERSION = "0.5"
2
+ VERSION = "0.6"
3
3
  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: '0.5'
4
+ version: '0.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lorent Lempereur
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-26 00:00:00.000000000 Z
11
+ date: 2019-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-cookie