keycloak-admin 0.5 → 0.6
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/Gemfile.lock +1 -1
- data/README.md +4 -3
- data/lib/keycloak-admin/client/user_client.rb +10 -8
- data/lib/keycloak-admin/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: 24748705bdb51378a194d5619011da0754aa0e1c
|
4
|
+
data.tar.gz: 79a523aeedff44f1f27401733e4ef23a444cf4d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6df37036270ff57a96df074cdd02a750ee599ec7213f63c58d9be5c81cac390441ba6bf377e28003d25dc1ff4efbfa678e7b56ecfd171bafd1ddf638417ffda3
|
7
|
+
data.tar.gz: 08bfb61a6fc72f53bb178572650b677570f6be3ef140aa3d94fd04fb68194d85a76de294d02ac332219dd6743732017eccfe26487d9236312e2860deb7bfb2bf
|
data/Gemfile.lock
CHANGED
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.
|
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
|
-
|
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
|
80
|
-
user.email
|
81
|
-
user.username
|
82
|
-
user.email_verified
|
83
|
-
user.enabled
|
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
|
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.
|
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:
|
11
|
+
date: 2019-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-cookie
|